mirror of
https://gricad-gitlab.univ-grenoble-alpes.fr/tienyoun/presentations.git
synced 2026-09-26 21:41:08 +00:00
add 2025 directory
This commit is contained in:
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 28 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 27 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 18 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 83 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 64 KiB |
Binary file not shown.
@@ -0,0 +1,209 @@
|
||||
## Simplifiez vos déploiement avec la conteneurisation
|
||||
Nathan Tien You
|
||||
|
||||
---
|
||||
|
||||
## Sommaire
|
||||
- Introduction à la conteneurisation
|
||||
- Docker
|
||||
- Principes clés
|
||||
- Conteneurs
|
||||
- Images
|
||||
- Orchestration
|
||||
- Exemples d'applications
|
||||
|
||||
---
|
||||
|
||||
## Nathan Tien You
|
||||
<!-- .slide: data-visibility="hidden"-->
|
||||
- Ingénieur spécialité informatique
|
||||
- Développeur fullstack
|
||||
- Home Server :
|
||||
- Proxmox
|
||||
- Docker
|
||||
- Gitea actions
|
||||
- Amateur de jeux de deckbuilding
|
||||
|
||||
---
|
||||
|
||||
## Problématiques liées à la virtualisation
|
||||
- Gourmand (Mémoire, processeur, disque dur)
|
||||
- Installation lourde
|
||||
- Mises à jour et maintenance
|
||||
- Système d'exploitation
|
||||
- Outils de supervision
|
||||
- Dépendances / prérequis
|
||||
|
||||
---
|
||||
|
||||
## Infrastructure as code
|
||||
- Automatisation
|
||||
- Fiabilité
|
||||
- Efficacité
|
||||
- Contrôle des versions
|
||||
- Autodocumenté
|
||||
- Immutabilité
|
||||
|
||||
---
|
||||
|
||||
## Virtualisation du service
|
||||

