Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| elearning:workbooks:docker2:drf02 [2021/04/14 12:37] – admin | elearning:workbooks:docker2:drf02 [2022/04/29 07:57] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| - | Version : **2021.01** | + | Version : **2022.01** |
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| Ligne 26: | Ligne 26: | ||
| * 2.5 - Création d'un Réseau overlay Personnalisé | * 2.5 - Création d'un Réseau overlay Personnalisé | ||
| * LAB #3 - Gestion de l' | * LAB #3 - Gestion de l' | ||
| - | * 3.1 - Rappel - Mise en Place avec Docker avec un réseau Bridge et des liens | + | * 3.1 - Mise en Place avec Docker Swarm avec des réseaux Overlay |
| - | * 3.2 - Mise en Place avec Docker Swarm avec des réseaux Overlay | + | |
| =====L' | =====L' | ||
| Ligne 41: | Ligne 40: | ||
| {{ : | {{ : | ||
| - | |||
| - | En plus des réseaux **bridge**, **host** et **none**, Docker propose deux autres types de réseaux, à savoir **overlay** et **macvlan**. Ce module concerne overlay. Pour plus d' | ||
| - | |||
| - | Comme son nom indique, un réseau overlay est un réseau qui se positionne au-dessus du réseau des hôtes. Lors de la création d'un réseau overlay, celui-ci n'est disponible par défaut qu'aux services swarm. Par contre il est possible de connecter des conteneurs autonomes au réseau overlay si l' | ||
| - | |||
| - | Le trafic lié à la gestion des services swarm est crypté par défaut avec l’algorithme AES en mode GCM. Afin de crypter le trafic des données liées aux applications il est possible d' | ||
| - | |||
| - | <WRAP center round important 60%> | ||
| - | **ATTENTION** : Le cryptage des données liées aux applications n'est pas compatible avec Windows(tm). Lors de la connexion du nœud Windows(tm) à un réseau overlay crypté, aucune erreur ne sera rapportée. Par contre le nœud sera incapable de communiquer. | ||
| - | </ | ||
| =====LAB #1 - Les Réseaux Docker ayant un Scope Local===== | =====LAB #1 - Les Réseaux Docker ayant un Scope Local===== | ||
| Ligne 122: | Ligne 111: | ||
| " | " | ||
| }, | }, | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | " | ||
| - | } | ||
| }, | }, | ||
| " | " | ||
| Ligne 144: | Ligne 126: | ||
| <WRAP center round important> | <WRAP center round important> | ||
| - | **Important** : Notez ici que les conteneurs **mongo2** et **resotest** ne disposent | + | **Important** : Notez ici que le conteneur |
| </ | </ | ||
| Ligne 177: | Ligne 159: | ||
| }, | }, | ||
| " | " | ||
| - | " | + | " |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | } | + | |
| }, | }, | ||
| " | " | ||
| Ligne 406: | Ligne 381: | ||
| [root@9f36a628c72b /]# exit | [root@9f36a628c72b /]# exit | ||
| exit | exit | ||
| - | root@debian9: | + | root@debian9: |
| mongo2 | mongo2 | ||
| - | root@debian9: | + | root@debian9: |
| mongo2 | mongo2 | ||
| - | root@debian9: | + | root@debian9: |
| root@735599480b45:/# | root@735599480b45:/# | ||
| search home | search home | ||
| Ligne 422: | Ligne 397: | ||
| root@735599480b45:/# | root@735599480b45:/# | ||
| exit | exit | ||
| - | root@debian9: | + | root@debian9: |
| mongo2 | mongo2 | ||
| - | root@debian9: | + | root@debian9: |
| mongo2 | mongo2 | ||
| - | root@debian9: | + | root@debian9: |
| root@718e7eab814f:/# | root@718e7eab814f:/# | ||
| 127.0.0.1 localhost | 127.0.0.1 localhost | ||
| Ligne 729: | Ligne 704: | ||
| Cette solution utilise un réseau de type Bridge. Ce type de réseau est limité aux conteneurs d'un hôte unique exécutant Docker. Les conteneurs ne peuvent communiquer qu' | Cette solution utilise un réseau de type Bridge. Ce type de réseau est limité aux conteneurs d'un hôte unique exécutant Docker. Les conteneurs ne peuvent communiquer qu' | ||
| - | =====LAB #2 - Gestion du Réseau overlay===== | + | Ouvrez le navigateur web **Firefox** ou **Chrome** dans **votre** machine et saisissez l'URL selon le tableau ci-dessous : |
| - | Commencez par re-créer un swarm : | + | ^ ID ^ URL ( Notez http: et non https: ) ^ |
| + | | Trainee10 | http:// | ||
| + | | Trainee11 | http:// | ||
| + | | Trainee12 | http:// | ||
| + | | Trainee13 | http:// | ||
| + | | Trainee14 | http:// | ||
| + | | Trainee15 | http:// | ||
| + | | Trainee16 | http:// | ||
| + | | Trainee17 | http:// | ||
| + | | Trainee18 | http:// | ||
| + | | Trainee19 | http:// | ||
| + | | Trainee20 | http:// | ||
| + | | Trainee21 | http:// | ||
| + | | Trainee22 | http:// | ||
| + | | Trainee23 | http:// | ||
| + | | Trainee24 | http:// | ||
| + | | Trainee25 | http:// | ||
| + | | Trainee26 | http:// | ||
| + | | Trainee27 | http:// | ||
| + | | Trainee28 | http:// | ||
| + | | Trainee29 | http:// | ||
| - | < | + | Dans la boîte de connexion d' |
| - | trainee@traineeXX:~$ ssh -l trainee 10.0.2.62 | + | |
| - | ... | + | |
| - | root@manager: | + | |
| - | Node left the swarm. | + | |
| - | root@manager: | + | |
| - | Swarm initialized: | + | |
| - | To add a worker to this swarm, run the following command: | + | Cliquez sur la connexion **TraineeXX_VNC** et testez ensuite votre application en utilisant le navigateur web de la machine virtuelle. |
| - | docker swarm join --token SWMTKN-1-23d7n1fkkk9rvlhty106q9390bfpf9daljjguq3s807le6c5qs-e0s1yqsajvmi7s8t9l9mw48ao 10.0.2.62: | + | =====LAB #2 - Gestion du Réseau overlay===== |
| - | To add a manager to this swarm, run ' | + | En plus des réseaux **bridge**, **host** et **none**, Docker propose deux autres types de réseaux, à savoir **overlay** et **macvlan**. Ce module concerne overlay. Pour plus d'informations concernant le type **macvlan**, |
| - | root@manager: | + | |
| - | trainee@manager: | + | |
| - | </code> | + | |
| - | ou | + | Comme son nom indique, un réseau overlay est un réseau qui se positionne au-dessus du réseau des hôtes. Lors de la création d'un réseau overlay, celui-ci n'est disponible par défaut qu'aux services swarm. Par contre il est possible de connecter des conteneurs autonomes au réseau overlay si l' |
| + | |||
| + | Le trafic lié à la gestion des services swarm est crypté par défaut avec l’algorithme AES en mode GCM. Afin de crypter le trafic des données liées aux applications il est possible d' | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | **ATTENTION** : Le cryptage des données liées aux applications n'est pas compatible avec Windows(tm). Lors de la connexion du nœud Windows(tm) à un réseau overlay crypté, aucune erreur ne sera rapportée. Par contre le nœud sera incapable de communiquer. | ||
| + | </ | ||
| + | |||
| + | Commencez par re-créer un swarm en utilisant les machines virtuelles **manager**, | ||
| < | < | ||
| - | trainee@traineeXX: | + | trainee@traineeXX: |
| ... | ... | ||
| root@manager: | root@manager: | ||
| Node left the swarm. | Node left the swarm. | ||
| - | root@manager: | + | root@manager: |
| Swarm initialized: | Swarm initialized: | ||
| To add a worker to this swarm, run the following command: | To add a worker to this swarm, run the following command: | ||
| - | docker swarm join --token SWMTKN-1-23d7n1fkkk9rvlhty106q9390bfpf9daljjguq3s807le6c5qs-e0s1yqsajvmi7s8t9l9mw48ao 10.0.2.42:2377 | + | docker swarm join --token SWMTKN-1-23d7n1fkkk9rvlhty106q9390bfpf9daljjguq3s807le6c5qs-e0s1yqsajvmi7s8t9l9mw48ao 10.0.2.62:2377 |
| To add a manager to this swarm, run ' | To add a manager to this swarm, run ' | ||
| Ligne 777: | Ligne 771: | ||
| Node left the swarm. | Node left the swarm. | ||
| root@worker1: | root@worker1: | ||
| - | This node joined a swarm as a worker. | ||
| - | root@worker1: | ||
| - | trainee@worker1: | ||
| - | </ | ||
| - | |||
| - | ou | ||
| - | |||
| - | < | ||
| - | trainee@traineeXX: | ||
| - | ... | ||
| - | root@worker1: | ||
| - | Node left the swarm. | ||
| - | root@worker1: | ||
| This node joined a swarm as a worker. | This node joined a swarm as a worker. | ||
| root@worker1: | root@worker1: | ||
| Ligne 803: | Ligne 784: | ||
| Node left the swarm. | Node left the swarm. | ||
| root@worker2: | root@worker2: | ||
| - | This node joined a swarm as a worker. | ||
| - | root@worker2: | ||
| - | trainee@worker2: | ||
| - | </ | ||
| - | |||
| - | ou : | ||
| - | |||
| - | < | ||
| - | trainee@traineeXX: | ||
| - | ... | ||
| - | root@worker2: | ||
| - | Node left the swarm. | ||
| - | root@worker2: | ||
| This node joined a swarm as a worker. | This node joined a swarm as a worker. | ||
| root@worker2: | root@worker2: | ||
| Ligne 825: | Ligne 793: | ||
| < | < | ||
| trainee@traineeXX: | trainee@traineeXX: | ||
| - | ... | ||
| - | root@manager: | ||
| - | ID HOSTNAME | ||
| - | b85hxlixbr1mh1txd1hrfe4us * | ||
| - | 4sui75vvdhmet4qvt0zbvzlzl | ||
| - | lbjtg5o9kw3x6xg7frm07jfuw | ||
| - | root@manager: | ||
| - | ID HOSTNAME | ||
| - | b85hxlixbr1mh1txd1hrfe4us * | ||
| - | root@manager: | ||
| - | ID HOSTNAME | ||
| - | 4sui75vvdhmet4qvt0zbvzlzl | ||
| - | lbjtg5o9kw3x6xg7frm07jfuw | ||
| - | </ | ||
| - | |||
| - | ou : | ||
| - | |||
| - | < | ||
| - | trainee@traineeXX: | ||
| ... | ... | ||
| root@manager: | root@manager: | ||
| Ligne 1890: | Ligne 1839: | ||
| {{ : | {{ : | ||
| - | |||
| - | Ouvrez le navigateur web **Firefox** ou **Chrome** dans **votre** machine et saisissez l'URL selon le tableau ci-dessous : | ||
| - | |||
| - | ^ ID ^ URL ( Notez http: et non https: ) ^ | ||
| - | | Trainee10 | http:// | ||
| - | | Trainee11 | http:// | ||
| - | | Trainee12 | http:// | ||
| - | | Trainee13 | http:// | ||
| - | | Trainee14 | http:// | ||
| - | | Trainee15 | http:// | ||
| - | | Trainee16 | http:// | ||
| - | | Trainee17 | http:// | ||
| - | | Trainee18 | http:// | ||
| - | | Trainee19 | http:// | ||
| - | | Trainee20 | http:// | ||
| - | | Trainee21 | http:// | ||
| - | | Trainee22 | http:// | ||
| - | | Trainee23 | http:// | ||
| - | | Trainee24 | http:// | ||
| - | | Trainee25 | http:// | ||
| - | | Trainee26 | http:// | ||
| - | | Trainee27 | http:// | ||
| - | | Trainee28 | http:// | ||
| - | | Trainee29 | http:// | ||
| - | |||
| - | Dans la boîte de connexion d' | ||
| ====3.1 - Mise en Place avec Docker Swarm avec des réseaux Overlay==== | ====3.1 - Mise en Place avec Docker Swarm avec des réseaux Overlay==== | ||
| Ligne 2059: | Ligne 1982: | ||
| La clef **deploy** permet de spécifier des options lors du déploiement du service : | La clef **deploy** permet de spécifier des options lors du déploiement du service : | ||
| - | * **mode** - Il existe deux types de services. **Replicated** où on spécifie le nombre d' | + | * **mode** - Il existe deux types de services. **Replicated** où on spécifie le nombre d' |
| + | |||
| + | {{ : | ||
| * **replicas** - spécifie le nombre de replicas | * **replicas** - spécifie le nombre de replicas | ||
| * **restart_policy** spécifie ce qui se passe en cas d' | * **restart_policy** spécifie ce qui se passe en cas d' | ||
| Ligne 2108: | Ligne 2034: | ||
| </ | </ | ||
| - | Retournez à la fenêtre d' | + | Retournez à la fenêtre d' |
| {{ : | {{ : | ||
| Ligne 2404: | Ligne 2330: | ||
| ----- | ----- | ||
| - | < | + | |
| - | <div align=" | + | Copyright © 2022 Hugh Norris. |
| - | Copyright © 2021 Hugh NORRIS | + | |
| - | </ | + | |
| - | </ | + | |