Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| elearning:workbooks:kubernetes:k8s08 [2020/12/31 10:14] – created admin | elearning:workbooks:kubernetes:k8s08 [2024/12/20 15:20] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| - | Version - **2020.03** | + | Version - **2024.01** |
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| - | ======DOF301 | + | ======DOF309 |
| =====Contenu du Module===== | =====Contenu du Module===== | ||
| - | * **DOF301 | + | * **DOF309 |
| * Contenu du Module | * Contenu du Module | ||
| - | | + | * Présentation de Helm |
| - | | + | * LAB #1 - Travailler |
| - | * Master | + | * 1.1 - Installation de Helm |
| - | * Nœuds (Minions) | + | * 1.2 - La Commande helm search hub |
| - | * LAB #1 - Création du Cluster Kubernetes | + | * 1.3 - Rechercher dans le Helm Hub |
| - | * 1.1 - Présentation | + | * 1.4 - Ajouter et supprimer un Dépôt |
| - | * 1.2 - Créer le Réseau Privé Hôte 192.168.56.0/ | + | * 1.5 - La Commande helm search repo |
| - | * 1.3 - Démarrer les Machines Virtuelles | + | * 1.6 - La Commande helm show |
| - | * 1.4 - Connexion à la Machine Virtuelle kubemaster | + | * 1.7 - Installation d'un Chart |
| - | * 1.5 - Tester le Réseau | + | * 1.8 - La Commande helm get |
| - | * 1.6 - Initialisation du Maître du Cluster | + | * 1.9 - Utilisation des NOTES |
| - | * 1.7 - Installation d'une Extension Réseau pour la Communication entre des PODs | + | * 1.10 - La Commande helm upgrade |
| - | * 1.8 - Connexion des Travailleurs au Maître | + | * 1.11 - La Commande helm history |
| - | * LAB #2 - Création du Cluster Kubernetes avec Minikube | + | * 1.12 - La Commande |
| - | * 2.1 - Présentation de Minikube | + | * 1.13 - La Commande |
| - | * 2.2 - Installation de Minikube | + | * LAB #2 - Supervision de Kubernetes avec le Stack EFK |
| - | * 2.3 - Configuration de Minikube | + | * 2.1 - Présentation |
| - | * 2.4 - Installation de kubectl | + | * 2.2 - Installation |
| - | * 2.5 - Mettre à jour Minikube | + | * 2.3 - Installation |
| - | * 2.6 - La Commande | + | * 2.4 - Installation du Chart kibana |
| - | * 2.7 - La Commande | + | * 2.5 - Génération de Traces dans Kubernetes |
| - | * LAB #3 - Création du Cluster | + | * 2.6 - Visualisation des Données avec Kibana |
| - | * 3.1 - Présentation | + | |
| - | * 3.2 - Installation | + | |
| - | * 3.3 - Installation | + | |
| - | * 3.4 - Installation | + | |
| - | =====L' | + | =====Ressources===== |
| - | Les principales solutions de la containérisation sont : | + | ====Lab #1==== |
| - | * **[[https:// | + | * https:// |
| - | * **[[https://coreos.com/ | + | |
| - | * **[[https:// | + | |
| - | Les principales solutions d' | + | ====Lab #2==== |
| - | * **[[https://docs.docker.com/engine/swarm/|Docker Swarm]]**, | + | * https://www.dropbox.com/scl/fi/rmgz23mutsbvxe5qk8099/kibana-values.yaml? |
| - | * **[[https://kubernetes.io/ | + | * https://www.dropbox.com/scl/ |
| - | * **[[https://mesos.apache.org/|Mesos]]**. | + | |
| - | L' | + | =====Présentation |
| - | | + | **Helm** est un gestionnaire |
| - | | + | |
| - | | + | |
| - | =====Présentation de Kubernetes (k8s)===== | + | =====LAB #1 - Travailler avec Helm===== |
| - | ====Master==== | + | Placez-vous dans votre Gateway. Commencez par vérifier le status de Minikube : |
| - | * Contrôleur du cluster, | + | < |
| - | * Responsable de l' | + | trainee@gateway: |
| + | minikube | ||
| + | type: Control Plane | ||
| + | host: Running | ||
| + | kubelet: Running | ||
| + | apiserver: Running | ||
| + | kubeconfig: Configured | ||
| + | </ | ||
| - | Le Master contient : | + | ====1.1 - Installation de Helm==== |
| - | | + | Installez |
| - | | + | |
| - | | + | |
| - | | + | |
| - | * Contrôleur, | + | |
| - | * Surveille l' | + | |
| - | * Ordonnanceur, | + | |
| - | * Distribue les conteneurs existants aux nœuds et cherche des nouveaux conteneurs et les attribue aux nœuds. | + | |
| - | Certains ports doivent être ouverts sur le noeud maître | + | < |
| + | trainee@gateway: | ||
| + | Password: | ||
| - | ^ Protocole ^ Direction ^ Port(s) ^ Exécutable ^ | + | root@gateway: |
| - | | TCP | Entrante | 6443 | Kubernetes API server | | + | % Total % Received % Xferd Average Speed |
| - | | TCP | Entrante | 2379-2380 | etcd server client API | | + | Dload Upload |
| - | | TCP | Entrante | 10250 | Kubelet API | | + | 100 1699 100 1699 0 |
| - | | TCP | Entrante | 10251 | kube-scheduler | | + | |
| - | | TCP | Entrante | 10252 | kube-controller-manager | | + | |
| - | ====Noeuds | + | root@gateway: |
| + | deb [arch=amd64 signed-by=/ | ||
| - | * Machine physique ou virtuelle sur laquelle est installé Kubernetes, | + | root@gateway: |
| - | * Un travailleur sur lequel Kubernetes lance des conteneurs, | + | ... |
| - | Le Nœud contient | + | root@gateway:~# apt-get install helm |
| + | ... | ||
| + | </ | ||
| - | * Service kubelet, | + | Vérifiez ensuite votre travail : |
| - | * Agent qui s' | + | |
| - | * Container runtime, | + | |
| - | * Docker, | + | |
| - | * rkt (rocket), | + | |
| - | * CRI-O (crio). | + | |
| - | Certains ports doivent être ouverts sur chaque noeud travailleur | + | < |
| + | root@gateway:~# which helm | ||
| + | / | ||
| - | ^ Protocole ^ Direction ^ Port(s) ^ Exécutable ^ | + | root@gateway: |
| - | | TCP | Entrante | 10250 | Kubelet API | | + | version.BuildInfo{Version:" |
| - | | TCP | Entrante | 30000-32767 | Services NodePort | | + | </ |
| - | =====LAB #1 - Création du Cluster Kubernetes | + | Pour permettre l'auto-complétion de la ligne de commande |
| - | ====1.1 - Présentation==== | + | < |
| + | root@gateway: | ||
| + | logout | ||
| + | trainee@gateway: | ||
| - | Notez que les machines virtuelles utilisées avec Kubernetes doivent être sous une des distributions suivantes | + | trainee@gateway:~$ source <(helm completion bash) |
| + | </ | ||
| - | | + | Pour visualiser les variables d' |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | Chaque machine doit avoir : | + | < |
| - | + | trainee@gateway:~$ helm env | |
| - | * Un minimum de 2 GO de RAM, | + | HELM_BIN=" |
| - | * Un minimum de 2 CPU. | + | HELM_BURST_LIMIT=" |
| - | + | HELM_CACHE_HOME="/ | |
| - | Les machines doivent : | + | HELM_CONFIG_HOME="/ |
| - | + | HELM_DATA_HOME="/ | |
| - | * être dans le même réseau, | + | HELM_DEBUG=" |
| - | * posséder un nom d' | + | HELM_KUBEAPISERVER="" |
| - | * avoir le swap **désactivé**, | + | HELM_KUBEASGROUPS="" |
| - | * avoir l' | + | HELM_KUBEASUSER="" |
| - | + | HELM_KUBECAFILE="" | |
| - | Le serveur que vous utilisez est muni de VirtualBox. Trois machines virtuelles **Debian 9** ont été configurées selon le tableau ci-dessous : | + | HELM_KUBECONTEXT="" |
| - | + | HELM_KUBEINSECURE_SKIP_TLS_VERIFY=" | |
| - | ^ Machine Virtuelle ^ Nom d' | + | HELM_KUBETLS_SERVER_NAME="" |
| - | | kubemaster | kubemaster.ittraining.loc | 10.0.2.15 | 2022 > 22 | 192.168.56.2 | Aucune | | + | HELM_KUBETOKEN="" |
| - | | kubenode1 | kubenode1.ittraining.loc | 10.0.2.15 | 3022 > 22 | 192.168.56.3 | Aucune | | + | HELM_MAX_HISTORY=" |
| - | | kubenode2 | kubenode2.ittraining.loc | 10.0.2.15 | 4022 > 22 | 192.168.56.4 | Aucune | | + | HELM_NAMESPACE=" |
| - | + | HELM_PLUGINS="/ | |
| - | Les noms d' | + | HELM_QPS=" |
| - | + | HELM_REGISTRY_CONFIG="/ | |
| - | ^ Utilisateur ^ Mot de Passe ^ | + | HELM_REPOSITORY_CACHE="/ |
| - | | trainee | trainee | | + | HELM_REPOSITORY_CONFIG="/ |
| - | | root | fenestros | | + | </code> |
| <WRAP center round important 60%> | <WRAP center round important 60%> | ||
| - | **Important** : Chaque machine virtuelle a été pré-installée avec **Docker**, **kubeadm**, **kubelet** et **kubectl**. | + | **Important** : Notez que la valeur de la variable |
| </ | </ | ||
| - | ====1.2 - Créer le Réseau Privé Hôte 192.168.56.0/ | + | Pour visualiser l' |
| - | + | ||
| - | Créez le Réseau Privé Hôte **192.168.56.0/ | + | |
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage hostonlyif create | + | trainee@gateway:~$ kubectl config view |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | apiVersion: v1 |
| - | Interface ' | + | clusters: |
| + | - cluster: | ||
| + | certificate-authority-data: | ||
| + | server: https://192.168.42.99:8443 | ||
| + | name: 192-168-42-99: | ||
| + | - cluster: | ||
| + | certificate-authority: | ||
| + | extensions: | ||
| + | - extension: | ||
| + | last-update: | ||
| + | provider: minikube.sigs.k8s.io | ||
| + | version: v1.34.0 | ||
| + | name: cluster_info | ||
| + | server: https://192.168.59.100:8443 | ||
| + | name: minikube | ||
| + | contexts: | ||
| + | - context: | ||
| + | cluster: minikube | ||
| + | extensions: | ||
| + | - extension: | ||
| + | last-update: | ||
| + | provider: minikube.sigs.k8s.io | ||
| + | version: v1.34.0 | ||
| + | name: context_info | ||
| + | namespace: default | ||
| + | user: minikube | ||
| + | name: minikube | ||
| + | - context: | ||
| + | cluster: 192-168-42-99: | ||
| + | namespace: myproject | ||
| + | user: developer/ | ||
| + | name: minishift | ||
| + | - context: | ||
| + | cluster: 192-168-42-99: | ||
| + | namespace: myproject | ||
| + | user: developer/ | ||
| + | name: myproject/ | ||
| + | - context: | ||
| + | cluster: 192-168-42-99: | ||
| + | namespace: myproject | ||
| + | user: system: | ||
| + | name: myproject/ | ||
| + | current-context: | ||
| + | kind: Config | ||
| + | preferences: | ||
| + | users: | ||
| + | - name: developer/ | ||
| + | user: | ||
| + | token: REDACTED | ||
| + | - name: minikube | ||
| + | user: | ||
| + | client-certificate: | ||
| + | client-key: / | ||
| + | - name: system: | ||
| + | user: | ||
| + | client-certificate-data: | ||
| + | client-key-data: | ||
| </ | </ | ||
| - | ====1.3 - Démarrer les Machines Virtuelles==== | + | ====1.2 - La Commande helm search hub==== |
| - | Pour lancer la machine | + | Un grand nombre de Charts Helm sont regroupés sur le site **[[https:// |
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage startvm kubemaster | + | trainee@gateway:~$ helm search hub | more |
| - | Waiting | + | URL CHART VERSION |
| - | VM " | + | DESCRIPTION |
| + | https:// | ||
| + | Easily deploy any application that conforms to ... | ||
| + | https:// | ||
| + | 389 Directory Server | ||
| + | https:// | ||
| + | A Helm chart for 4ALLPORTAL version 3.10.0 and up | ||
| + | https:// | ||
| + | 7 Days to Die is an open-world game that is a u... | ||
| + | https:// | ||
| + | A Helm chart for A10 Thunder Kubernetes Connector | ||
| + | https:// | ||
| + | Deploy components for aad-pod-identity | ||
| + | https:// | ||
| + | ONAP Application Authorization Framework | ||
| + | https:// | ||
| + | ONAP Active and Available Inventory | ||
| + | https:// | ||
| + | A Helm chart for AAW Financial Data Reconciliation | ||
| + | https:// | ||
| + | Network Manager Living at Edge | ||
| + | https:// | ||
| + | --More-- | ||
| </ | </ | ||
| - | Pour lancer | + | Recherchez ensuite tout Chart contenant |
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage startvm kubenode1 | + | trainee@gateway:~$ helm search hub mysql |
| - | Waiting | + | URL CHART VERSION |
| - | VM " | + | https:// |
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| </ | </ | ||
| - | Pour lancer | + | <WRAP center round important 60%> |
| + | **Important** : Notez que la chaîne recherchée peut se retrouver dans l'URL aussi bien que dans la description. | ||
| + | </ | ||
| + | |||
| + | Recherchez maintenant le Chart **WordPress**. Par défaut, les colonnes plus large que 50 caractères sont tronquées | ||
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage startvm kubenode2 | + | trainee@gateway:~$ helm search hub wordpress |
| - | Waiting | + | URL CHART VERSION |
| - | VM " | + | https:// |
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| </ | </ | ||
| - | ====1.4 | + | Pour visualiser l' |
| - | + | ||
| - | Tapez la commande suivante pour vous connecter à la machine **kubemaster** : | + | |
| < | < | ||
| - | desktop@serverXX:~$ ssh -l trainee 192.168.56.2 | + | trainee@gateway:~$ helm search hub wordpress |
| + | URL CHART VERSION | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| + | https:// | ||
| </ | </ | ||
| - | ====1.5 - Tester le Réseau==== | + | Il est aussi possible d' |
| - | + | ||
| - | Vérifiez | + | |
| < | < | ||
| - | trainee@kubemaster:~$ ping -c 4 192.168.56.3 | + | trainee@gateway:~$ helm search hub wordpress |
| - | PING 192.168.56.3 (192.168.56.3) 56(84) bytes of data. | + | - app_version: |
| - | 64 bytes from 192.168.56.3: icmp_seq=1 ttl=64 time=0.762 ms | + | description: |
| - | 64 bytes from 192.168.56.3: icmp_seq=2 ttl=64 time=0.765 ms | + | repository: |
| - | 64 bytes from 192.168.56.3: icmp_seq=3 ttl=64 time=0.819 ms | + | name: kube-wordpress |
| - | 64 bytes from 192.168.56.3: icmp_seq=4 ttl=64 time=0.682 ms | + | url: https:// |
| + | url: https:// | ||
| + | version: 0.1.0 | ||
| + | - app_version: | ||
| + | description: | ||
| + | repository: | ||
| + | name: wordpress-mariadb | ||
| + | url: https:// | ||
| + | url: https:// | ||
| + | version: 1.0.2 | ||
| + | - app_version: 1.16.0 | ||
| + | description: | ||
| + | repository: | ||
| + | name: shubham-wordpress | ||
| + | url: https:// | ||
| + | url: https:// | ||
| + | version: 0.1.0 | ||
| + | - app_version: | ||
| + | description: | ||
| + | platform. Powerful yet simple, everyone | ||
| + | it to build beautiful, functional websites. | ||
| + | repository: | ||
| + | name: bitnami-aks | ||
| + | url: https:// | ||
| + | url: https:// | ||
| + | version: 15.2.13 | ||
| + | - app_version: | ||
| + | description: | ||
| + | platform. Powerful yet simple, everyone | ||
| + | it to build beautiful, functional websites. | ||
| + | repository: | ||
| + | name: bitnami | ||
| + | url: https:// | ||
| + | url: https:// | ||
| + | | ||
| + | - app_version: | ||
| + | description: | ||
| + | repository: | ||
| + | name: sikalabs | ||
| + | url: https:// | ||
| + | url: https:// | ||
| + | version: 0.2.0 | ||
| + | - app_version: | ||
| + | description: | ||
| + | repository: | ||
| + | name: riftbit | ||
| + | url: https:// | ||
| + | url: https:// | ||
| + | version: 12.1.16 | ||
| + | - app_version: | ||
| + | description: | ||
| + | repository: | ||
| + | name: schichtel | ||
| + | url: https:// | ||
| + | --More-- | ||
| + | </ | ||
| - | --- 192.168.56.3 ping statistics --- | + | ====1.3 |
| - | 4 packets transmitted, | + | |
| - | rtt min/ | + | |
| - | trainee@kubemaster: | + | |
| - | PING 192.168.56.4 (192.168.56.4) 56(84) bytes of data. | + | |
| - | 64 bytes from 192.168.56.4: | + | |
| - | 64 bytes from 192.168.56.4: | + | |
| - | 64 bytes from 192.168.56.4: | + | |
| - | 64 bytes from 192.168.56.4: | + | |
| - | --- 192.168.56.4 ping statistics --- | + | Rendez-vous ensuite à l' |
| - | 4 packets transmitted, | + | |
| - | rtt min/ | + | |
| - | trainee@kubemaster: | + | |
| - | PING www.free.fr (212.27.48.10) 56(84) bytes of data. | + | |
| - | 64 bytes from www.free.fr (212.27.48.10): | + | |
| - | 64 bytes from www.free.fr (212.27.48.10): | + | |
| - | 64 bytes from www.free.fr (212.27.48.10): | + | |
| - | 64 bytes from www.free.fr (212.27.48.10): icmp_seq=4 ttl=53 time=87.2 ms | + | |
| - | --- www.free.fr ping statistics --- | + | {{ : |
| - | 4 packets transmitted, | + | |
| - | rtt min/ | + | |
| - | </ | + | |
| - | ====1.6 - Initialisation | + | Dans le résultat retourné, cliquez sur **mysql** |
| - | Initialisez le maître du cluster **kubemaster** en spécifiant le CIDR de l' | + | {{ :elearning: |
| - | < | + | Vous constaterez des informations conernant ce Chart ainsi que des instructions pour l'installer |
| - | trainee@kubemaster: | + | |
| - | Mot de passe : fenestros | + | |
| - | root@kubemaster: | + | |
| - | W0922 10: | + | |
| - | [init] Using Kubernetes version: v1.19.2 | + | |
| - | [preflight] Running pre-flight checks | + | |
| - | [WARNING SystemVerification]: | + | |
| - | [preflight] Pulling images required for setting up a Kubernetes cluster | + | |
| - | [preflight] This might take a minute or two, depending on the speed of your internet connection | + | |
| - | [preflight] You can also perform this action in beforehand using 'kubeadm config images pull' | + | |
| - | [certs] Using certificateDir folder "/ | + | |
| - | [certs] Generating " | + | |
| - | [certs] Generating " | + | |
| - | [certs] apiserver serving cert is signed for DNS names [kubemaster.ittraining.loc kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local] and IPs [10.96.0.1 192.168.56.2] | + | |
| - | [certs] Generating " | + | |
| - | [certs] Generating " | + | |
| - | [certs] Generating " | + | |
| - | [certs] Generating " | + | |
| - | [certs] Generating " | + | |
| - | [certs] etcd/server serving cert is signed for DNS names [kubemaster.ittraining.loc localhost] and IPs [192.168.56.2 127.0.0.1 ::1] | + | |
| - | [certs] Generating " | + | |
| - | [certs] etcd/peer serving cert is signed for DNS names [kubemaster.ittraining.loc localhost] and IPs [192.168.56.2 127.0.0.1 ::1] | + | |
| - | [certs] Generating " | + | |
| - | [certs] Generating " | + | |
| - | [certs] Generating " | + | |
| - | [kubeconfig] Using kubeconfig folder "/ | + | |
| - | [kubeconfig] Writing " | + | |
| - | [kubeconfig] Writing " | + | |
| - | [kubeconfig] Writing " | + | |
| - | [kubeconfig] Writing " | + | |
| - | [kubelet-start] Writing kubelet environment file with flags to file "/ | + | |
| - | [kubelet-start] Writing kubelet configuration to file "/ | + | |
| - | [kubelet-start] Starting the kubelet | + | |
| - | [control-plane] Using manifest folder "/ | + | |
| - | [control-plane] Creating static Pod manifest for " | + | |
| - | [control-plane] Creating static Pod manifest for " | + | |
| - | [control-plane] Creating static Pod manifest for " | + | |
| - | [etcd] Creating static Pod manifest for local etcd in "/ | + | |
| - | [wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/ | + | |
| - | [apiclient] All control plane components are healthy after 17.505264 seconds | + | |
| - | [upload-config] Storing the configuration used in ConfigMap " | + | |
| - | [kubelet] Creating a ConfigMap " | + | |
| - | [upload-certs] Skipping phase. Please see --upload-certs | + | |
| - | [mark-control-plane] Marking the node kubemaster.ittraining.loc as control-plane by adding the label " | + | |
| - | [mark-control-plane] Marking the node kubemaster.ittraining.loc as control-plane by adding the taints [node-role.kubernetes.io/ | + | |
| - | [bootstrap-token] Using token: d5hb0g.a45h8d6qczwi3g5w | + | |
| - | [bootstrap-token] Configuring bootstrap tokens, cluster-info ConfigMap, RBAC Roles | + | |
| - | [bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to get nodes | + | |
| - | [bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials | + | |
| - | [bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token | + | |
| - | [bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster | + | |
| - | [bootstrap-token] Creating the " | + | |
| - | [kubelet-finalize] Updating "/ | + | |
| - | [addons] Applied essential addon: CoreDNS | + | |
| - | [addons] Applied essential addon: kube-proxy | + | |
| - | Your Kubernetes control-plane has initialized successfully! | + | {{ : |
| - | To start using your cluster, you need to run the following as a regular user: | + | ====1.4 - Ajouter et supprimer un Dépôt==== |
| - | mkdir -p $HOME/ | + | En utilisant les informations prises du Hub, installez maintenant le dépôt **bitnami** |
| - | sudo cp -i / | + | |
| - | sudo chown $(id -u):$(id -g) $HOME/ | + | |
| - | You should now deploy a pod network to the cluster. | + | < |
| - | Run " | + | trainee@gateway:~$ helm repo add bitnami |
| - | | + | " |
| + | </code> | ||
| - | Then you can join any number of worker nodes by running the following on each as root: | + | Pour lister les dépôts installés, utilisez la commande **helm repo list** |
| - | kubeadm join 192.168.56.2:6443 --token d5hb0g.a45h8d6qczwi3g5w \ | + | < |
| - | | + | trainee@gateway:~$ helm repo list |
| + | NAME URL | ||
| + | bitnami https:// | ||
| </ | </ | ||
| - | <WRAP center round important 60%> | + | Pour mettre à jour les dépôts, utilisez la commande |
| - | **Important** : Notez le message **Your Kubernetes control-plane has initialized successfully**. | + | |
| - | </ | + | |
| - | <WRAP center round todo 60%> | + | <code> |
| - | **A Faire** | + | trainee@gateway:~$ helm repo update |
| - | </WRAP> | + | Hang tight while we grab the latest from your chart repositories... |
| + | ...Successfully got an update from the " | ||
| + | Update Complete. ⎈Happy Helming!⎈ | ||
| + | </code> | ||
| - | Créez maintenant | + | Pour supprimer un dépôt, utilisez |
| < | < | ||
| - | root@kubemaster:~# export KUBECONFIG=/ | + | trainee@gateway:~$ helm repo remove bitnami |
| + | " | ||
| </ | </ | ||
| - | |||
| - | Insérez les deux lignes suivantes à la fin du fichier **/ | ||
| < | < | ||
| - | root@kubemaster:~# vi .bashrc | + | trainee@gateway:~$ helm repo list |
| - | root@kubemaster:~# tail .bashrc | + | Error: no repositories to show |
| - | ... | + | |
| - | KUBECONFIG=/ | + | |
| - | export KUBECONFIG | + | |
| </ | </ | ||
| - | ====1.7 - Installation d'une Extension Réseau pour la Communication entre des PODs==== | + | ====1.5 - La Commande helm search repo==== |
| - | Afin que les PODs puissent communiquer entre eux, il faut installer une extension pour le réseau . Il existe plusieurs extensions sur lesquelles nous reviendrons plus tard dans ce cours : | + | Ajoutez de nouveau |
| - | * **[[https:// | + | < |
| - | * **[[https:// | + | trainee@gateway:~$ helm repo add bitnami |
| - | * **[[https://coreos.com/flannel/ | + | " |
| - | * **[[https:// | + | </code> |
| - | * **[[https:// | + | |
| - | * **[[https:// | + | |
| - | * **[[https:// | + | |
| - | * **[[https:// | + | |
| - | * Canal (utilise Flannel pour le réseau et Calico pour le pare-feu). | + | |
| - | Afin d' | + | Pour voir le contenu de ce dépôt au format YAML, utilisez |
| < | < | ||
| - | root@kubemaster:~# curl https:// | + | trainee@gateway:~$ helm search repo bitnami --output yaml | more |
| - | | + | - app_version: 2.10.4 |
| - | Dload Upload | + | |
| - | 100 20679 100 20679 0 | + | acyclic graphs (DAGs). It includes utilities to schedule tasks, monitor task progress |
| - | root@kubemaster:~# ls | + | |
| - | calico.yaml | + | |
| - | root@kubemaster: | + | |
| - | configmap/ | + | - app_version: 2.4.62 |
| - | Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition | + | description: |
| - | customresourcedefinition.apiextensions.k8s.io/ | + | project is to provide a secure, efficient and extensible server that provides |
| - | customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created | + | HTTP services |
| - | customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created | + | name: bitnami/apache |
| - | customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created | + | |
| - | customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created | + | - app_version: |
| - | customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created | + | description: |
| - | customresourcedefinition.apiextensions.k8s.io/ | + | load balancing, dynamic upstream, canary release, circuit breaking, authentication, |
| - | customresourcedefinition.apiextensions.k8s.io/ | + | observability, |
| - | customresourcedefinition.apiextensions.k8s.io/ | + | name: bitnami/apisix |
| - | customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created | + | version: 3.7.0 |
| - | customresourcedefinition.apiextensions.k8s.io/ | + | - app_version: |
| - | customresourcedefinition.apiextensions.k8s.io/ | + | description: |
| - | customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created | + | tools, such as custom dashboards, admin panels or CRUD apps. |
| - | customresourcedefinition.apiextensions.k8s.io/ | + | name: bitnami/appsmith |
| - | clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created | + | version: 5.1.2 |
| - | clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created | + | - app_version: |
| - | clusterrole.rbac.authorization.k8s.io/calico-node created | + | description: |
| - | clusterrolebinding.rbac.authorization.k8s.io/calico-node created | + | name: bitnami/argo-cd |
| - | daemonset.apps/calico-node created | + | version: 7.1.1 |
| - | serviceaccount/ | + | - app_version: |
| - | deployment.apps/calico-kube-controllers created | + | description: |
| - | serviceaccount/ | + | It uses DAG and step-based workflows |
| + | name: bitnami/argo-workflows | ||
| + | | ||
| + | - app_version: | ||
| + | | ||
| + | created | ||
| + | the cross-platform | ||
| + | name: bitnami/aspnet-core | ||
| + | | ||
| + | - app_version: | ||
| + | | ||
| + | system designed to handle large amounts of data across many servers, providing | ||
| + | high availability with no single point of failure. | ||
| + | name: bitnami/cassandra | ||
| + | | ||
| + | - app_version: | ||
| + | description: | ||
| + | | ||
| + | name: bitnami/cert-manager | ||
| + | | ||
| + | - app_version: | ||
| + | description: | ||
| + | | ||
| + | process. | ||
| + | name: bitnami/chainloop | ||
| + | | ||
| + | - app_version: | ||
| + | | ||
| + | Linux container management platforms like Docker and Kubernetes. | ||
| + | --More-- | ||
| </ | </ | ||
| - | Vérifiez que tout est dans un état **Running** | + | Recherchez maintenant Wordpress |
| < | < | ||
| - | root@kubemaster:~# kubectl get pods --all-namespaces | + | trainee@gateway:~$ helm search repo wordpress |
| - | NAMESPACE | + | NAME CHART VERSION |
| - | kube-system | + | bitnami/wordpress |
| - | kube-system | + | bitnami/wordpress-intel 2.1.31 6.1.1 DEPRECATED WordPress for Intel is the most popu... |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| </ | </ | ||
| - | ====1.8 - Connexion | + | La commande précédement exécutée ne retourne que la dernière verstion de Wordpress. Pour voir la liste des versions disponibles, |
| - | Si vous avez oublié de copier la commande **kudadm join**, exécutez | + | < |
| + | trainee@gateway: | ||
| + | NAME CHART VERSION | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | bitnami/ | ||
| + | --More-- | ||
| + | </ | ||
| + | |||
| + | ====1.6 - La Commande helm show==== | ||
| + | |||
| + | Pour voir les méta-données d'une version du Chart, il convient d' | ||
| < | < | ||
| - | root@kubemaster:~# kubeadm token create | + | trainee@gateway:~$ helm show chart bitnami/ |
| - | W0922 11:01:22.063743 | + | annotations: |
| - | kubeadm join 192.168.56.2:6443 --token rcm3uz.lq4dshqdr00wkkpf | + | category: CMS |
| + | images: | | ||
| + | | ||
| + | image: docker.io/ | ||
| + | - name: os-shell | ||
| + | image: docker.io/ | ||
| + | - name: wordpress | ||
| + | image: docker.io/ | ||
| + | licenses: Apache-2.0 | ||
| + | apiVersion: v2 | ||
| + | appVersion: 6.7.1 | ||
| + | dependencies: | ||
| + | - condition: memcached.enabled | ||
| + | name: memcached | ||
| + | repository: oci:// | ||
| + | version: 7.x.x | ||
| + | - condition: mariadb.enabled | ||
| + | name: mariadb | ||
| + | repository: oci:// | ||
| + | | ||
| + | - name: common | ||
| + | repository: oci:// | ||
| + | tags: | ||
| + | - bitnami-common | ||
| + | version: | ||
| + | description: WordPress is the world' | ||
| + | platform. Powerful yet simple, everyone from students to global corporations use | ||
| + | it to build beautiful, functional websites. | ||
| + | home: https:// | ||
| + | icon: https:// | ||
| + | keywords: | ||
| + | - application | ||
| + | - blog | ||
| + | - cms | ||
| + | - http | ||
| + | - php | ||
| + | - web | ||
| + | - wordpress | ||
| + | maintainers: | ||
| + | - name: Broadcom, Inc. All Rights Reserved. | ||
| + | url: https:// | ||
| + | name: wordpress | ||
| + | sources: | ||
| + | - https:// | ||
| + | version: 24.1.5 | ||
| </ | </ | ||
| - | Connectez-vous à **kubenode1** : | + | Pour consultez le fichier README du Chart, il convient d' |
| < | < | ||
| - | root@kubemaster:~# ssh -l trainee kubenode1 | + | trainee@gateway:~$ helm show readme bitnami/ |
| - | The authenticity of host ' | + | <!--- app-name: WordPress |
| - | ECDSA key fingerprint is SHA256: | + | |
| - | Are you sure you want to continue connecting (yes/no)? yes | + | |
| - | Warning: Permanently added ' | + | |
| - | trainee@kubenode1' | + | |
| - | Linux kubenode1.ittraining.loc 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 | + | |
| - | The programs included with the Debian GNU/Linux system are free software; | + | # Bitnami package |
| - | the exact distribution terms for each program are described in the | + | |
| - | individual files in / | + | |
| - | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | + | WordPress is the world' |
| - | permitted by applicable law. | + | |
| - | Last login: Mon Sep 21 20:13:58 2020 from 192.168.56.1 | + | |
| - | trainee@kubenode1: | + | |
| - | </ | + | |
| - | Utilisez maintenant la commande copiée pour joindre le nœud au cluster | + | [Overview of WordPress](http:// |
| - | < | + | ## TL;DR |
| - | trainee@kubenode1: | + | |
| - | Mot de passe : fenestros | + | |
| - | root@kubenode1: | + | |
| - | [preflight] Running pre-flight checks | + | |
| - | [WARNING SystemVerification]: | + | |
| - | [preflight] Reading configuration from the cluster... | + | |
| - | [preflight] FYI: You can look at this config file with ' | + | |
| - | [kubelet-start] Writing kubelet configuration to file "/ | + | |
| - | [kubelet-start] Writing kubelet environment file with flags to file "/ | + | |
| - | [kubelet-start] Starting the kubelet | + | |
| - | [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... | + | |
| - | This node has joined the cluster: | + | ```console |
| - | * Certificate signing request was sent to apiserver and a response was received. | + | helm install my-release oci:// |
| - | * The Kubelet was informed of the new secure connection details. | + | ``` |
| - | Run ' | + | Looking |
| - | </code> | + | |
| - | Déconnectez-vous de kubenode1 et connectez-vous à **kubenode2** : | + | ## Introduction |
| - | < | + | This chart bootstraps a [WordPress](https://github.com/bitnami/containers/ |
| - | root@kubenode1: | + | er. |
| - | déconnexion | + | |
| - | trainee@kubenode1: | + | |
| - | déconnexion | + | |
| - | Connection to kubenode1 closed. | + | |
| - | root@kubemaster: | + | |
| - | The authenticity of host ' | + | |
| - | ECDSA key fingerprint is SHA256:sEfHBv9azmK60cjqF/aJgUc9jg56slNaZQdAUcvBOvE. | + | |
| - | Are you sure you want to continue connecting (yes/no)? yes | + | |
| - | Warning: Permanently added ' | + | |
| - | trainee@kubenode2' | + | |
| - | Linux kubenode2.ittraining.loc 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 | + | |
| - | The programs included with the Debian GNU/Linux system are free software; | + | It also packages |
| - | the exact distribution terms for each program are described in the | + | application, |
| - | individual files in /usr/share/doc/*/copyright. | + | |
| - | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | + | Bitnami charts can be used with [Kubeapps](https://kubeapps.dev/) for deployment and management of Helm Charts in clusters. |
| - | permitted by applicable law. | + | |
| - | Last login: Mon Sep 21 20:14:15 2020 from 192.168.56.1 | + | |
| - | trainee@kubenode2: | + | |
| - | </ | + | |
| - | Utilisez maintenant la commande copiée pour joindre le nœud au cluster : | + | ## Prerequisites |
| - | < | + | - Kubernetes 1.23+ |
| - | trainee@kubenode2: | + | - Helm 3.8.0+ |
| - | Mot de passe : fenestros | + | - PV provisioner support in the underlying infrastructure |
| - | root@kubenode2: | + | - ReadWriteMany volumes |
| - | [preflight] Running pre-flight checks | + | |
| - | [WARNING SystemVerification]: | + | |
| - | [preflight] Reading configuration from the cluster... | + | |
| - | [preflight] FYI: You can look at this config file with ' | + | |
| - | [kubelet-start] Writing kubelet configuration to file "/ | + | |
| - | [kubelet-start] Writing kubelet environment file with flags to file "/ | + | |
| - | [kubelet-start] Starting | + | |
| - | [kubelet-start] Waiting | + | |
| - | This node has joined | + | ## Installing |
| - | * Certificate signing request was sent to apiserver and a response was received. | + | |
| - | * The Kubelet was informed of the new secure connection details. | + | |
| - | Run ' | + | To install |
| + | |||
| + | ```console | ||
| + | helm install my-release oci:// | ||
| + | ``` | ||
| + | |||
| + | > Note: You need to substitute | ||
| + | NAME=registry-1.docker.io` and `REPOSITORY_NAME=bitnamicharts`. | ||
| + | |||
| + | The command deploys WordPress on the Kubernetes | ||
| + | |||
| + | > **Tip**: List all releases using `helm list` | ||
| + | |||
| + | ## Configuration and installation details | ||
| + | |||
| + | ### Resource requests and limits | ||
| + | |||
| + | Bitnami charts allow setting resource requests and limits for all containers inside the chart deployment. These are inside the `resources` value (check parameter table). Setting requests is essential for produc | ||
| + | tion workloads and these should be adapted to your specific use case. | ||
| + | |||
| + | To make this process easier, the chart contains the `resourcesPreset` values, which automatically sets the `resources` section according to different presets. Check these presets in [the bitnami/ | ||
| + | ttps:// | ||
| + | Find more information on container resource management in the [official Kubernetes documentation](https:// | ||
| + | --More-- | ||
| </ | </ | ||
| - | Attendez que l'état des nœuds soit **Ready** : | + | Pour consultez les valeurs du Chart, il convient d'utiliser la commande |
| < | < | ||
| - | root@kubenode2:~# exit | + | trainee@gateway:~$ helm show values bitnami/ |
| - | déconnexion | + | # Copyright Broadcom, Inc. All Rights Reserved. |
| - | trainee@kubenode2: | + | # SPDX-License-Identifier: |
| - | déconnexion | + | |
| - | Connection | + | ## @section Global parameters |
| - | root@kubemaster:~# | + | ## Global Docker image parameters |
| - | root@kubemaster: | + | ## Please, note that this will override the image parameters, including dependencies, |
| - | NAME STATUS | + | ## Current available global Docker image parameters: imageRegistry, |
| - | kubemaster.ittraining.loc | + | ## |
| - | kubenode1.ittraining.loc | + | |
| - | kubenode2.ittraining.loc Ready < | + | ## @param global.imageRegistry Global Docker image registry |
| + | ## @param global.imagePullSecrets Global Docker registry secret names as an array | ||
| + | ## @param global.defaultStorageClass Global default StorageClass for Persistent Volume(s) | ||
| + | ## | ||
| + | global: | ||
| + | imageRegistry: | ||
| + | ## E.g. | ||
| + | ## imagePullSecrets: | ||
| + | ## | ||
| + | ## | ||
| + | imagePullSecrets: | ||
| + | defaultStorageClass: | ||
| + | ## Security parameters | ||
| + | ## | ||
| + | security: | ||
| + | ## @param global.security.allowInsecureImages Allows skipping image verification | ||
| + | | ||
| + | ## Compatibility adaptations for Kubernetes platforms | ||
| + | ## | ||
| + | compatibility: | ||
| + | ## Compatibility adaptations for Openshift | ||
| + | ## | ||
| + | openshift: | ||
| + | ## @param global.compatibility.openshift.adaptSecurityContext Adapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup an | ||
| + | d fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptati | ||
| + | on) | ||
| + | ## | ||
| + | adaptSecurityContext: | ||
| + | ## @section Common parameters | ||
| + | ## | ||
| + | |||
| + | ## @param kubeVersion Override Kubernetes version | ||
| + | ## | ||
| + | kubeVersion: | ||
| + | ## @param nameOverride String to partially override common.names.fullname template (will maintain the release name) | ||
| + | ## | ||
| + | nameOverride: | ||
| + | ## @param fullnameOverride String to fully override common.names.fullname template | ||
| + | ## | ||
| + | fullnameOverride: | ||
| + | ## @param commonLabels Labels to add to all deployed resources | ||
| + | ## | ||
| + | commonLabels: | ||
| + | ## @param commonAnnotations Annotations to add to all deployed resources | ||
| + | ## | ||
| + | commonAnnotations: | ||
| + | ## @param clusterDomain Kubernetes Cluster Domain | ||
| + | ## | ||
| + | clusterDomain: | ||
| + | --More-- | ||
| </ | </ | ||
| - | Arrêtez maintenant | + | <WRAP center round important 60%> |
| + | **Important** : Les valeurs par défaut peuvent être surchargées par des valeurs dans un fichier au format YAML. | ||
| + | </ | ||
| + | |||
| + | Pour consultez | ||
| < | < | ||
| - | root@kubemaster:~# exit | + | trainee@gateway:~$ helm show all bitnami/ |
| - | déconnexion | + | annotations: |
| - | trainee@kubemaster: | + | category: CMS |
| - | déconnexion | + | images: | |
| - | Connection | + | - name: apache-exporter |
| + | image: docker.io/ | ||
| + | - name: os-shell | ||
| + | image: docker.io/ | ||
| + | - name: wordpress | ||
| + | image: docker.io/ | ||
| + | licenses: Apache-2.0 | ||
| + | apiVersion: v2 | ||
| + | appVersion: 6.7.1 | ||
| + | dependencies: | ||
| + | - condition: memcached.enabled | ||
| + | name: memcached | ||
| + | repository: oci:// | ||
| + | version: 7.x.x | ||
| + | - condition: mariadb.enabled | ||
| + | name: mariadb | ||
| + | repository: oci:// | ||
| + | version: 20.x.x | ||
| + | - name: common | ||
| + | repository: oci:// | ||
| + | tags: | ||
| + | - bitnami-common | ||
| + | version: 2.x.x | ||
| + | description: | ||
| + | platform. Powerful yet simple, everyone from students to global corporations use | ||
| + | it to build beautiful, functional websites. | ||
| + | home: https:// | ||
| + | icon: https:// | ||
| + | keywords: | ||
| + | - application | ||
| + | - blog | ||
| + | - cms | ||
| + | - http | ||
| + | - php | ||
| + | - web | ||
| + | - wordpress | ||
| + | maintainers: | ||
| + | - name: Broadcom, Inc. All Rights Reserved. | ||
| + | url: https:// | ||
| + | name: wordpress | ||
| + | sources: | ||
| + | - https:// | ||
| + | version: 24.1.5 | ||
| + | |||
| + | --- | ||
| + | # Copyright Broadcom, Inc. All Rights Reserved. | ||
| + | # SPDX-License-Identifier: | ||
| + | |||
| + | ## @section Global parameters | ||
| + | ## Global Docker image parameters | ||
| + | ## Please, note that this will override the image parameters, including dependencies, | ||
| + | ## Current available global Docker image parameters: imageRegistry, | ||
| + | ## | ||
| + | |||
| + | ## @param global.imageRegistry Global Docker image registry | ||
| + | --More-- | ||
| </ | </ | ||
| + | |||
| + | ====1.7 - Installation d'un Chart==== | ||
| + | |||
| + | Créez un Namespace appelé **dof309** dans lequel vous allez installer WordPress : | ||
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage controlvm kubenode2 poweroff | + | trainee@gateway:~$ kubectl create namespace dof309 |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | namespace/ |
| </ | </ | ||
| + | |||
| + | Créez le fichier **wordpress-values.yaml** contenant des valeurs qui surchargeront celles du Chart WordPress : | ||
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage controlvm kubenode1 poweroff | + | trainee@gateway:~$ vi wordpress-values.yaml |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | trainee@gateway: |
| + | wordpressUsername: | ||
| + | wordpressPassword: | ||
| + | wordpressEmail: | ||
| + | wordpressFirstName: | ||
| + | wordpressLastName: | ||
| + | wordpressBlogName: | ||
| + | service: | ||
| + | type: NodePort | ||
| </ | </ | ||
| + | |||
| + | Installez maintenant le Chart WordPress : | ||
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage controlvm kubemaster poweroff | + | trainee@gateway:~$ helm install wordpress bitnami/ |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | NAME: wordpress |
| + | LAST DEPLOYED: Fri Dec 20 15:14:17 2024 | ||
| + | NAMESPACE: dof309 | ||
| + | STATUS: deployed | ||
| + | REVISION: 1 | ||
| + | TEST SUITE: None | ||
| + | NOTES: | ||
| + | CHART NAME: wordpress | ||
| + | CHART VERSION: 24.1.5 | ||
| + | APP VERSION: 6.7.1 | ||
| + | |||
| + | Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, | ||
| + | |||
| + | ** Please be patient while the chart is being deployed ** | ||
| + | |||
| + | Your WordPress site can be accessed through the following DNS name from within your cluster: | ||
| + | |||
| + | wordpress.dof309.svc.cluster.local (port 80) | ||
| + | |||
| + | To access your WordPress site from outside the cluster follow the steps below: | ||
| + | |||
| + | 1. Get the WordPress URL by running these commands: | ||
| + | |||
| + | | ||
| + | | ||
| + | echo " | ||
| + | echo " | ||
| + | |||
| + | 2. Open a browser and access WordPress using the obtained URL. | ||
| + | |||
| + | 3. Login with the following credentials below to see your blog: | ||
| + | |||
| + | echo Username: helm-user | ||
| + | echo Password: $(kubectl get secret --namespace dof309 wordpress -o jsonpath=" | ||
| + | |||
| + | WARNING: There are " | ||
| + | - resources | ||
| + | +info https:// | ||
| </ | </ | ||
| - | Ensuite restaurez | + | Vérifiez ls statut du deployment de l'application |
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage snapshot kubenode2 restore snapshot1 | + | trainee@gateway:~$ helm list --namespace dof309 |
| - | Restoring snapshot ' | + | NAME NAMESPACE |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | wordpress |
| </ | </ | ||
| + | |||
| + | ====1.8 - La Commande helm get==== | ||
| + | |||
| + | Helm utilise un système de **Hooks** qui permet au développeurs d' | ||
| + | |||
| + | * pre-install | ||
| + | * post-install | ||
| + | * pre-delete | ||
| + | * post-delete | ||
| + | * pre-upgrade | ||
| + | * post-upgrade | ||
| + | * pre-rollback | ||
| + | * post-rollback | ||
| + | * test | ||
| + | |||
| + | Pour visualiser les Hooks, s'ils existent, il convient d' | ||
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage snapshot kubenode1 restore snapshot1 | + | trainee@gateway:~$ helm get hooks wordpress |
| - | Restoring snapshot ' | + | trainee@gateway: |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | |
| </ | </ | ||
| + | |||
| + | Pour consulter les manifests, utilisez la commande **helm get manifest** : | ||
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage snapshot kubemaster restore snapshot1 | + | trainee@gateway:~$ helm get manifest wordpress --namespace dof309 | more |
| - | Restoring snapshot ' | + | --- |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | # Source: wordpress/ |
| + | kind: NetworkPolicy | ||
| + | apiVersion: networking.k8s.io/ | ||
| + | metadata: | ||
| + | name: wordpress-mariadb | ||
| + | | ||
| + | labels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/name: mariadb | ||
| + | app.kubernetes.io/ | ||
| + | helm.sh/ | ||
| + | app.kubernetes.io/part-of: mariadb | ||
| + | spec: | ||
| + | podSelector: | ||
| + | matchLabels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/name: mariadb | ||
| + | app.kubernetes.io/version: 11.4.4 | ||
| + | helm.sh/chart: mariadb-20.2.1 | ||
| + | policyTypes: | ||
| + | - Ingress | ||
| + | - Egress | ||
| + | egress: | ||
| + | - {} | ||
| + | ingress: | ||
| + | - ports: | ||
| + | - port: 3306 | ||
| + | - port: 3306 | ||
| + | --- | ||
| + | # Source: wordpress/ | ||
| + | kind: NetworkPolicy | ||
| + | apiVersion: networking.k8s.io/v1 | ||
| + | metadata: | ||
| + | name: wordpress | ||
| + | namespace: " | ||
| + | labels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | helm.sh/ | ||
| + | spec: | ||
| + | podSelector: | ||
| + | matchLabels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | policyTypes: | ||
| + | - Ingress | ||
| + | - Egress | ||
| + | egress: | ||
| + | - {} | ||
| + | ingress: | ||
| + | - ports: | ||
| + | - port: 8080 | ||
| + | - port: 8443 | ||
| + | --More-- | ||
| </ | </ | ||
| - | Dernièrement supprimez | + | Il est possible de revoir les **NOTES** imprimées à l' |
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage hostonlyif remove " | + | trainee@gateway:~$ helm get notes wordpress --namespace dof309 |
| - | 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% | + | NOTES: |
| - | </ | + | CHART NAME: wordpress |
| - | </ | + | CHART VERSION: 24.1.5 |
| + | APP VERSION: 6.7.1 | ||
| - | =====LAB #2 - Création du Cluster Kubernetes avec Minikube===== | + | Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, |
| - | ====2.1 - Présentation de Minikube==== | + | ** Please be patient while the chart is being deployed ** |
| - | Pour installer Kubernetes rapidement et facilement il convient d' | + | Your WordPress site can be accessed through the following DNS name from within your cluster: |
| - | ====2.2 - Installation de Minikube==== | + | wordpress.dof309.svc.cluster.local (port 80) |
| - | Commencez par télécharger Minikube | + | To access your WordPress site from outside the cluster follow the steps below: |
| - | < | + | 1. Get the WordPress URL by running these commands: |
| - | desktop@serverXX: | + | |
| - | --2020-11-18 09: | + | |
| - | Resolving github.com (github.com)... 140.82.121.4 | + | |
| - | Connecting to github.com (github.com)|140.82.121.4|: | + | echo " |
| - | HTTP request sent, awaiting response... 302 Found | + | echo " |
| - | Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/56353740/ | + | |
| - | --2020-11-18 09:43: | + | 2. Open a browser and access WordPress using the obtained URL. |
| - | Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.113.131 | + | |
| - | Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.113.131|: | + | 3. Login with the following credentials below to see your blog: |
| - | HTTP request sent, awaiting response... 200 OK | + | |
| - | Length: 55960880 (53M) [application/ | + | |
| - | Saving | + | |
| - | minikube-linux-amd64 100%[=========================================================================================================================================> | + | echo Username: helm-user |
| + | echo Password: $(kubectl get secret | ||
| - | 2020-11-18 09:43:24 (9.24 MB/s) - ‘minikube-linux-amd64’ saved [55960880/55960880] | + | WARNING: There are " |
| + | - resources | ||
| + | +info https:// | ||
| </ | </ | ||
| - | Renommez | + | Pour visualiser les valeurs spécifiées par l' |
| < | < | ||
| - | desktop@serverXX:~$ mv minikube-linux-amd64 minikube | + | trainee@gateway:~$ helm get values wordpress |
| - | desktop@serverXX:~$ chmod u+x minikube | + | USER-SUPPLIED VALUES: |
| + | service: | ||
| + | type: NodePort | ||
| + | wordpressBlogName: | ||
| + | wordpressEmail: | ||
| + | wordpressFirstName: Helm | ||
| + | wordpressLastName: | ||
| + | wordpressPassword: | ||
| + | wordpressUsername: | ||
| </ | </ | ||
| - | Déplacez ensuite le binaire minikube dans le répertoire | + | Pour voir toutes les valeurs, il convient d' |
| < | < | ||
| - | desktop@serverXX:~$ sudo mv minikube /usr/local/bin/ | + | trainee@gateway:~$ helm get values wordpress --all --namespace dof309 | more |
| - | [sudo] password for desktop: | + | COMPUTED VALUES: |
| + | affinity: {} | ||
| + | allowEmptyPassword: | ||
| + | allowOverrideNone: | ||
| + | apacheConfiguration: | ||
| + | args: [] | ||
| + | automountServiceAccountToken: | ||
| + | autoscaling: | ||
| + | enabled: false | ||
| + | maxReplicas: | ||
| + | minReplicas: | ||
| + | targetCPU: 50 | ||
| + | targetMemory: | ||
| + | clusterDomain: | ||
| + | command: | ||
| + | common: | ||
| + | exampleValue: | ||
| + | global: | ||
| + | compatibility: | ||
| + | openshift: | ||
| + | adaptSecurityContext: | ||
| + | defaultStorageClass: | ||
| + | imagePullSecrets: | ||
| + | imageRegistry: | ||
| + | security: | ||
| + | allowInsecureImages: | ||
| + | commonAnnotations: | ||
| + | commonLabels: | ||
| + | containerPorts: | ||
| + | http: 8080 | ||
| + | https: 8443 | ||
| + | containerSecurityContext: | ||
| + | allowPrivilegeEscalation: | ||
| + | capabilities: | ||
| + | drop: | ||
| + | - ALL | ||
| + | enabled: true | ||
| + | privileged: false | ||
| + | readOnlyRootFilesystem: | ||
| + | runAsGroup: 1001 | ||
| + | runAsNonRoot: | ||
| + | runAsUser: 1001 | ||
| + | seLinuxOptions: | ||
| + | seccompProfile: | ||
| + | type: RuntimeDefault | ||
| + | customHTAccessCM: | ||
| + | customLivenessProbe: | ||
| + | customPostInitScripts: | ||
| + | customReadinessProbe: | ||
| + | customStartupProbe: | ||
| + | diagnosticMode: | ||
| + | args: | ||
| + | - infinity | ||
| + | command: | ||
| + | - sleep | ||
| + | enabled: false | ||
| + | existingApacheConfigurationConfigMap: | ||
| + | existingSecret: | ||
| + | --More-- | ||
| </ | </ | ||
| - | Testez ensuite l' | + | Dernièrement pour visualiser toutes les informations, |
| < | < | ||
| - | desktop@serverXX:~$ minikube version | + | trainee@gateway:~$ helm get all wordpress --namespace dof309 | more |
| - | minikube version: v1.14.2 | + | NAME: wordpress |
| - | commit: 2c82918e2347188e21c4e44c8056fc80408bce10 | + | LAST DEPLOYED: Fri Dec 20 15:14:17 2024 |
| + | NAMESPACE: dof309 | ||
| + | STATUS: deployed | ||
| + | REVISION: 1 | ||
| + | CHART: wordpress | ||
| + | VERSION: 24.1.5 | ||
| + | APP_VERSION: 6.7.1 | ||
| + | TEST SUITE: None | ||
| + | USER-SUPPLIED VALUES: | ||
| + | service: | ||
| + | type: NodePort | ||
| + | wordpressBlogName: | ||
| + | wordpressEmail: | ||
| + | wordpressFirstName: | ||
| + | wordpressLastName: | ||
| + | wordpressPassword: | ||
| + | wordpressUsername: | ||
| + | |||
| + | COMPUTED VALUES: | ||
| + | affinity: {} | ||
| + | allowEmptyPassword: | ||
| + | allowOverrideNone: | ||
| + | apacheConfiguration: | ||
| + | args: [] | ||
| + | automountServiceAccountToken: | ||
| + | autoscaling: | ||
| + | enabled: false | ||
| + | maxReplicas: | ||
| + | minReplicas: | ||
| + | targetCPU: 50 | ||
| + | targetMemory: | ||
| + | clusterDomain: | ||
| + | command: [] | ||
| + | common: | ||
| + | exampleValue: | ||
| + | global: | ||
| + | compatibility: | ||
| + | openshift: | ||
| + | adaptSecurityContext: | ||
| + | defaultStorageClass: | ||
| + | imagePullSecrets: | ||
| + | imageRegistry: | ||
| + | security: | ||
| + | allowInsecureImages: | ||
| + | commonAnnotations: | ||
| + | commonLabels: | ||
| + | containerPorts: | ||
| + | http: 8080 | ||
| + | https: 8443 | ||
| + | containerSecurityContext: | ||
| + | allowPrivilegeEscalation: | ||
| + | capabilities: | ||
| + | drop: | ||
| + | - ALL | ||
| + | enabled: true | ||
| + | privileged: false | ||
| + | readOnlyRootFilesystem: | ||
| + | --More-- | ||
| </ | </ | ||
| - | ====2.3 - Configuration de Minikube==== | + | ====1.9 - Utilisation des NOTES==== |
| - | Configurez maintenant l' | + | Vérifiez le nombre |
| < | < | ||
| - | desktop@serverXX:~$ minikube config set vm-driver virtualbox | + | trainee@gateway:~$ kubectl get pods -n dof309 |
| - | ❗ These changes will take effect upon a minikube delete and then a minikube start | + | NAME |
| - | </ | + | wordpress-75b57d8d9b-9t4jw |
| + | wordpress-mariadb-0 | ||
| + | </ | ||
| - | Vérifiez | + | Pour se connecter à WordPress, il convient de suivre les instructions de la section **NOTES** imprimée à l' |
| < | < | ||
| - | desktop@serverXX:~$ minikube config | + | trainee@gateway:~$ export NODE_PORT=$(kubectl |
| - | virtualbox | + | |
| - | </ | + | trainee@gateway: |
| - | Par défaut, lors de démarrage de Minikube, celui-ci va allouer 2 vCPUs et 2Go de RAM à sa machine virtuelle. Augmentez la quantité de mémoire qui sera allouée avec la commande suivante | + | trainee@gateway: |
| + | WordPress URL: http:// | ||
| - | < | + | trainee@gateway:~$ echo " |
| - | desktop@serverXX:~$ minikube config set memory 4000 | + | WordPress Admin URL: http:// |
| - | ❗ These changes will take effect upon a minikube delete and then a minikube start | + | |
| </ | </ | ||
| - | Vérifiez la prise en charge | + | Si vous oubliez le mot de passe de l' |
| < | < | ||
| - | desktop@serverXX:~$ minikube config | + | trainee@gateway:~$ echo Password: $(kubectl |
| - | 4000 | + | Password: my-pass |
| </ | </ | ||
| - | ====2.4 - Installation de kubectl==== | + | ====1.10 - La Commande helm upgrade==== |
| - | Démarrez maintenant Minikube | + | La mise-à-jour d'un Chart se fait en modifiant les valeurs dans le fichier YAML. Dans notre cas, le fichier s' |
| < | < | ||
| - | desktop@serverXX:~$ minikube start | + | trainee@gateway:~$ vi wordpress-values.yaml |
| - | 😄 minikube v1.14.2 on Ubuntu 16.04 | + | trainee@gateway: |
| - | ✨ Using the virtualbox driver based on user configuration | + | wordpressUsername: |
| - | 💿 Downloading VM boot image ... | + | wordpressPassword: |
| - | > minikube-v1.14.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s | + | wordpressEmail: helm-user@i2tch.loc |
| - | > minikube-v1.14.0.iso: 178.27 MiB / 178.27 MiB [] 100.00% 9.08 MiB p/s 19s | + | wordpressFirstName: Helm |
| - | 👍 Starting control plane node minikube in cluster minikube | + | wordpressLastName: |
| - | 💾 Downloading Kubernetes v1.19.2 preload ... | + | wordpressBlogName: |
| - | > preloaded-images-k8s-v6-v1.19.2-docker-overlay2-amd64.tar.lz4: 486.33 MiB | + | service: |
| - | 🔥 Creating virtualbox VM (CPUs=2, Memory=4000MB, | + | |
| - | 🐳 Preparing Kubernetes v1.19.2 on Docker 19.03.12 ... | + | replicaCount: |
| - | 🔎 Verifying Kubernetes components... | + | resources: |
| - | 🌟 Enabled addons: default-storageclass, | + | |
| - | 💡 kubectl not found. If you need it, try: ' | + | |
| - | 🏄 Done! kubectl is now configured to use " | + | cpu: 100m |
| </ | </ | ||
| - | Notez l' | + | Utilisez maintenant |
| < | < | ||
| - | desktop@serverXX:~$ minikube kubectl -- get pods -A | + | trainee@gateway:~$ helm upgrade wordpress bitnami/wordpress |
| - | > kubectl.sha256: | + | Release " |
| - | > kubectl: 41.01 MiB / 41.01 MiB [---------------] 100.00% 11.43 MiB p/s 3s | + | NAME: wordpress |
| - | NAMESPACE | + | LAST DEPLOYED: Fri Dec 20 15:33:45 2024 |
| - | kube-system | + | NAMESPACE: dof309 |
| - | kube-system | + | STATUS: deployed |
| - | kube-system | + | REVISION: 2 |
| - | kube-system | + | TEST SUITE: None |
| - | kube-system | + | NOTES: |
| - | kube-system | + | CHART NAME: wordpress |
| - | kube-system | + | CHART VERSION: 24.1.5 |
| - | </ | + | APP VERSION: 6.7.1 |
| - | Consultez la liste des machines virtuelles en cours d' | + | Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, |
| - | < | + | ** Please be patient while the chart is being deployed ** |
| - | desktop@serverXX: | + | |
| - | " | + | |
| - | </ | + | |
| - | Arrêtez maintenant Minikube | + | Your WordPress site can be accessed through the following DNS name from within your cluster: |
| - | < | + | wordpress.dof309.svc.cluster.local (port 80) |
| - | desktop@serverXX: | + | |
| - | ✋ Stopping node " | + | |
| - | 🛑 1 nodes stopped. | + | |
| - | </ | + | |
| - | Notez que, bien qu' | + | To access your WordPress site from outside the cluster follow the steps below: |
| - | < | + | 1. Get the WordPress URL by running these commands: |
| - | desktop@serverXX:~$ VBoxManage list runningvms | + | |
| - | desktop@serverXX: | + | |
| - | " | + | export NODE_IP=$(kubectl get nodes --namespace dof309 |
| - | " | + | echo "WordPress URL: http:// |
| - | "Debian_9" | + | echo "WordPress Admin URL: http:// |
| - | " | + | |
| - | " | + | 2. Open a browser and access WordPress using the obtained URL. |
| - | "TargetA" | + | |
| - | "TargetB" | + | 3. Login with the following credentials below to see your blog: |
| - | "Web01" | + | |
| - | " | + | echo Username: helm-user |
| - | " | + | echo Password: $(kubectl get secret |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | "CentOS_7 1" {5d0ce034-b759-4ccf-a449-28aea94a7d93} | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| </ | </ | ||
| - | Pour détruire | + | Vérifiez maintenant |
| < | < | ||
| - | desktop@serverXX:~$ minikube delete | + | trainee@gateway:~$ kubectl get pods -n dof309 |
| - | 🔥 Deleting " | + | NAME |
| - | 💀 Removed all traces of the " | + | wordpress-75b57d8d9b-9t4jw |
| + | wordpress-75b57d8d9b-jtx58 | ||
| + | wordpress-779bd5776b-9jz8v | ||
| + | wordpress-mariadb-0 | ||
| </ | </ | ||
| - | Démarrez | + | Visualisez les valeurs qui ont été utilisées lors de la mise-à-jour |
| < | < | ||
| - | desktop@serverXX:~$ minikube start | + | trainee@gateway:~$ helm get values wordpress -n dof309 |
| - | 😄 minikube v1.14.2 on Ubuntu 16.04 | + | USER-SUPPLIED VALUES: |
| - | ✨ Using the virtualbox driver based on user configuration | + | replicaCount: |
| - | 👍 Starting control plane node minikube in cluster minikube | + | resources: |
| - | 🔥 Creating virtualbox VM (CPUs=2, Memory=4000MB, | + | |
| - | 🐳 Preparing Kubernetes v1.19.2 on Docker 19.03.12 ... | + | cpu: 100m |
| - | 🔎 Verifying Kubernetes components... | + | |
| - | 🌟 Enabled addons: storage-provisioner, | + | service: |
| - | 💡 kubectl not found. If you need it, try: ' | + | |
| - | 🏄 Done! kubectl is now configured to use " | + | wordpressBlogName: Learn Helm! |
| - | desktop@serverXX:~$ minikube kubectl | + | wordpressEmail: helm-user@i2tch.loc |
| - | NAMESPACE | + | wordpressFirstName: |
| - | kube-system | + | wordpressLastName: |
| - | kube-system | + | wordpressPassword: |
| - | kube-system | + | wordpressUsername: |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| </ | </ | ||
| - | Contrôlez | + | Exécutez de nouveau la mise-à-jour, |
| < | < | ||
| - | desktop@serverXX:~$ minikube kubectl version | + | trainee@gateway:~$ helm upgrade wordpress bitnami/ |
| - | Client Version: | + | Release |
| - | Server Version: version.Info{Major:" | + | NAME: wordpress |
| - | </ | + | LAST DEPLOYED: Fri Dec 20 15:44:46 2024 |
| + | NAMESPACE: dof309 | ||
| + | STATUS: deployed | ||
| + | REVISION: 3 | ||
| + | TEST SUITE: None | ||
| + | NOTES: | ||
| + | CHART NAME: wordpress | ||
| + | CHART VERSION: 24.1.5 | ||
| + | APP VERSION: 6.7.1 | ||
| - | <WRAP center round important 60%> | + | Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, |
| - | **Important** : La sortie de cette commande indique une version 1.19.2 de Kubernetes. Par conséquence, nous avons besoin d'une version 3.4.x de Helm. | + | |
| - | </WRAP> | + | |
| - | La version de kubectl installée par minikube se trouve dans le répertoire | + | ** Please be patient while the chart is being deployed |
| - | < | + | Your WordPress site can be accessed through the following DNS name from within your cluster: |
| - | desktop@serverXX: | + | |
| - | -rwxr-xr-x 1 desktop desktop 43003904 Nov 13 15:53 / | + | wordpress.dof309.svc.cluster.local (port 80) |
| - | </ | + | |
| + | To access your WordPress site from outside the cluster follow the steps below: | ||
| - | Pour une utilisation plus facile, copiez la commande vers le répertoire **/ | + | 1. Get the WordPress URL by running these commands: |
| - | < | + | |
| - | desktop@serverXX: | + | export NODE_IP=$(kubectl get nodes --namespace dof309 -o jsonpath=" |
| - | [sudo] password for desktop: | + | echo " |
| + | echo " | ||
| + | |||
| + | 2. Open a browser and access WordPress using the obtained URL. | ||
| + | |||
| + | 3. Login with the following credentials below to see your blog: | ||
| + | |||
| + | echo Username: helm-user | ||
| + | echo Password: $(kubectl get secret --namespace dof309 wordpress -o jsonpath=" | ||
| </ | </ | ||
| - | Vérifiez ensuite que la commande est disponible | + | Visualisez les valeurs qui ont été utilisées lors de la mise-à-jour |
| < | < | ||
| - | desktop@serverXX:~$ which kubectl | + | trainee@gateway:~$ helm get values wordpress -n dof309 |
| - | / | + | USER-SUPPLIED VALUES: |
| + | replicaCount: | ||
| + | resources: | ||
| + | requests: | ||
| + | cpu: 100m | ||
| + | memory: 256Mi | ||
| + | service: | ||
| + | type: NodePort | ||
| + | wordpressBlogName: | ||
| + | wordpressEmail: | ||
| + | wordpressFirstName: | ||
| + | wordpressLastName: | ||
| + | wordpressPassword: | ||
| + | wordpressUsername: | ||
| </ | </ | ||
| - | ====2.5 | + | <WRAP center round important 60%> |
| + | **Important** : Notez que la commande helm a réutilisé les valeurs de la première mise-à-jour. | ||
| + | </ | ||
| - | Vérifiez maintenant | + | Vérifiez maintenant |
| < | < | ||
| - | desktop@serverXX:~$ minikube update-check | + | trainee@gateway:~$ kubectl get pods -n dof309 |
| - | CurrentVersion: | + | NAME |
| - | LatestVersion: | + | wordpress-5f88d486d7-6hnbp |
| + | wordpress-mariadb-0 | ||
| </ | </ | ||
| - | Pour mettre | + | ====1.11 - La Commande helm history==== |
| + | |||
| + | Helm utilise un système de **révisions**. Une nouvelle révision est créée | ||
| < | < | ||
| - | desktop@serverXX:~$ minikube stop | + | trainee@gateway:~$ helm history wordpress -n dof309 |
| - | ✋ Stopping node " | + | REVISION |
| - | 🛑 | + | 1 Fri Dec 20 15:14:17 2024 superseded |
| - | desktop@serverXX:~$ minikube delete | + | 2 Fri Dec 20 15:33:45 2024 superseded |
| - | 🔥 Deleting " | + | 3 Fri Dec 20 15:44:46 2024 superseded |
| - | 💀 Removed all traces of the " | + | 4 Fri Dec 20 15:57:01 2024 deployed |
| </ | </ | ||
| - | La configuration de minikube est stockée dans le répertoire | + | La commande |
| < | < | ||
| - | desktop@serverXX:~$ ls -l .minikube/ | + | trainee@gateway:~$ helm get values wordpress |
| - | total 64 | + | USER-SUPPLIED VALUES: |
| - | drwxrwxr-x 2 desktop desktop 4096 Nov 13 15:23 addons | + | replicaCount: 2 |
| - | drwxrwxr-x 5 desktop desktop 4096 Nov 13 15:53 cache | + | resources: |
| - | -rw-r--r-- 1 desktop desktop 1111 Nov 13 15:35 ca.crt | + | |
| - | -rw------- 1 desktop desktop 1675 Nov 13 15:35 ca.key | + | cpu: 100m |
| - | -rwxrwxr-x 1 desktop desktop 1078 Nov 25 11:37 ca.pem | + | |
| - | -rwxrwxr-x 1 desktop desktop 1123 Nov 25 11:37 cert.pem | + | service: |
| - | drwxrwxr-x 2 desktop desktop 4096 Nov 13 15:34 certs | + | type: NodePort |
| - | drwxrwxr-x 2 desktop desktop 4096 Nov 13 15:26 config | + | wordpressBlogName: Learn Helm! |
| - | drwxrwxr-x 2 desktop desktop 4096 Nov 13 15:23 files | + | wordpressEmail: |
| - | -rwxrwxr-x 1 desktop desktop 1679 Nov 25 11:37 key.pem | + | wordpressFirstName: Helm |
| - | -rw-r--r-- 1 desktop desktop | + | wordpressLastName: User |
| - | drwxrwxr-x 2 desktop desktop 4096 Nov 13 15:23 logs | + | wordpressPassword: |
| - | drwxrwxr-x 2 desktop desktop 4096 Nov 28 17:34 machines | + | wordpressUsername: helm-user |
| - | drwxrwxr-x 2 desktop desktop 4096 Nov 28 17:34 profiles | + | |
| - | -rw-r--r-- 1 desktop desktop 1119 Nov 13 15:35 proxy-client-ca.crt | + | trainee@gateway:~$ helm get values wordpress |
| - | -rw------- | + | USER-SUPPLIED VALUES: |
| + | replicaCount: | ||
| </ | </ | ||
| - | Supprimez ce répertoire | + | La commande **helm get manifest** peut être utilisée pour consulter l' |
| < | < | ||
| - | desktop@serverXX:~$ rm -rf .minikube | + | trainee@gateway:~$ helm get manifest wordpress |
| + | --- | ||
| + | # Source: wordpress/ | ||
| + | kind: NetworkPolicy | ||
| + | apiVersion: networking.k8s.io/ | ||
| + | metadata: | ||
| + | name: wordpress-mariadb | ||
| + | namespace: " | ||
| + | labels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | helm.sh/ | ||
| + | app.kubernetes.io/ | ||
| + | spec: | ||
| + | podSelector: | ||
| + | matchLabels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | helm.sh/ | ||
| + | policyTypes: | ||
| + | - Ingress | ||
| + | - Egress | ||
| + | egress: | ||
| + | - {} | ||
| + | ingress: | ||
| + | - ports: | ||
| + | - port: 3306 | ||
| + | - port: 3306 | ||
| + | --- | ||
| + | # Source: wordpress/ | ||
| + | kind: NetworkPolicy | ||
| + | apiVersion: networking.k8s.io/ | ||
| + | metadata: | ||
| + | name: wordpress | ||
| + | namespace: " | ||
| + | labels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | helm.sh/ | ||
| + | spec: | ||
| + | podSelector: | ||
| + | matchLabels: | ||
| + | app.kubernetes.io/ | ||
| + | app.kubernetes.io/ | ||
| + | policyTypes: | ||
| + | - Ingress | ||
| + | - Egress | ||
| + | egress: | ||
| + | - {} | ||
| + | ingress: | ||
| + | - ports: | ||
| + | - port: 8080 | ||
| + | - port: 8443 | ||
| + | --More-- | ||
| </ | </ | ||
| - | Téléchargez | + | ====1.12 - La Commande helm rollback==== |
| + | |||
| + | Pour revenir à une révision précédente il convient d' | ||
| < | < | ||
| - | desktop@serverXX:~$ curl -LO https:// | + | trainee@gateway:~$ helm rollback wordpress 3 -n dof309 |
| - | % Total % Received % Xferd Average Speed | + | Rollback was a success! Happy Helming! |
| - | | + | |
| - | 100 53.5M 100 53.5M 0 | + | |
| - | desktop@serverXX: | + | |
| - | [sudo] password for desktop: | + | |
| </ | </ | ||
| - | Configurez minikube comme indique précédement | + | Il convient ensuite de vérifier que les valeurs actuelles sont bien celles de la révision ciblée |
| < | < | ||
| - | desktop@serverXX:~$ minikube config set vm-driver virtualbox | + | trainee@gateway:~$ helm get values wordpress |
| - | ❗ These changes will take effect upon a minikube delete and then a minikube start | + | USER-SUPPLIED VALUES: |
| - | desktop@serverXX:~$ minikube config set memory | + | replicaCount: |
| - | ❗ These changes will take effect upon a minikube delete and then a minikube start | + | resources: |
| + | | ||
| + | cpu: 100m | ||
| + | | ||
| + | service: | ||
| + | | ||
| + | wordpressBlogName: | ||
| + | wordpressEmail: | ||
| + | wordpressFirstName: | ||
| + | wordpressLastName: | ||
| + | wordpressPassword: | ||
| + | wordpressUsername: | ||
| </ | </ | ||
| - | Démarrez | + | Le Rollback est clairement indiqué dans la sortie |
| < | < | ||
| - | desktop@serverXX:~$ minikube start | + | trainee@gateway:~$ helm history wordpress -n dof309 |
| - | 😄 minikube v1.15.1 on Ubuntu 16.04 | + | REVISION |
| - | ✨ Using the virtualbox driver based on user configuration | + | 1 Fri Dec 20 15:14:17 2024 superseded |
| - | 💿 Downloading VM boot image ... | + | 2 Fri Dec 20 15:33:45 2024 superseded |
| - | > minikube-v1.15.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s | + | 3 Fri Dec 20 15:44:46 2024 superseded |
| - | > minikube-v1.15.0.iso: 181.00 MiB / 181.00 MiB [ 100.00% 10.49 MiB p/s 17s | + | 4 Fri Dec 20 15:57:01 2024 superseded |
| - | 👍 Starting control plane node minikube in cluster minikube | + | 5 Fri Dec 20 16:09:02 2024 deployed |
| - | 💾 Downloading Kubernetes v1.19.4 preload ... | + | |
| - | > preloaded-images-k8s-v6-v1.19.4-docker-overlay2-amd64.tar.lz4: 486.35 MiB | + | |
| - | 🔥 Creating virtualbox VM (CPUs=2, Memory=4000MB, | + | |
| - | 🐳 Preparing Kubernetes v1.19.4 on Docker 19.03.13 ... | + | |
| - | 🔎 Verifying Kubernetes components... | + | |
| - | 🌟 Enabled addons: default-storageclass, | + | |
| - | 🏄 Done! kubectl is now configured | + | |
| </ | </ | ||
| - | Vérifiez | + | ====1.13 - La Commande helm uninstall==== |
| + | |||
| + | La désinstallation d'un Chart se fait en utilisant | ||
| < | < | ||
| - | desktop@serverXX:~$ minikube version | + | trainee@gateway:~$ helm uninstall wordpress -n dof309 |
| - | minikube version: v1.15.1 | + | release " |
| - | commit: 23f40a012abb52eff365ff99a709501a61ac | + | |
| </ | </ | ||
| - | Téléchargez le binaire | + | La commande |
| < | < | ||
| - | desktop@serverXX:~$ minikube kubectl | + | trainee@gateway:~$ helm list -n dof309 |
| - | | + | NAME |
| - | > kubectl: 41.01 MiB / 41.01 MiB [----------------] 100.00% 8.45 MiB p/s 5s | + | |
| - | NAMESPACE | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| - | kube-system | + | |
| </ | </ | ||
| - | Contrôlez | + | ainsi qua la sortie |
| < | < | ||
| - | desktop@serverXX:~$ minikube | + | trainee@gateway:~$ kubectl |
| - | Client Version: version.Info{Major:" | + | No resources found in dof309 namespace. |
| - | Server Version: version.Info{Major:" | + | |
| </ | </ | ||
| - | <WRAP center round important 60%> | + | Par contre la commande |
| - | **Important** : La sortie de cette commande indique une version 1.19.4 de Kubernetes. | + | |
| - | </ | + | |
| - | + | ||
| - | La version de kubectl installée par minikube se trouve dans le répertoire | + | |
| < | < | ||
| - | desktop@serverXX:~$ ls -l / | + | trainee@gateway:~$ kubectl |
| - | -rwxr-xr-x 1 desktop desktop 43003904 Nov 28 17:56 / | + | NAME |
| + | data-wordpress-mariadb-0 | ||
| </ | </ | ||
| - | Pour une utilisation plus facile, copiez | + | Pour supprimer le **PersistentVolumeClaim**, il est necéssaire d' |
| < | < | ||
| - | desktop@serverXX:~$ sudo rm -f / | + | trainee@gateway:~$ kubectl |
| - | [sudo] password for desktop: | + | persistentvolumeclaim " |
| - | desktop@serverXX: | + | |
| </ | </ | ||
| - | Vérifiez ensuite que la commande est disponible | + | Le **PersistentVolumeClaim** se trouve de cette manière supprimé |
| < | < | ||
| - | desktop@serverXX:~$ which kubectl | + | trainee@gateway:~$ kubectl |
| - | / | + | No resources found in dof309 namespace |
| </ | </ | ||
| - | ====2.6 - La Commande minikube dashboard==== | + | =====LAB #2 - Supervision de Kubernetes avec le Stack EFK===== |
| - | Minikube embarque l' | + | ====2.1 - Présentation du Stack EFK==== |
| - | {{ :elearning: | + | Le stack EFK est composé de trois éléments |
| - | Installez | + | * **[[https:// |
| + | * le stockage des métriques | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | * la visualisation des données stockées dans Elasticsearch. | ||
| - | {{ :elearning: | + | Avant de poursuivre, arrêtez minikube et augmentez la mémoire de sa machine virtuelle à 12 294 Mo et le nombre de vCPUs à 4 : |
| - | Vous verrez apparaître une boîte represantant votre nouvelle connexion à droite de l' | + | < |
| + | trainee@gateway:~$ minikube stop | ||
| + | ✋ Stopping node " | ||
| + | 🛑 1 node stopped. | ||
| - | {{ :elearning: | + | trainee@gateway:~$ minikube delete |
| + | 🔥 Deleting " | ||
| + | 💀 Removed all traces of the " | ||
| - | Cliquez sur cette boîte puis renseignez le mot de passe de votre serveur dans le cloud et cliquez sur le bouton **ok** | + | trainee@gateway:~$ minikube config set memory 12294 |
| + | ❗ These changes will take effect upon a minikube delete and then a minikube start | ||
| - | {{ :elearning: | + | trainee@gateway:~$ minikube config set cpus 4 |
| + | ❗ These changes will take effect upon a minikube delete and then a minikube start | ||
| - | A l'issu de quelques minutes vou aurez accès à votre serveur dans le cloud en mode graphique | + | trainee@gateway:~$ minikube start |
| + | 😄 minikube v1.26.0 on Debian 11.3 (kvm/ | ||
| + | ✨ Using the virtualbox driver based on user configuration | ||
| + | 👍 Starting control plane node minikube in cluster minikube | ||
| + | 🔥 Creating virtualbox VM (CPUs=4, Memory=12294MB, | ||
| + | 🐳 Preparing Kubernetes v1.24.1 on Docker 20.10.16 ... | ||
| + | ▪ Generating certificates and keys ... | ||
| + | ▪ Booting up control plane ... | ||
| + | ▪ Configuring RBAC rules ... | ||
| + | ╭───────────────────────────────────────────────────────────────────────────────────────────────────╮ | ||
| + | │ │ | ||
| + | │ You have selected " | ||
| + | │ For better performance and support consider using a different driver: | ||
| + | │ - kvm2 │ | ||
| + | │ - qemu2 │ | ||
| + | │ │ | ||
| + | │ To turn off this warning run: │ | ||
| + | │ │ | ||
| + | │ $ minikube config set WantVirtualBoxDriverWarning false │ | ||
| + | │ │ | ||
| + | │ │ | ||
| + | │ To learn more about on minikube drivers checkout https:// | ||
| + | │ To see benchmarks checkout https:// | ||
| + | │ │ | ||
| + | ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯ | ||
| + | 🔎 Verifying Kubernetes components... | ||
| + | ▪ Using image gcr.io/ | ||
| + | 🌟 Enabled addons: storage-provisioner, | ||
| + | 🏄 Done! kubectl is now configured to use " | ||
| + | </ | ||
| - | {{ : | + | ====2.2 - Installation du Chart elasticsearch==== |
| - | Ouvrez un terminal en mode graphique et exécutez la commande | + | Commencez par installer le **repository** stable de **https:// |
| < | < | ||
| - | desktop@serverXX:~$ minikube dashboard | + | trainee@gateway:~$ helm repo add stable https://charts.helm.sh/stable |
| - | * Verifying dashboard health ... | + | " |
| - | * Launching proxy ... | + | |
| - | * Verifying proxy health ... | + | |
| - | * Opening http://127.0.0.1:44979/api/ | + | |
| </ | </ | ||
| - | Le navigateur Firefox sera lancé vous donnant accès à Kubernetes Dashboard | + | Installez ensuite le Chart helm **elasticsearch** |
| - | {{ :elearning:workbooks:kubernetes:capture_d_ecran_du_2020-11-29_13-07-01.png? | + | < |
| + | trainee@gateway:~$ helm install elasticsearch stable/ | ||
| + | WARNING: This chart is deprecated | ||
| + | NAME: elasticsearch | ||
| + | LAST DEPLOYED: Sat Jul 16 11:27:22 2022 | ||
| + | NAMESPACE: default | ||
| + | STATUS: deployed | ||
| + | REVISION: 1 | ||
| + | NOTES: | ||
| + | This Helm chart is deprecated. Please use https:// | ||
| - | Revenez à la fenêtre de connexion en SSH à votre serveur. | + | --- |
| - | ====2.7 - La Commande minikube addons==== | + | The elasticsearch cluster has been installed. |
| - | Minikube utilise des modules. Ces modules sont appelés des **addons**. Pour consulter les addons installés ainsi que leurs statuts, utilisez la commande **minikube addons list** | + | Elasticsearch can be accessed: |
| + | * Within your cluster, at the following DNS name at port 9200: | ||
| - | < | + | |
| - | desktop@serverXX: | + | |
| - | |-----------------------------|----------|--------------| | + | * From outside the cluster, run these commands in the same shell: |
| - | | ADDON NAME | PROFILE | + | |
| - | |-----------------------------|----------|--------------| | + | |
| - | | ambassador | + | echo "Visit http:// |
| - | | csi-hostpath-driver | + | |
| - | | dashboard | + | |
| - | | default-storageclass | + | |
| - | | efk | minikube | disabled | + | |
| - | | freshpod | + | |
| - | | gcp-auth | + | |
| - | | gvisor | + | |
| - | | helm-tiller | + | |
| - | | ingress | + | |
| - | | ingress-dns | minikube | disabled | + | |
| - | | istio | minikube | disabled | + | |
| - | | istio-provisioner | + | |
| - | | kubevirt | + | |
| - | | logviewer | + | |
| - | | metallb | + | |
| - | | metrics-server | + | |
| - | | nvidia-driver-installer | + | |
| - | | nvidia-gpu-device-plugin | + | |
| - | | olm | minikube | disabled | + | |
| - | | pod-security-policy | + | |
| - | | registry | + | |
| - | | registry-aliases | + | |
| - | | registry-creds | + | |
| - | | storage-provisioner | + | |
| - | | storage-provisioner-gluster | minikube | disabled | + | |
| - | | volumesnapshots | + | |
| - | |-----------------------------|----------|--------------| | + | |
| </ | </ | ||
| - | Pour activer le module | + | Patientez quelques minutes afin que tous les Pods affichent un état de **READY** : |
| < | < | ||
| - | desktop@serverXX:~$ minikube addons enable metrics-server | + | trainee@gateway:~$ kubectl get pods |
| - | 🌟 The ' | + | NAME READY |
| + | elasticsearch-client-7869bf97bb-tb25p | ||
| + | elasticsearch-client-7869bf97bb-zvl6h | ||
| + | elasticsearch-data-0 | ||
| + | elasticsearch-data-1 | ||
| + | elasticsearch-master-0 | ||
| + | elasticsearch-master-1 | ||
| + | elasticsearch-master-2 1/1 | ||
| </ | </ | ||
| - | Vérifiez | + | Vérifiez |
| < | < | ||
| - | desktop@serverXX:~$ minikube addons list | + | trainee@gateway:~$ kubectl get services |
| - | |-----------------------------|----------|--------------| | + | NAME |
| - | | | + | elasticsearch-client |
| - | |-----------------------------|----------|--------------| | + | elasticsearch-discovery |
| - | | ambassador | + | kubernetes |
| - | | csi-hostpath-driver | + | |
| - | | dashboard | + | |
| - | | default-storageclass | + | |
| - | | efk | minikube | disabled | + | |
| - | | freshpod | + | |
| - | | gcp-auth | minikube | disabled | + | |
| - | | gvisor | + | |
| - | | helm-tiller | + | |
| - | | ingress | + | |
| - | | ingress-dns | + | |
| - | | istio | minikube | disabled | + | |
| - | | istio-provisioner | + | |
| - | | kubevirt | + | |
| - | | logviewer | + | |
| - | | metallb | + | |
| - | | metrics-server | + | |
| - | | nvidia-driver-installer | + | |
| - | | nvidia-gpu-device-plugin | + | |
| - | | olm | minikube | disabled | + | |
| - | | pod-security-policy | + | |
| - | | registry | + | |
| - | | registry-aliases | + | |
| - | | registry-creds | + | |
| - | | storage-provisioner | + | |
| - | | storage-provisioner-gluster | minikube | disabled | + | |
| - | | volumesnapshots | + | |
| - | |-----------------------------|----------|--------------| | + | |
| </ | </ | ||
| - | =====LAB #3 - Création | + | ====2.3 - Installation |
| - | ====3.1 | + | Installez le Chart helm **fluentd-elasticsearch** à partir du repository **stable** : |
| - | kind est un outil utilisé pour exécuter un cluster Kubernetes localement en utilisant des conteneurs Docker en tant que nœuds. kind a été développé pour tester Kubernetes lui-même mais peut aussi être utilisé pour du développement local. | + | < |
| + | trainee@gateway: | ||
| + | WARNING: This chart is deprecated | ||
| + | W0716 12: | ||
| + | NAME: fluentd | ||
| + | LAST DEPLOYED: Sat Jul 16 12:20:07 2022 | ||
| + | NAMESPACE: default | ||
| + | STATUS: deployed | ||
| + | REVISION: 1 | ||
| + | TEST SUITE: None | ||
| + | NOTES: | ||
| + | 1. To verify that Fluentd has started, run: | ||
| - | Le site web de kind est **[[https:// | + | kubectl --namespace=default get pods -l "app.kubernetes.io/name=fluentd-elasticsearch, |
| - | ====3.2 - Installation de Docker-CE dans la VM Debian_10==== | + | THIS APPLICATION CAPTURES ALL CONSOLE OUTPUT AND FORWARDS IT TO elasticsearch |
| + | including things like IP addresses, container images, and object names will NOT be anonymized. | ||
| + | </ | ||
| - | Commencez par augmenter la RAM de la machine virtuelle Debian_10 | + | <WRAP center round important 60%> |
| + | **Important** : Fluentd a besoin | ||
| + | </ | ||
| + | |||
| + | Patientez quelques secondes afin que le Pod **fluentd-fluentd-elasticsearch-xxxxx** affiche un état de **READY** | ||
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage modifyvm Debian_10 | + | trainee@gateway:~$ kubectl get pods |
| + | NAME READY | ||
| + | elasticsearch-client-7869bf97bb-tb25p | ||
| + | elasticsearch-client-7869bf97bb-zvl6h | ||
| + | elasticsearch-data-0 | ||
| + | elasticsearch-data-1 | ||
| + | elasticsearch-master-0 | ||
| + | elasticsearch-master-1 | ||
| + | elasticsearch-master-2 | ||
| + | fluentd-fluentd-elasticsearch-znvq5 | ||
| </ | </ | ||
| - | Configurez ensuite la redirection | + | <WRAP center round important 60%> |
| + | **Important** : Notez que dans le cas de l' | ||
| + | </ | ||
| - | < | + | ====2.4 |
| - | desktop@serverXX: | + | |
| - | </ | + | |
| - | Démarrez | + | Kibana a aussi besoin de connaître l' |
| < | < | ||
| - | desktop@serverXX:~$ VBoxManage startvm Debian_10 | + | trainee@gateway:~$ vi kibana-values.yaml |
| - | Waiting for VM " | + | trainee@gateway: |
| - | VM "Debian_10" | + | files: |
| + | kibana.yml: | ||
| + | ## Default Kibana configuration from kibana-docker. | ||
| + | server.name: kibana | ||
| + | | ||
| + | ## For kibana < 6.6, use elasticsearch.url instead | ||
| + | elasticsearch.hosts: | ||
| + | service: | ||
| + | type: NodePort | ||
| </ | </ | ||
| - | Patientez 2 minutes puis connectez-vous à la machine virtuelle | + | <WRAP center round important 60%> |
| + | **Important** : Notez la création d'un service de type **NodePort**. Dans le cas de l' | ||
| + | </ | ||
| + | |||
| + | Installez donc le Chart Helm kibana à partir du repository **stable** en référençant le fichier **values** **kibana-values.yaml** | ||
| < | < | ||
| - | desktop@serverXX:~$ ssh -l trainee localhost | + | trainee@gateway:~$ helm install kibana stable/ |
| - | trainee@localhost' | + | WARNING: This chart is deprecated |
| - | Linux debian10 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 | + | NAME: kibana |
| + | LAST DEPLOYED: Sat Jul 16 12:22:57 2022 | ||
| + | NAMESPACE: default | ||
| + | STATUS: deployed | ||
| + | REVISION: | ||
| + | NOTES: | ||
| + | THE CHART HAS BEEN DEPRECATED! | ||
| - | The programs included with the Debian GNU/Linux system are free software; | + | Find the new official version @ https://github.com/elastic/helm-charts/tree/master/ |
| - | the exact distribution terms for each program are described in the | + | |
| - | individual files in /usr/share/doc/*/copyright. | + | |
| - | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | + | To verify that kibana has started, run: |
| - | permitted by applicable law. | + | |
| - | Last login: Mon Nov 30 15:50:01 2020 from 10.0.2.2 | + | |
| - | </ | + | |
| - | Installez ensuite Docker-CE : | + | kubectl |
| - | < | + | Kibana can be accessed: |
| - | trainee@debian10:~$ su - | + | |
| - | Password: fenestros | + | |
| - | root@debian10: | + | |
| - | root@debian10: | + | * From outside the cluster, run these commands in the same shell: |
| - | ... | + | |
| - | root@debian10: | + | |
| - | ... | + | |
| - | root@debian10: | + | |
| - | ... | + | |
| - | root@debian10: | + | |
| - | ... | + | |
| - | root@debian10: | + | |
| - | root@debian10: | + | |
| - | { | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | " | + | |
| - | }, | + | |
| - | " | + | |
| - | } | + | |
| - | root@debian10: | + | |
| - | root@debian10: | + | |
| - | root@debian10: | + | |
| - | root@debian10: | + | |
| - | Client: Docker Engine - Community | + | |
| - | | + | |
| - | API version: | + | |
| - | Go version: | + | |
| - | Git commit: | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | Server: Docker Engine | + | export NODE_PORT=$(kubectl get --namespace default -o jsonpath=" |
| - | | + | |
| - | Version: | + | echo http://$NODE_IP:$NODE_PORT |
| - | API version: | + | |
| - | Go version: | + | |
| - | Git commit: | + | |
| - | Built: | + | |
| - | OS/ | + | |
| - | Experimental: | + | |
| - | | + | |
| - | Version: | + | |
| - | GitCommit: | + | |
| - | | + | |
| - | Version: | + | |
| - | | + | |
| - | | + | |
| - | Version: | + | |
| - | GitCommit: | + | |
| </ | </ | ||
| - | ====3.3 - Installation | + | Notez les instructions à la fin de la sortie précédente qui indiquent comment atteindre Kibana de l' |
| - | + | ||
| - | Ajoutez | + | |
| < | < | ||
| - | root@debian10:~# curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | + | trainee@gateway:~$ export NODE_PORT=$(kubectl get --namespace default -o jsonpath=" |
| - | OK | + | trainee@gateway:~$ export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath=" |
| + | trainee@gateway: | ||
| + | http://192.168.59.101: | ||
| </ | </ | ||
| - | Ajoutez | + | Patientez quelques minutes afin que le Pod **kibana-yyyyyyyyy-xxxxx** affiche un état de **READY** |
| < | < | ||
| - | root@debian10:~# echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list | + | trainee@gateway:~$ kubectl get pods |
| - | deb https://apt.kubernetes.io/ | + | NAME READY |
| + | elasticsearch-client-7869bf97bb-tb25p | ||
| + | elasticsearch-client-7869bf97bb-zvl6h | ||
| + | elasticsearch-data-0 | ||
| + | elasticsearch-data-1 1/1 | ||
| + | elasticsearch-master-0 | ||
| + | elasticsearch-master-1 | ||
| + | elasticsearch-master-2 | ||
| + | fluentd-fluentd-elasticsearch-znvq5 | ||
| + | kibana-74cd958bd4-qxmtc | ||
| </ | </ | ||
| - | Procédez à l' | + | Vérifiez ensuite la présence du service **NodePort** |
| < | < | ||
| - | root@debian10:~# apt-get update && apt-get install | + | trainee@gateway:~$ kubectl |
| + | NAME TYPE CLUSTER-IP | ||
| + | elasticsearch-client | ||
| + | elasticsearch-discovery | ||
| + | kibana | ||
| + | kubernetes | ||
| </ | </ | ||
| - | Bloquez les mises-à-jour | + | ====2.5 |
| + | |||
| + | Créez maintenant un fichier **counter.yaml** afin de créer un Pod qui générera des logs de démonstration en continu | ||
| < | < | ||
| - | root@debian10:~# apt-mark hold kubelet kubeadm kubectl | + | trainee@gateway:~$ vi counter.yaml |
| - | kubelet set on hold. | + | trainee@gateway: |
| - | kubeadm set on hold. | + | ## counter.yaml |
| - | kubectl set on hold. | + | apiVersion: v1 |
| + | kind: Pod | ||
| + | metadata: | ||
| + | name: counter | ||
| + | spec: | ||
| + | containers: | ||
| + | - name: count | ||
| + | image: busybox | ||
| + | args: [/bin/sh, -c, 'i=0; while true; do echo "Demo log $i: $(date)"; | ||
| </ | </ | ||
| - | ====3.4 - Installation de kind et Démarrage du Cluster==== | + | Appliquez ce fichier avec la commande |
| - | + | ||
| - | Installez | + | |
| < | < | ||
| - | root@debian10:~# curl -Lo ./kind https:// | + | trainee@gateway:~$ kubectl apply -f counter.yaml |
| - | % Total % Received % Xferd Average Speed | + | pod/counter created |
| - | | + | |
| - | 100 97 100 97 0 | + | |
| - | 100 | + | |
| - | 100 7247k 100 7247k 0 | + | |
| - | root@debian10: | + | |
| - | root@debian10: | + | |
| - | root@debian10: | + | |
| - | / | + | |
| </ | </ | ||
| - | Re-démarrez la machine virtuelle | + | Vérifiez que le Pod **counter** soit bien en état de **READY** |
| < | < | ||
| - | root@debian10:~# shutdown | + | trainee@gateway:~$ kubectl get pods |
| + | NAME READY | ||
| + | counter | ||
| + | elasticsearch-client-7869bf97bb-tb25p | ||
| + | elasticsearch-client-7869bf97bb-zvl6h | ||
| + | elasticsearch-data-0 | ||
| + | elasticsearch-data-1 | ||
| + | elasticsearch-master-0 | ||
| + | elasticsearch-master-1 | ||
| + | elasticsearch-master-2 | ||
| + | fluentd-fluentd-elasticsearch-znvq5 | ||
| + | kibana-74cd958bd4-qxmtc | ||
| </ | </ | ||
| - | Connectez-vous à la machine virtuelle Debian_10 : | + | ====2.6 |
| - | < | + | Connectez-vous à votre VM Gateway en mode VNC en utilisant Apache Guacamole ou via une connexion RDP. |
| - | desktop@serverXX: | + | |
| - | trainee@localhost' | + | |
| - | Linux debian10 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 | + | |
| - | The programs included with the Debian GNU/Linux system are free software; | + | Ouvrez le navigateur FireFox et saisissez l' |
| - | the exact distribution terms for each program are described in the | + | |
| - | individual files in / | + | |
| - | Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | + | {{ :elearning:workbooks:kubernetes: |
| - | permitted by applicable law. | + | |
| - | Last login: Mon Nov 30 13:47:09 2020 from 10.0.2.2 | + | |
| - | </ | + | |
| - | Devenez | + | Cliquez sur **Explore on my own** > **Management** > **Index Patterns**, ensuite, dans **Create index pattern**, renseignez la valeur **logstash-*** et cliquez sur le bouton |
| - | < | + | {{ :elearning:workbooks:kubernetes:kibana02.png? |
| - | trainee@debian10:~$ su - | + | |
| - | Password: fenestros | + | |
| - | root@debian10:~# vi config.yaml | + | |
| - | root@debian10:~# cat config.yaml | + | |
| - | kind: Cluster | + | |
| - | apiVersion: kind.x-k8s.io/ | + | |
| - | kubeadmConfigPatches: | + | |
| - | - | | + | |
| - | apiVersion: kubelet.config.k8s.io/ | + | |
| - | kind: KubeletConfiguration | + | |
| - | evictionHard: | + | |
| - | nodefs.available: | + | |
| - | kubeadmConfigPatchesJSON6902: | + | |
| - | - group: kubeadm.k8s.io | + | |
| - | version: v1beta2 | + | |
| - | kind: ClusterConfiguration | + | |
| - | patch: | | + | |
| - | - op: add | + | |
| - | path: / | + | |
| - | value: my-hostname | + | |
| - | nodes: | + | |
| - | - role: control-plane | + | |
| - | - role: worker | + | |
| - | - role: worker | + | |
| - | - role: worker | + | |
| - | </ | + | |
| - | Créez un cluster avec **kind** : | + | Dans l' |
| - | < | + | {{ :elearning:workbooks: |
| - | root@debian10:~# kind create cluster --config config.yaml | + | |
| - | Creating cluster " | + | |
| - | ✓ Ensuring node image (kindest/ | + | |
| - | ✓ Preparing nodes 📦 📦 📦 📦 | + | |
| - | ✓ Writing configuration 📜 | + | |
| - | ✓ Starting control-plane 🕹️ | + | |
| - | ✓ Installing CNI 🔌 | + | |
| - | ✓ Installing StorageClass 💾 | + | |
| - | ✓ Joining worker nodes 🚜 | + | |
| - | Set kubectl context to " | + | |
| - | You can now use your cluster with: | + | |
| - | kubectl cluster-info --context kind-kind | + | Cliquez sur le lien **Discover** dans le menu de Kibana. Sélectionnez **logstash-*** puis choisissez **@timestamp** dans **Available fields** et cliquez sur le bouton **Add** : |
| - | Not sure what to do next? 😅 Check out https://kind.sigs.k8s.io/ | + | {{ :elearning: |
| - | </ | + | |
| + | Appliquez un filtre en cliquant sur le champ **kubernetes.pod_name** : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Cliquez sur la loupe **+** en face de la ligne **counter** puis sur le bouton **Add** en face du nom du champs : | ||
| + | |||
| + | {{ : | ||
| ---- | ---- | ||
| - | < | + | Copyright © 2024 Hugh Norris |
| - | <DIV ALIGN=" | + | |
| - | Copyright © 2020 Hugh Norris. | + | |
| - | </ | + | |
| - | </ | + | |