|
||||
<!-- <sup>source : [Gitlab](https://gitlab.com)</sup> -->
|
||||
|
||||
---
|
||||
|
||||
## Différents types de conteneurisation
|
||||
- Conteneurs Processus
|
||||
- Docker
|
||||
- Podman
|
||||
- Conteneurs Machine
|
||||
- LXC
|
||||
- LXD
|
||||
|
||||
---
|
||||
|
||||
## Conteneurs
|
||||
Contexte d'éxecution isolé : chroot
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Base du conteneur : image
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Registres d'images
|
||||
<!-- .slide: data-visibility="hidden"-->
|
||||

|
||||
---
|
||||
|
||||
## Lancement d'un conteneur
|
||||
|
||||
```bash
|
||||
docker run hello-world
|
||||
```
|
||||

|
||||
|
||||
----
|
||||
|
||||
<!-- .slide: data-visibility="hidden" data-background-video="./assets/run.mp4" data-background-size="contain" -->
|
||||
|
||||
---
|
||||
|
||||
## Bonnes pratiques Docker
|
||||
- Conteneurs éphémères
|
||||
- Processus stateless
|
||||
- Architecture Shared-nothing
|
||||
- Images minimales
|
||||
- Installer uniquement le nécessaire
|
||||
- Compiler le code dans les images : pas de compilation en production
|
||||
|
||||
---
|
||||
|
||||
## Construction d'une image
|
||||
<!-- .slide: data-visibility="hidden"-->
|
||||
```Docker dockercompose
|
||||
FROM node:lts-alpine3.20
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
COPY package-lock.json ./
|
||||
COPY index.js ./
|
||||
RUN npm ci
|
||||
|
||||
CMD ["node", "index.js"]
|
||||
```
|
||||

|
||||
```bash
|
||||
docker buildx build . -t demo:latest
|
||||
```
|
||||
----
|
||||
|
||||
<!-- .slide: data-background-video="./assets/run.mp4" data-background-size="contain" data-visibility="hidden" -->
|
||||
|
||||
---
|
||||
|
||||
## Orchestration
|
||||
<!-- .slide: data-auto-animate -->
|
||||
Conteneur Docker = processus unitaire
|
||||
|
||||
**But : agencer plusieurs conteneurs pour faire une application**
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Orchestration
|
||||
<!-- .slide: data-auto-animate -->
|
||||
- Automatisation du déploiement
|
||||
- Horizontal Scaling
|
||||
- Nombreuses platformes
|
||||
- Kubernetes
|
||||
- Docker Compose
|
||||
- OpenShift
|
||||
|
||||
---
|
||||
|
||||
<h2>Exemple d'usage</h2>
|
||||
<object data-id="Compose.svg" data="./assets/Compose.drawio.svg" type="image/svg+xml"></object>
|
||||
|
||||
|
||||
----
|
||||
```yaml [|1-4,11-13,21-23|5-6,14-15,36-37|8-9,18-19,28-30,32-34|7,16-17,24-25,26-27] dockercompose
|
||||
services:
|
||||
|
||||
database:
|
||||
image: redis:alpine3.20
|
||||
volumes:
|
||||
- database-data:/data
|
||||
command: "redis-server --save 60 1"
|
||||
networks:
|
||||
- back
|
||||
|
||||
frontend:
|
||||
image: docker-demo/front
|
||||
build: ./front
|
||||
volumes:
|
||||
- ./test.txt:/usr/local/apache2/htdocs/test.txt
|
||||
ports:
|
||||
- "80:80"
|
||||
networks:
|
||||
- front
|
||||
|
||||
backend:
|
||||
image: docker-demo/backend
|
||||
build: ./back
|
||||
environment:
|
||||
- REDIS_URL=redis://database
|
||||
depends_on:
|
||||
- database
|
||||
networks:
|
||||
- back
|
||||
- front
|
||||
|
||||
networks:
|
||||
front:
|
||||
back:
|
||||
|
||||
volumes:
|
||||
database-data:
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Orchestration : Kubernetes
|
||||
- Clusters
|
||||
- Stockage distribué
|
||||
- Haute Disponibilité
|
||||
- Redondance
|
||||
- Stratégie de déploiement
|
||||
|
||||
---
|
||||
|
||||
## Où utiliser la conteneurisation ?
|
||||
- Services internes ou publics
|
||||
- DevOps (Déploiement et intégration continue)
|
||||
- Technologies Cloud (AWS, Azure...) ou on-prem
|
||||
- Complémentaire aux machines virtuelles
|
||||
@@ -0,0 +1,70 @@
|
||||
# Migration test -> prod HAPROXY
|
||||
|
||||
---
|
||||
|
||||
# Sommaire
|
||||
- Haute Disponibilité (HA) : éviter les coupures en prod
|
||||
- Déploiement : copie de test à prod
|
||||
|
||||
---
|
||||
|
||||
# Stratégies de déploiement
|
||||
- Blue Green Deployment
|
||||
- Rolling Deployment
|
||||
|
||||
Ressources : [Ansible](https://docs.ansible.com/ansible/latest/playbook_guide/guide_rolling_upgrade.html#the-rolling-upgrade), [AWS](https://docs.aws.amazon.com/pdfs/whitepapers/latest/blue-green-deployments/blue-green-deployments.pdf#welcome), [Blog Personnel](https://blog.itaysk.com/2017/11/20/deployment-strategies-defined)
|
||||
|
||||
---
|
||||
|
||||
|
||||
# HA
|
||||

|
||||
|
||||
---
|
||||
|
||||
# HA
|
||||

|
||||
|
||||
---
|
||||
|
||||
# HA
|
||||

|
||||
|
||||
---
|
||||
|
||||
# HA
|
||||

|
||||
|
||||
---
|
||||
|
||||
# HA : Notes
|
||||
- Reverse proxy
|
||||
- X-Forwarded-For
|
||||
- Choix du logiciel : HaProxy, Nginx, Apache...
|
||||
- Rollback difficile (sauf si...)
|
||||
- Health checks
|
||||
- Serveur "sur demande"
|
||||
|
||||
---
|
||||
|
||||
# Copie test -> prod
|
||||
- [ZFS](https://gricad-gitlab.univ-grenoble-alpes.fr/tienyoun/gdml_deployment/-/blob/zfs/prod_deploy.sh?ref_type=heads)
|
||||
- [rsync](https://gricad-gitlab.univ-grenoble-alpes.fr/tienyoun/gdml_deployment/-/blob/main/haproxy/prod_deploy.sh?ref_type=heads)
|
||||
|
||||
|
||||
---
|
||||
|
||||
| | ZFS | rsync |
|
||||
| ------------------------------------ | --- | ----- |
|
||||
| Abstraction hyperviseur | | x |
|
||||
| Simplicité/Complexité de maintenance | | x |
|
||||
| Simplicité/Complexité d'usage | | x |
|
||||
| Déduplication des données | x | |
|
||||
| Optimisation | x | |
|
||||
| Rollback | x | (?) |
|
||||
|
||||
---
|
||||
|
||||
# Choix ?
|
||||
* **Rsync** : pour les petits datasets ou pour des fichiers "statiques"
|
||||
* **ZFS** : pour les grosses données (>)
|
||||
@@ -0,0 +1,139 @@
|
||||
# Migration Geodesic ZFS
|
||||
|
||||
----
|
||||
|
||||
# Needs
|
||||

|
||||
|
||||
----
|
||||
|
||||
# Summary
|
||||
- Rsync
|
||||
- Offline migration (data files)
|
||||
- Online migration (dumps)
|
||||
- Snapshots
|
||||
- Virtual Machines
|
||||
- ZFS/BTRFS
|
||||
- Container-based solutions
|
||||
|
||||
----
|
||||
|
||||
## rsync/scp : offline migration
|
||||
|
||||

|
||||
|
||||
----
|
||||
|
||||
## rsync/scp : online migration
|
||||

|
||||
|
||||
----
|
||||
|
||||
## rsync/scp
|
||||
#### Possible practical issues :
|
||||
- File permissions
|
||||
- Postgres permissions
|
||||
- SSH keys
|
||||
- Configuration mismatch
|
||||
|
||||
<!--- Static files : `rsync` or `scp` --->
|
||||
```diff
|
||||
+ No big architectural changes
|
||||
- Lots of configuration
|
||||
- Heavy : will take time to backup and restore
|
||||
- Hacky ?
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
## Snapshots
|
||||
|
||||

|
||||
|
||||
----
|
||||
|
||||
## Snapshots
|
||||
|
||||

|
||||
|
||||
----
|
||||
|
||||
## Snapshots
|
||||
|
||||

|
||||
|
||||
----
|
||||
|
||||
## Snapshots
|
||||
|
||||

|
||||
|
||||
----
|
||||
|
||||
### Virtual Machine cloning
|
||||
```diff
|
||||
- Must fiddle with hypervisor
|
||||
- We don't want to nest virtual machines
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
### ZFS
|
||||

|
||||
> Conventional Filesystem
|
||||
|
||||
----
|
||||
|
||||
### ZFS
|
||||

|
||||
> Copy on write (CoW)
|
||||
|
||||
----
|
||||
|
||||
### ZFS
|
||||

|
||||
> Simplified CoW representation
|
||||
|
||||
----
|
||||
|
||||
### ZFS
|
||||

|
||||
> Snapshots using CoW
|
||||
|
||||
----
|
||||
|
||||
### ZFS
|
||||
#### Tools :
|
||||
- [zrepl](https://zrepl.github.io/quickstart.html)
|
||||
- [syncoid](https://github.com/jimsalterjrs/sanoid/wiki/Syncoid)
|
||||
```diff
|
||||
+ Automatic / Seamless
|
||||
- Possible use of untested additional tools/programs
|
||||
- Additional system complexity
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
### Container-based solutions
|
||||
#### LXD
|
||||
- Hypervisor for Linux Containers (LXC) and virtual machines
|
||||
- Can use ZFS
|
||||
- Canonical maintaned
|
||||
|
||||
|
||||
```diff
|
||||
+ Automatic / Seamless
|
||||
- Additional architectural complexity
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
#### Kubernetes Volume Cloning
|
||||
|
||||
```diff
|
||||
+ Automatic / Seamless
|
||||
- Additional architectural complexity
|
||||
- Definitely Hacky
|
||||
- Kubernetes
|
||||
- Better handled with operators/pods
|
||||
```
|
||||
Reference in New Issue
Block a user