Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:kubernetes:k8s02 [2022/07/13 12:54] adminelearning:workbooks:kubernetes:k8s02 [2024/12/15 06:47] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version - **2020.02**+Version - **2024.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
Ligne 14: Ligne 14:
       * 1.1 - Obtenir de l'Aide sur les Commandes de kubectl       * 1.1 - Obtenir de l'Aide sur les Commandes de kubectl
       * 1.2 - Obtenir de l'Information sur le Cluster       * 1.2 - Obtenir de l'Information sur le Cluster
-      * 1.3 - Obtenir de l'Information sur les Noeuds +        * La Commande version 
-    * LAB #2 - Géstion les plugins de kubectl avec la Commande krew+        * La Commande cluster-info 
 +        * La Commande api-versions 
 +        * La Commande api-resources 
 +      * 1.3 - Obtenir de l'Information sur les Nœuds 
 +        * La Commande describe node 
 +        * La Commande top 
 +      * 1.4 - Obtenir de l'Information sur les Pods 
 +        * La Commande describe pod 
 +        * La Commande top 
 +      * 1.5 - Travailler avec la commande kubectl 
 +        * La Commande apply 
 +        * La Commande create 
 +        * La Commande get 
 +        * Utilisation des Options 
 +        * La Commande exec 
 +        * Commandes Impératives 
 +    * LAB #2 - Gestion les plugins de kubectl avec la Commande krew
       * 2.1 - Installation de krew       * 2.1 - Installation de krew
       * 2.2 - Consultation de la liste des plugins       * 2.2 - Consultation de la liste des plugins
       * 2.3 - Installation et utilisation de plugins       * 2.3 - Installation et utilisation de plugins
       * 2.4 - Mise à jour et suppression de plugins       * 2.4 - Mise à jour et suppression de plugins
-    * LAB #3 - Géstion des patchs avec la Commande kustomize+    * LAB #3 - Gestion des patchs avec la Commande kustomize 
 + 
 +=====Ressources===== 
 + 
 +====Lab #1===== 
 + 
 +  * https://www.dropbox.com/scl/fi/a5ki48szu8q5159177opv/components.yaml?rlkey=354a4ybivgbmu97gyoduadm61&dl=0 
 +  * https://www.dropbox.com/scl/fi/weivllvybgtxtf2psq1ko/pod.yaml?rlkey=x1spvh9v0hy8p8m86rv8oqd60&dl=0 
 + 
 +====Lab #2==== 
 + 
 +  * https://www.dropbox.com/scl/fi/qhpr75m74mrho0c2k7ky9/krew-linux_amd64.tar.gz?rlkey=bigm37fy2c3rzqgziszq71tb8&dl=0 
 + 
 +====Lab #3==== 
 + 
 +  * https://www.dropbox.com/scl/fi/0af2lqns1q26u63lotu7x/deployment.yaml?rlkey=ese25kacg2ibagpio9bky3cv9&dl=0 
 +  * https://www.dropbox.com/scl/fi/qnr0m18sa3lwjbsk1qrj5/service.yaml?rlkey=sd5t8a4bh1trawum5vpy2bzww&dl=0 
 +  * https://www.dropbox.com/scl/fi/5pz0wg63yd68w018248nc/kustomization.yaml?rlkey=liff7kt68fsicgjfyvxaozadi&dl=0 
 +  * https://www.dropbox.com/scl/fi/2j60pti1wmd60kuv6kvc2/dev_kustomization.yaml?rlkey=iz6488nj8rrwg2b3y83suwch2&dl=0 
 +  * https://www.dropbox.com/scl/fi/bbdxrx0vxdx4y67uxehlv/prod_kustomization.yaml?rlkey=c723auhoeuzlut1p6qx96ktse&dl=0
  
 =====LAB #1 - Utilisation de la Commande kubectl===== =====LAB #1 - Utilisation de la Commande kubectl=====
Ligne 32: Ligne 67:
 kubectl controls the Kubernetes cluster manager. kubectl controls the Kubernetes cluster manager.
  
- Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/+ Find more information at: https://kubernetes.io/docs/reference/kubectl/
  
 Basic Commands (Beginner): Basic Commands (Beginner):
Ligne 82: Ligne 117:
   label           Update the labels on a resource   label           Update the labels on a resource
   annotate        Mettre à jour les annotations d'une ressource   annotate        Mettre à jour les annotations d'une ressource
-  completion      Output shell completion code for the specified shell (bash, zsh or fish)+  completion      Output shell completion code for the specified shell (bash, zshfish, or powershell)
  
 Other Commands: Other Commands:
Ligne 213: Ligne 248:
  
     --alsologtostderr=false:     --alsologtostderr=false:
-        log to standard error as well as files (DEPRECATED: will be removed in a future release, see+        log to standard error as well as files (no effect when -logtostderr=true) (DEPRECATED: will be removed in a 
 +        future release, see
         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  
Ligne 255: Ligne 291:
  
     --log-dir='':     --log-dir='':
-        If non-empty, write log files in this directory (DEPRECATED: will be removed in a future release, see+        If non-empty, write log files in this directory (no effect when -logtostderr=true) (DEPRECATED: will be 
 +        removed in a future release, see
         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  
     --log-file='':     --log-file='':
-        If non-empty, use this log file (DEPRECATED: will be removed in a future release, see+        If non-empty, use this log file (no effect when -logtostderr=true) (DEPRECATED: will be removed in a future 
 +        release, see
         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  
     --log-file-max-size=1800:     --log-file-max-size=1800:
-        Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size +        Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the 
-        is unlimited. (DEPRECATED: will be removed in a future release, see+        value is 0, the maximum file size is unlimited. (DEPRECATED: will be removed in a future release, see
         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  
Ligne 281: Ligne 319:
  
     --one-output=false:     --one-output=false:
-        If true, only write logs to their native severity level (vs also writing to each lower severity level) +        If true, only write logs to their native severity level (vs also writing to each lower severity level; no 
-        (DEPRECATED: will be removed in a future release, see+        effect when -logtostderr=true) (DEPRECATED: will be removed in a future release, see
         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  
Ligne 306: Ligne 344:
  
     --skip-log-headers=false:     --skip-log-headers=false:
-        If true, avoid headers when opening log files (DEPRECATED: will be removed in a future release, see+        If true, avoid headers when opening log files (no effect when -logtostderr=true) (DEPRECATED: will be removed 
 +        in a future release, see
         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  
     --stderrthreshold=2:     --stderrthreshold=2:
-        logs at or above this threshold go to stderr (DEPRECATED: will be removed in a future release, see+        logs at or above this threshold go to stderr when writing to files and stderr (no effect when 
 +        -logtostderr=true or -alsologtostderr=false) (DEPRECATED: will be removed in a future release, see
         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)         https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
  
Ligne 345: Ligne 385:
 root@kubemaster:~# kubectl version --short root@kubemaster:~# kubectl version --short
 Flag --short has been deprecated, and will be removed in the future. The --short output will become the default. Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
-Client Version: v1.24.2 +Client Version: v1.25.0 
-Kustomize Version: v4.5.4 +Kustomize Version: v4.5.7 
-Server Version: v1.24.2+Server Version: v1.25.0
 </code> </code>
  
Ligne 376: Ligne 416:
 autoscaling/v1 autoscaling/v1
 autoscaling/v2 autoscaling/v2
-autoscaling/v2beta1 
 autoscaling/v2beta2 autoscaling/v2beta2
 batch/v1 batch/v1
-batch/v1beta1 
 certificates.k8s.io/v1 certificates.k8s.io/v1
 coordination.k8s.io/v1 coordination.k8s.io/v1
 crd.projectcalico.org/v1 crd.projectcalico.org/v1
 discovery.k8s.io/v1 discovery.k8s.io/v1
-discovery.k8s.io/v1beta1 
 events.k8s.io/v1 events.k8s.io/v1
-events.k8s.io/v1beta1 
 flowcontrol.apiserver.k8s.io/v1beta1 flowcontrol.apiserver.k8s.io/v1beta1
 flowcontrol.apiserver.k8s.io/v1beta2 flowcontrol.apiserver.k8s.io/v1beta2
 networking.k8s.io/v1 networking.k8s.io/v1
 node.k8s.io/v1 node.k8s.io/v1
-node.k8s.io/v1beta1 
 policy/v1 policy/v1
-policy/v1beta1 
 rbac.authorization.k8s.io/v1 rbac.authorization.k8s.io/v1
 scheduling.k8s.io/v1 scheduling.k8s.io/v1
Ligne 476: Ligne 510:
 runtimeclasses                                 node.k8s.io/v1                         false        RuntimeClass runtimeclasses                                 node.k8s.io/v1                         false        RuntimeClass
 poddisruptionbudgets              pdb          policy/v1                              true         PodDisruptionBudget poddisruptionbudgets              pdb          policy/v1                              true         PodDisruptionBudget
-podsecuritypolicies               psp          policy/v1beta1                         false        PodSecurityPolicy 
 clusterrolebindings                            rbac.authorization.k8s.io/v1           false        ClusterRoleBinding clusterrolebindings                            rbac.authorization.k8s.io/v1           false        ClusterRoleBinding
 clusterroles                                   rbac.authorization.k8s.io/v1           false        ClusterRole clusterroles                                   rbac.authorization.k8s.io/v1           false        ClusterRole
Ligne 495: Ligne 528:
 De l'information sur le nœud peut être obtenue grâce à la commande **describe node**. Dans la première partie de la sortie de la commande on peut constater : De l'information sur le nœud peut être obtenue grâce à la commande **describe node**. Dans la première partie de la sortie de la commande on peut constater :
  
-  * la section **Labels:**. Les Labels peuvent être utilisés pour gérer l'affinité d'un pod, autrement dit sur quel nœud un pod peut être schedulé en fonction des étiquettes associées au pod, +  * la section **Labels:**. Les Labels peuvent être utilisés pour gérer l'affinité d'un pod, autrement dit sur quel nœud un pod peut être schedulé en fonction des étiquettes associées au pod,
   * la ligne **Unschedulable:      false** qui indique que le nœud accepte des pods.   * la ligne **Unschedulable:      false** qui indique que le nœud accepte des pods.
  
Ligne 514: Ligne 547:
                     projectcalico.org/IPv4IPIPTunnelAddr: 192.168.55.192                     projectcalico.org/IPv4IPIPTunnelAddr: 192.168.55.192
                     volumes.kubernetes.io/controller-managed-attach-detach: true                     volumes.kubernetes.io/controller-managed-attach-detach: true
-CreationTimestamp:  Tue12 Jul 2022 13:25:32 +0200+CreationTimestamp:  Sun04 Sep 2022 09:36:00 +0200
 Taints:             node-role.kubernetes.io/control-plane:NoSchedule Taints:             node-role.kubernetes.io/control-plane:NoSchedule
-                    node-role.kubernetes.io/master:NoSchedule 
 Unschedulable:      false Unschedulable:      false
 Lease: Lease:
   HolderIdentity:  kubemaster.ittraining.loc   HolderIdentity:  kubemaster.ittraining.loc
   AcquireTime:     <unset>   AcquireTime:     <unset>
-  RenewTime:       Wed13 Jul 2022 05:20:00 +0200+  RenewTime:       Sun04 Sep 2022 16:56:54 +0200
 Conditions: Conditions:
   Type                 Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message   Type                 Status  LastHeartbeatTime                 LastTransitionTime                Reason                       Message
   ----                 ------  -----------------                 ------------------                ------                       -------   ----                 ------  -----------------                 ------------------                ------                       -------
-  NetworkUnavailable   False   Tue12 Jul 2022 13:47:07 +0200   Tue12 Jul 2022 13:47:07 +0200   CalicoIsUp                   Calico is running on this node +  NetworkUnavailable   False   Sun04 Sep 2022 09:44:21 +0200   Sun04 Sep 2022 09:44:21 +0200   CalicoIsUp                   Calico is running on this node 
-  MemoryPressure       False   Wed13 Jul 2022 05:16:21 +0200   Tue12 Jul 2022 13:25:32 +0200   KubeletHasSufficientMemory   kubelet has sufficient memory available +  MemoryPressure       False   Sun04 Sep 2022 16:52:48 +0200   Sun04 Sep 2022 09:35:59 +0200   KubeletHasSufficientMemory   kubelet has sufficient memory available 
-  DiskPressure         False   Wed13 Jul 2022 05:16:21 +0200   Tue12 Jul 2022 13:25:32 +0200   KubeletHasNoDiskPressure     kubelet has no disk pressure +  DiskPressure         False   Sun04 Sep 2022 16:52:48 +0200   Sun04 Sep 2022 09:35:59 +0200   KubeletHasNoDiskPressure     kubelet has no disk pressure 
-  PIDPressure          False   Wed13 Jul 2022 05:16:21 +0200   Tue12 Jul 2022 13:25:32 +0200   KubeletHasSufficientPID      kubelet has sufficient PID available +  PIDPressure          False   Sun04 Sep 2022 16:52:48 +0200   Sun04 Sep 2022 09:35:59 +0200   KubeletHasSufficientPID      kubelet has sufficient PID available 
-  Ready                True    Wed13 Jul 2022 05:16:21 +0200   Tue12 Jul 2022 13:46:13 +0200   KubeletReady                 kubelet is posting ready status+  Ready                True    Sun04 Sep 2022 16:52:48 +0200   Sun04 Sep 2022 12:15:32 +0200   KubeletReady                 kubelet is posting ready status
 ... ...
 </code> </code>
Ligne 546: Ligne 578:
   ephemeral-storage:  18400976Ki   ephemeral-storage:  18400976Ki
   hugepages-2Mi:      0   hugepages-2Mi:      0
-  memory:             16436616Ki+  memory:             8181164Ki
   pods:               110   pods:               110
 Allocatable: Allocatable:
Ligne 552: Ligne 584:
   ephemeral-storage:  16958339454   ephemeral-storage:  16958339454
   hugepages-2Mi:      0   hugepages-2Mi:      0
-  memory:             16334216Ki+  memory:             8078764Ki
   pods:               110   pods:               110
 ... ...
Ligne 567: Ligne 599:
   Machine ID:                 243c6f9d604e4aba852a482a1936be23   Machine ID:                 243c6f9d604e4aba852a482a1936be23
   System UUID:                68639C3A-D77A-4C61-B7E8-4F4F70419B8A   System UUID:                68639C3A-D77A-4C61-B7E8-4F4F70419B8A
-  Boot ID:                    10a1f4fc-9892-49ef-a5c4-72a0a30bd5f9+  Boot ID:                    9bd56aa5-b94c-40d3-804a-a54bd8daf305
   Kernel Version:             4.9.0-19-amd64   Kernel Version:             4.9.0-19-amd64
   OS Image:                   Debian GNU/Linux 9 (stretch)   OS Image:                   Debian GNU/Linux 9 (stretch)
Ligne 573: Ligne 605:
   Architecture:               amd64   Architecture:               amd64
   Container Runtime Version:  containerd://1.4.3   Container Runtime Version:  containerd://1.4.3
-  Kubelet Version:            v1.24.2 +  Kubelet Version:            v1.25.0 
-  Kube-Proxy Version:         v1.24.2+  Kube-Proxy Version:         v1.25.0
 PodCIDR:                      192.168.0.0/24 PodCIDR:                      192.168.0.0/24
 PodCIDRs:                     192.168.0.0/24 PodCIDRs:                     192.168.0.0/24
-Non-terminated Pods:          (in total)+Non-terminated Pods:          (in total)
   Namespace                   Name                                                 CPU Requests  CPU Limits  Memory Requests  Memory Limits  Age   Namespace                   Name                                                 CPU Requests  CPU Limits  Memory Requests  Memory Limits  Age
   ---------                   ----                                                 ------------  ----------  ---------------  -------------  ---   ---------                   ----                                                 ------------  ----------  ---------------  -------------  ---
-  kube-system                 calico-node-688lw                                    250m (6%)     0 (0%)      0 (0%)           0 (0%)         15h +  kube-system                 calico-node-dc7hd                                    250m (6%)     0 (0%)      0 (0%)           0 (0%)         7h18m 
-  kube-system                 coredns-6d4b75cb6d-dw4ph                             100m (2%)     0 (0%)      70Mi (0%)        170Mi (1%)     15h +  kube-system                 coredns-565d847f94-tqd8z                             100m (2%)     0 (0%)      70Mi (0%)        170Mi (2%)     3h56m 
-  kube-system                 coredns-6d4b75cb6d-ms2jm                             100m (2%)     0 (0%)      70Mi (0%)        170Mi (1%)     15h +  kube-system                 etcd-kubemaster.ittraining.loc                       100m (2%)     0 (0%)      100Mi (1%)       0 (0%)         4h19m 
-  kube-system                 etcd-kubemaster.ittraining.loc                       100m (2%)     0 (0%)      100Mi (0%)       0 (0%)         15h +  kube-system                 kube-apiserver-kubemaster.ittraining.loc             250m (6%)     0 (0%)      0 (0%)           0 (0%)         4h19m 
-  kube-system                 kube-apiserver-kubemaster.ittraining.loc             250m (6%)     0 (0%)      0 (0%)           0 (0%)         15h +  kube-system                 kube-controller-manager-kubemaster.ittraining.loc    200m (5%)     0 (0%)      0 (0%)           0 (0%)         4h19m 
-  kube-system                 kube-controller-manager-kubemaster.ittraining.loc    200m (5%)     0 (0%)      0 (0%)           0 (0%)         15h +  kube-system                 kube-proxy-x7fpc                                     0 (0%)        0 (0%)      0 (0%)           0 (0%)         4h25m 
-  kube-system                 kube-proxy-jx76x                                     0 (0%)        0 (0%)      0 (0%)           0 (0%)         15h +  kube-system                 kube-scheduler-kubemaster.ittraining.loc             100m (2%)     0 (0%)      0 (0%)           0 (0%)         4h19m
-  kube-system                 kube-scheduler-kubemaster.ittraining.loc             100m (2%)     0 (0%)      0 (0%)           0 (0%)         15h+
 ... ...
 </code> </code>
Ligne 598: Ligne 629:
 Allocated resources: Allocated resources:
   (Total limits may be over 100 percent, i.e., overcommitted.)   (Total limits may be over 100 percent, i.e., overcommitted.)
-  Resource           Requests     Limits +  Resource           Requests    Limits 
-  --------           --------     ------ +  --------           --------    ------ 
-  cpu                1100m (27%)  0 (0%) +  cpu                (25%)     0 (0%) 
-  memory             240Mi (1%)   340Mi (2%) +  memory             170Mi (2%)  170Mi (2%) 
-  ephemeral-storage  0 (0%)       0 (0%) +  ephemeral-storage  0 (0%)      0 (0%) 
-  hugepages-2Mi      0 (0%)       0 (0%) +  hugepages-2Mi      0 (0%)      0 (0%) 
-Events:              <none>+Events: 
 +  Type    Reason          Age   From             Message 
 +  ----    ------          ----  ----             ------- 
 +  Normal  RegisteredNode  37m   node-controller  Node kubemaster.ittraining.loc event: Registered Node kubemaster.ittraining.loc in Controller
 </code> </code>
  
Ligne 618: Ligne 652:
  
 <code> <code>
-root@kubemaster:~# vi components.yaml  +root@kubemaster:~# vi components.yaml 
-root@kubemaster:~# +root@kubemaster:~#
 ... ...
     spec:     spec:
Ligne 652: Ligne 686:
 root@kubemaster:~# kubectl get deployments --all-namespaces root@kubemaster:~# kubectl get deployments --all-namespaces
 NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE NAMESPACE     NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
-kube-system   calico-kube-controllers   1/               1           15h +default       myapp-deployment          3/3                3           6h50m 
-kube-system   coredns                   2/               2           16h +kube-system   calico-kube-controllers   1/               1           7h22m 
-kube-system   metrics-server            1/1                1           26s +kube-system   coredns                   2/               2           7h25m 
-</code> +kube-system   metrics-server            1/1                1           28s 
 +</code>
  
 Pour connaître l'utilisation des ressources par le nœud, utilisez la commande **top nodes** : Pour connaître l'utilisation des ressources par le nœud, utilisez la commande **top nodes** :
Ligne 661: Ligne 696:
 <code> <code>
 root@kubemaster:~# kubectl top nodes root@kubemaster:~# kubectl top nodes
-NAME                        CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%    +NAME                        CPU(cores)   CPU%   MEMORY(bytes)   MEMORY% 
-kubemaster.ittraining.loc   212m         5%     1451Mi          9        +kubemaster.ittraining.loc   182m         4%     1901Mi          24
-kubenode1.ittraining.loc    72m          1%     1011Mi          12       +kubenode1.ittraining.loc    68m          1%     898Mi           23
-kubenode2.ittraining.loc    297m         7%     744Mi           9  +kubenode2.ittraining.loc    104m         2%     819Mi           21%
 </code> </code>
  
Ligne 671: Ligne 706:
 <code> <code>
 root@kubemaster:~# watch kubectl top nodes root@kubemaster:~# watch kubectl top nodes
-Every 2,0s: kubectl top nodes                                                                                                                                  kubemaster.ittraining.loc: Wed Jul 13 05:29:59 2022+Every 2,0s: kubectl top nodes                                                                                                                                  kubemaster.ittraining.loc: Sun Sep  4 17:02:45 2022
  
 NAME                        CPU(cores)   CPU%   MEMORY(bytes)   MEMORY% NAME                        CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
-kubemaster.ittraining.loc   209m         5%     1482Mi          9+kubemaster.ittraining.loc   142m         3%     1951Mi          24
-kubenode1.ittraining.loc    69m          1%     1011Mi          12+kubenode1.ittraining.loc    71m          1%     899Mi           23
-kubenode2.ittraining.loc    93m          2%     751Mi           9%+kubenode2.ittraining.loc    52m          1%     742Mi           19%
 ... ...
 ^C ^C
-root@kubemaster:~# +root@kubemaster:~#
 </code> </code>
  
-<WRAP center round important 40%> +<WRAP center round important 60%> 
-**Important** : Notez l'utilisation de **^C** pour sortir de l'écran de la commande **watch**. +**Important** : Notez l'utilisation de **^C** pour sortir de l'écran de la commande **watch**.
 </WRAP> </WRAP>
 +
 +Il est possible de trier la sortie par ordre décroissant de l'utilisation du processeur :
 +
 +<code>
 +root@kubemaster:~# kubectl top nodes --sort-by cpu
 +NAME                        CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
 +kubemaster.ittraining.loc   132m         3%     1916Mi          24%       
 +kubenode1.ittraining.loc    65m          1%     952Mi           24%       
 +kubenode2.ittraining.loc    50m          1%     887Mi           23% 
 +</code>
 +
 +Dernièrement, il est possible de trier la sortie par ordre décroissant de l'utilisation de la mémoire :
 +
 +<code>
 +root@kubemaster:~# kubectl top nodes --sort-by memory
 +NAME                        CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
 +kubemaster.ittraining.loc   139m         3%     1909Mi          24%       
 +kubenode1.ittraining.loc    70m          1%     951Mi           24%       
 +kubenode2.ittraining.loc    52m          1%     885Mi           23%  
 +</code>
 +
 +====1.4 - Obtenir de l'Information sur les Pods====
 +
 +===La Commande describe pod===
 +
 +Tout comme avec les noeuds, des informations concernant un pod spécifique peuvent être obtenues en utilisant la commande **kubectl describe** :
 +
 +<code>
 +root@kubemaster:~# kubectl describe pod myapp-deployment-689f9d59-c25f9
 +Name:             myapp-deployment-689f9d59-c25f9
 +Namespace:        default
 +Priority:         0
 +Service Account:  default
 +Node:             kubenode1.ittraining.loc/192.168.56.3
 +Start Time:       Sun, 04 Sep 2022 13:23:12 +0200
 +Labels:           app=myapp
 +                  pod-template-hash=689f9d59
 +                  type=front-end
 +Annotations:      cni.projectcalico.org/containerID: 0d234054b43a4bd5c8a3c8f0a9e0b8594a8d1abdccdad8b656c311ad31731a54
 +                  cni.projectcalico.org/podIP: 192.168.239.9/32
 +                  cni.projectcalico.org/podIPs: 192.168.239.9/32
 +Status:           Running
 +IP:               192.168.239.9
 +IPs:
 +  IP:           192.168.239.9
 +Controlled By:  ReplicaSet/myapp-deployment-689f9d59
 +Containers:
 +  nginx-container:
 +    Container ID:   containerd://b0367fe494be444f98facd069f5a6e48fadce9236ad5a1baa5feb31d2a08760a
 +    Image:          nginx
 +    Image ID:       docker.io/library/nginx@sha256:b95a99feebf7797479e0c5eb5ec0bdfa5d9f504bc94da550c2f58e839ea6914f
 +    Port:           <none>
 +    Host Port:      <none>
 +    State:          Running
 +      Started:      Sun, 04 Sep 2022 13:23:21 +0200
 +    Ready:          True
 +    Restart Count:  0
 +    Environment:    <none>
 +    Mounts:
 +      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-fjdsw (ro)
 +Conditions:
 +  Type              Status
 +  Initialized       True 
 +  Ready             True 
 +  ContainersReady   True 
 +  PodScheduled      True 
 +Volumes:
 +  kube-api-access-fjdsw:
 +    Type:                    Projected (a volume that contains injected data from multiple sources)
 +    TokenExpirationSeconds:  3607
 +    ConfigMapName:           kube-root-ca.crt
 +    ConfigMapOptional:       <nil>
 +    DownwardAPI:             true
 +QoS Class:                   BestEffort
 +Node-Selectors:              <none>
 +Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
 +                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
 +Events:                      <none>
 +</code>
 +
 +===La Commande top===
 +
 +Il est possible de voir l'utilisation des ressources par pod :
 +
 +<code>
 +root@kubemaster:~# kubectl top pods
 +NAME                              CPU(cores)   MEMORY(bytes)   
 +myapp-deployment-689f9d59-c25f9   0m           3Mi             
 +myapp-deployment-689f9d59-nn9sw   0m           4Mi             
 +myapp-deployment-689f9d59-rnc4r   0m           4Mi 
 +</code>
 +
 +Triez maintenant la sortie par ordre décroissant de l'utilisation du processeur :
 +
 +<code>
 +root@kubemaster:~# kubectl top pods --sort-by cpu
 +NAME                              CPU(cores)   MEMORY(bytes)   
 +myapp-deployment-689f9d59-c25f9   0m           3Mi             
 +myapp-deployment-689f9d59-nn9sw   0m           4Mi             
 +myapp-deployment-689f9d59-rnc4r   0m           4Mi 
 +</code>
 +
 +Triez maintenant la sortie par ordre décroissant de l'utilisation de la mémoire :
 +
 +<code>
 +root@kubemaster:~# kubectl top pods --sort-by memory
 +NAME                              CPU(cores)   MEMORY(bytes)   
 +myapp-deployment-689f9d59-nn9sw   0m           4Mi             
 +myapp-deployment-689f9d59-rnc4r   0m           4Mi             
 +myapp-deployment-689f9d59-c25f9   0m           3Mi 
 +</code>
 +
 +====1.5 - Travailler avec la commande kubectl====
 +
 +Créez le fichier **pod.yaml** :
 +
 +<code>
 +root@kubemaster:~# vi pod.yaml
 +root@kubemaster:~# cat pod.yaml
 +apiVersion: v1
 +kind: Pod
 +metadata:
 +  name: my-pod
 +spec:
 +  containers:
 +  - name: busybox
 +    image: radial/busyboxplus:curl
 +    command: ['sh', '-c', 'while true; do sleep 3600; done']
 +</code>
 +
 +====La Commande apply====
 +
 +Créez maintenant le pod en utilisant le fichier **pod.yaml** :
 +
 +<code>
 +root@kubemaster:~# kubectl apply -f pod.yaml
 +pod/my-pod created
 +</code>
 +
 +====La Commande create====
 +
 +La commande **create** ne peut être utilisée que dans le cas où un objet du même nom n'existe pas déjà dans le cluster :
 +
 +<code>
 +root@kubemaster:~# kubectl create -f pod.yaml
 +Error from server (AlreadyExists): error when creating "pod.yaml": pods "my-pod" already exists
 +</code>
 +
 +Pour consulter la liste des objets qui peuvent être créés, utilisez la commande **kubectl create** :
 +
 +<code>
 +root@kubemaster:~# kubectl create
 +Error: must specify one of -f and -k
 +
 +Create a resource from a file or from stdin.
 +
 + JSON and YAML formats are accepted.
 +
 +Examples:
 +  # Create a pod using the data in pod.json
 +  kubectl create -f ./pod.json
 +  
 +  # Create a pod based on the JSON passed into stdin
 +  cat pod.json | kubectl create -f -
 +  
 +  # Edit the data in registry.yaml in JSON then create the resource using the edited data
 +  kubectl create -f registry.yaml --edit -o json
 +
 +Available Commands:
 +  clusterrole           Create a cluster role
 +  clusterrolebinding    Create a cluster role binding for a particular cluster role
 +  configmap             Create a config map from a local file, directory or literal value
 +  cronjob               Create a cron job with the specified name
 +  deployment            Create a deployment with the specified name
 +  ingress               Create an ingress with the specified name
 +  job                   Create a job with the specified name
 +  namespace             Create a namespace with the specified name
 +  poddisruptionbudget   Create a pod disruption budget with the specified name
 +  priorityclass         Create a priority class with the specified name
 +  quota                 Create a quota with the specified name
 +  role                  Create a role with single rule
 +  rolebinding           Create a role binding for a particular role or cluster role
 +  secret                Create a secret using specified subcommand
 +  service               Create a service using a specified subcommand
 +  serviceaccount        Create a service account with the specified name
 +  token                 Request a service account token
 +
 +Options:
 +    --allow-missing-template-keys=true:
 +        If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to
 +        golang and jsonpath output formats.
 +
 +    --dry-run='none':
 +        Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without
 +        sending it. If server strategy, submit server-side request without persisting the resource.
 +
 +    --edit=false:
 +        Edit the API resource before creating
 +
 +    --field-manager='kubectl-create':
 +        Name of the manager used to track field ownership.
 +
 +    -f, --filename=[]:
 +        Filename, directory, or URL to files to use to create the resource
 +
 +    -k, --kustomize='':
 +        Process the kustomization directory. This flag can't be used together with -f or -R.
 +
 +    -o, --output='':
 +        Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath,
 +        jsonpath-as-json, jsonpath-file).
 +
 +    --raw='':
 +        Raw URI to POST to the server.  Uses the transport specified by the kubeconfig file.
 +
 +    -R, --recursive=false:
 +        Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests
 +        organized within the same directory.
 +
 +    --save-config=false:
 +        If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will
 +        be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.
 +
 +    -l, --selector='':
 +        Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching
 +        objects must satisfy all of the specified label constraints.
 +
 +    --show-managed-fields=false:
 +        If true, keep the managedFields when printing objects in JSON or YAML format.
 +
 +    --template='':
 +        Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format
 +        is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
 +
 +    --validate='strict':
 +        Must be one of: strict (or true), warn, ignore (or false).              "true" or "strict" will use a schema to validate
 +        the input and fail the request if invalid. It will perform server side validation if ServerSideFieldValidation
 +        is enabled on the api-server, but will fall back to less reliable client-side validation if not.                "warn" will
 +        warn about unknown or duplicate fields without blocking the request if server-side field validation is enabled
 +        on the API server, and behave as "ignore" otherwise.            "false" or "ignore" will not perform any schema
 +        validation, silently dropping any unknown or duplicate fields.
 +
 +    --windows-line-endings=false:
 +        Only relevant if --edit=true. Defaults to the line ending native to your platform.
 +
 +Usage:
 +  kubectl create -f FILENAME [options]
 +
 +Use "kubectl <command> --help" for more information about a given command.
 +Use "kubectl options" for a list of global command-line options (applies to all commands).
 +</code>
 +
 +La commande **apply** est ensuite utilisée pour appliquer des modifications apportées au fichier yaml :
 +
 +<code>
 +root@kubemaster:~# kubectl apply -f pod.yaml
 +pod/my-pod unchanged
 +</code>
 +
 +====La Commande get====
 +
 +Constatez le statut du pod :
 +
 +<code>
 +root@kubemaster:~# kubectl get pods
 +NAME                              READY   STATUS    RESTARTS   AGE
 +my-pod                            1/1     Running            10s
 +myapp-deployment-689f9d59-c25f9   1/    Running            6d1h
 +myapp-deployment-689f9d59-nn9sw   1/    Running            6d1h
 +myapp-deployment-689f9d59-rnc4r   1/    Running            6d1h
 +</code>
 +
 +Rappelez-vous que vous pouvez utiliser une abréviation pour pods :
 +
 +<code>
 +root@kubemaster:~# kubectl get po
 +NAME                              READY   STATUS    RESTARTS   AGE
 +my-pod                            1/1     Running            54s
 +myapp-deployment-689f9d59-c25f9   1/    Running            6d1h
 +myapp-deployment-689f9d59-nn9sw   1/    Running            6d1h
 +myapp-deployment-689f9d59-rnc4r   1/    Running            6d1h
 +</code>
 +
 +Pour ne voir qu'un seul pod, il convient de préciser son nom en tant qu'argument :
 +
 +<code>
 +root@kubemaster:~# kubectl get po my-pod
 +NAME     READY   STATUS    RESTARTS   AGE
 +my-pod   1/    Running            109s
 +</code>
 +
 +====Utilisation des Options====
 +
 +Rappelez-vous que l'option **wide** vous permet de voir les adresses IP des pods ainsi que les noeuds qui les hébergent :
 +
 +<code>
 +root@kubemaster:~# kubectl get pods -o wide
 +NAME                              READY   STATUS    RESTARTS   AGE    IP               NODE                       NOMINATED NODE   READINESS GATES
 +my-pod                            1/1     Running            115s   192.168.150.9    kubenode2.ittraining.loc   <none>           <none>
 +myapp-deployment-689f9d59-c25f9   1/    Running            6d1h   192.168.239.9    kubenode1.ittraining.loc   <none>           <none>
 +myapp-deployment-689f9d59-nn9sw   1/    Running            6d1h   192.168.239.13   kubenode1.ittraining.loc   <none>           <none>
 +myapp-deployment-689f9d59-rnc4r   1/    Running            6d1h   192.168.239.12   kubenode1.ittraining.loc   <none>           <none>
 +</code>
 +
 +L'utilisation de l'option **json** permet de voir cette même information au format json :
 +
 +<code>
 +root@kubemaster:~# kubectl get pods -o json | more
 +{
 +    "apiVersion": "v1",
 +    "items": [
 +        {
 +            "apiVersion": "v1",
 +            "kind": "Pod",
 +            "metadata": {
 +                "annotations": {
 +                    "cni.projectcalico.org/containerID": "584cf2663957e8a6d5628c7f316e5858629ea646ec890bd5d6f9d1e217963b52",
 +                    "cni.projectcalico.org/podIP": "192.168.150.9/32",
 +                    "cni.projectcalico.org/podIPs": "192.168.150.9/32",
 +                    "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\
 +":{\"annotations\":{},\"name\":\"my-pod\",\"namespace\":\"default\"},\"spec\":{\"containers\":[{\"command\":[\"sh\",\"-c\",\
 +"while true; do sleep 3600; done\"],\"image\":\"radial/busyboxplus:curl\",\"name\":\"busybox\"}]}}\n"
 +                },
 +                "creationTimestamp": "2022-09-10T13:03:20Z",
 +                "name": "my-pod",
 +                "namespace": "default",
 +                "resourceVersion": "755938",
 +                "uid": "628ca9e4-2fbe-4fc9-b0fa-9a05ef942a07"
 +            },
 +            "spec": {
 +                "containers": [
 +                    {
 +                        "command": [
 +                            "sh",
 +                            "-c",
 +                            "while true; do sleep 3600; done"
 +                        ],
 +                        "image": "radial/busyboxplus:curl",
 +                        "imagePullPolicy": "IfNotPresent",
 +                        "name": "busybox",
 +                        "resources": {},
 +                        "terminationMessagePath": "/dev/termination-log",
 +                        "terminationMessagePolicy": "File",
 +                        "volumeMounts": [
 +                            {
 +                                "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
 +                                "name": "kube-api-access-qwzzv",
 +--More--
 +</code>
 +
 +L'utilisation de l'option **yaml** permet de voir cette même information au format yaml :
 +
 +<code>
 +root@kubemaster:~# kubectl get pods -o yaml | more
 +apiVersion: v1
 +items:
 +- apiVersion: v1
 +  kind: Pod
 +  metadata:
 +    annotations:
 +      cni.projectcalico.org/containerID: 584cf2663957e8a6d5628c7f316e5858629ea646ec890bd5d6f9d1e217963b52
 +      cni.projectcalico.org/podIP: 192.168.150.9/32
 +      cni.projectcalico.org/podIPs: 192.168.150.9/32
 +      kubectl.kubernetes.io/last-applied-configuration: |
 +        {"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"my-pod","namespace":"default"},"spec":{"contain
 +ers":[{"command":["sh","-c","while true; do sleep 3600; done"],"image":"radial/busyboxplus:curl","name":"busybox"}]}}
 +    creationTimestamp: "2022-09-10T13:03:20Z"
 +    name: my-pod
 +    namespace: default
 +    resourceVersion: "755938"
 +    uid: 628ca9e4-2fbe-4fc9-b0fa-9a05ef942a07
 +  spec:
 +    containers:
 +    - command:
 +      - sh
 +      - -c
 +      - while true; do sleep 3600; done
 +      image: radial/busyboxplus:curl
 +      imagePullPolicy: IfNotPresent
 +      name: busybox
 +      resources: {}
 +      terminationMessagePath: /dev/termination-log
 +      terminationMessagePolicy: File
 +      volumeMounts:
 +      - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
 +        name: kube-api-access-qwzzv
 +        readOnly: true
 +    dnsPolicy: ClusterFirst
 +    enableServiceLinks: true
 +    nodeName: kubenode2.ittraining.loc
 +    preemptionPolicy: PreemptLowerPriority
 +    priority: 0
 +    restartPolicy: Always
 +--More--
 +</code>
 +
 +L'option **--sort-by** permet de trier la sortie en fonction d'une clef yaml :
 +
 +<code>
 +root@kubemaster:~# kubectl get pods -o wide --sort-by .spec.nodeName
 +NAME                              READY   STATUS    RESTARTS   AGE     IP               NODE                       NOMINATED NODE   READINESS GATES
 +myapp-deployment-689f9d59-c25f9   1/    Running            6d1h    192.168.239.9    kubenode1.ittraining.loc   <none>           <none>
 +myapp-deployment-689f9d59-nn9sw   1/    Running            6d1h    192.168.239.13   kubenode1.ittraining.loc   <none>           <none>
 +myapp-deployment-689f9d59-rnc4r   1/    Running            6d1h    192.168.239.12   kubenode1.ittraining.loc   <none>           <none>
 +my-pod                            1/1     Running            3m22s   192.168.150.9    kubenode2.ittraining.loc   <none>           <none>
 +</code>
 +
 +L'option **--selector** vous permet de ne voir que les pods qui correspondent à l'étiquette indiquée, par exemple, **k8s-app** :
 +
 +<code>
 +root@kubemaster:~# kubectl get pods -n kube-system --selector k8s-app=calico-node
 +NAME                READY   STATUS    RESTARTS   AGE
 +calico-node-5htrc   1/    Running            6d5h
 +calico-node-dc7hd   1/    Running            6d5h
 +calico-node-qk5kt   1/    Running            6d5h
 +</code>
 +
 +====La Commande exec====
 +
 +La commande **exec** permet d'exécuter une commande dans le conteneur. La commande est précédée par les caractères **- -** :
 +
 +<code>
 +root@kubemaster:~# kubectl exec my-pod -c busybox -- echo "Hello, world!"
 +Hello, world!
 +</code>
 +
 +<WRAP center round important 60%>
 +**Important** : Notez l'utilisation de **-c** pour pour indiquer le nom du conteneur.
 +</WRAP>
 +
 +
 +====5.6 - Commandes Impératives ====
 +
 +Avant de poursuivre, supprimez le pod **my-pod** :
 +
 +<code>
 +root@kubemaster:~# kubectl delete pod my-pod
 +pod "my-pod" deleted
 +</code>
 +
 +Créez ensuite un deployment avec une commande impérative :
 +
 +<code>
 +root@kubemaster:~# kubectl create deployment my-deployment --image=nginx
 +deployment.apps/my-deployment created
 +</code>
 +
 +En exécutant la même commande impérative, il est possible de créer des instructions au format yaml en utilisant l'option **--dry-run** :
 +
 +<code>
 +root@kubemaster:~# kubectl create deployment my-deployment --image=nginx --dry-run -o yaml
 +W0910 15:28:49.797172   17135 helpers.go:639] --dry-run is deprecated and can be replaced with --dry-run=client.
 +apiVersion: apps/v1
 +kind: Deployment
 +metadata:
 +  creationTimestamp: null
 +  labels:
 +    app: my-deployment
 +  name: my-deployment
 +spec:
 +  replicas: 1
 +  selector:
 +    matchLabels:
 +      app: my-deployment
 +  strategy: {}
 +  template:
 +    metadata:
 +      creationTimestamp: null
 +      labels:
 +        app: my-deployment
 +    spec:
 +      containers:
 +      - image: nginx
 +        name: nginx
 +        resources: {}
 +status: {}
 +</code>
 +
 +Ces instructions peuvent ensuite être injectées dans un fichier afin d'utiliser celui-ci pour créer un deployment indentique :
 +
 +<code>
 +root@kubemaster:~# kubectl create deployment my-deployment --image=nginx --dry-run -o yaml > deployment.yml
 +W0910 15:29:05.006256   17242 helpers.go:639] --dry-run is deprecated and can be replaced with --dry-run=client.
 +</code>
 +
 +<code>
 +root@kubemaster:~# cat deployment.yml
 +apiVersion: apps/v1
 +kind: Deployment
 +metadata:
 +  creationTimestamp: null
 +  labels:
 +    app: my-deployment
 +  name: my-deployment
 +spec:
 +  replicas: 1
 +  selector:
 +    matchLabels:
 +      app: my-deployment
 +  strategy: {}
 +  template:
 +    metadata:
 +      creationTimestamp: null
 +      labels:
 +        app: my-deployment
 +    spec:
 +      containers:
 +      - image: nginx
 +        name: nginx
 +        resources: {}
 +status: {}
 +</code>
  
 =====LAB #2 - Géstion les plugins de kubectl avec la Commande krew===== =====LAB #2 - Géstion les plugins de kubectl avec la Commande krew=====
Ligne 695: Ligne 1242:
  
 <code> <code>
-root@debian10:~# apt install git-all+root@kubemaster:~# apt install git-all
 </code> </code>
  
Ligne 745: Ligne 1292:
   | krew is now installed! To start using kubectl plugins, you need to add   | krew is now installed! To start using kubectl plugins, you need to add
   | krew's installation directory to your PATH:   | krew's installation directory to your PATH:
- +  |
   |   * macOS/Linux:   |   * macOS/Linux:
   |     - Add the following to your ~/.bashrc or ~/.zshrc:   |     - Add the following to your ~/.bashrc or ~/.zshrc:
   |         export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"   |         export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
   |     - Restart your shell.   |     - Restart your shell.
- +  |
   |   * Windows: Add %USERPROFILE%\.krew\bin to your PATH environment variable   |   * Windows: Add %USERPROFILE%\.krew\bin to your PATH environment variable
- +  |
   | To list krew commands and to get help, run:   | To list krew commands and to get help, run:
   |   $ kubectl krew   |   $ kubectl krew
   | For a full list of available plugins, run:   | For a full list of available plugins, run:
   |   $ kubectl krew search   |   $ kubectl krew search
- +  |
   | You can find documentation at   | You can find documentation at
   |   https://krew.sigs.k8s.io/docs/user-guide/quickstart/.   |   https://krew.sigs.k8s.io/docs/user-guide/quickstart/.
Ligne 1061: Ligne 1608:
 </code> </code>
  
-Le plugin **ns** permet de basculer entre les **namespaces** facilement. +Le plugin **ns** permet de basculer entre les **namespaces** facilement.
  
 Les Namespaces : Les Namespaces :
Ligne 1080: Ligne 1627:
 </code> </code>
  
-Le plugin **view-allocations** permet de visualiser les allocations de ressources telles le CPU, la mémoire, le stockage etc : +Le plugin **view-allocations** permet de visualiser les allocations de ressources telles le CPU, la mémoire, le stockage etc :
  
 <code> <code>
 root@kubemaster:~# kubectl view-allocations root@kubemaster:~# kubectl view-allocations
- Resource                                                     Requested         Limit  Allocatable    Free  + Resource                                                     Requested         Limit  Allocatable    Free 
-  cpu                                                         (13%) 1.6            __         12.0    10.4  +  cpu                                                         (13%) 1.6            __         12.0    10.4 
-  ├─ kubemaster.ittraining.loc                                (28%) 1.1            __          4.0     2.9  +  ├─ kubemaster.ittraining.loc                                (28%) 1.1            __          4.0     2.9 
-  │  ├─ calico-node-688lw                                        250.0m            __           __      __  +  │  ├─ calico-node-688lw                                        250.0m            __           __      __ 
-  │  ├─ coredns-6d4b75cb6d-dw4ph                                 100.0m            __           __      __  +  │  ├─ coredns-6d4b75cb6d-dw4ph                                 100.0m            __           __      __ 
-  │  ├─ coredns-6d4b75cb6d-ms2jm                                 100.0m            __           __      __  +  │  ├─ coredns-6d4b75cb6d-ms2jm                                 100.0m            __           __      __ 
-  │  ├─ etcd-kubemaster.ittraining.loc                           100.0m            __           __      __  +  │  ├─ etcd-kubemaster.ittraining.loc                           100.0m            __           __      __ 
-  │  ├─ kube-apiserver-kubemaster.ittraining.loc                 250.0m            __           __      __  +  │  ├─ kube-apiserver-kubemaster.ittraining.loc                 250.0m            __           __      __ 
-  │  ├─ kube-controller-manager-kubemaster.ittraining.loc        200.0m            __           __      __  +  │  ├─ kube-controller-manager-kubemaster.ittraining.loc        200.0m            __           __      __ 
-  │  └─ kube-scheduler-kubemaster.ittraining.loc                 100.0m            __           __      __  +  │  └─ kube-scheduler-kubemaster.ittraining.loc                 100.0m            __           __      __ 
-  ├─ kubenode1.ittraining.loc                               (6%) 250.0m            __          4.0     3.8  +  ├─ kubenode1.ittraining.loc                               (6%) 250.0m            __          4.0     3.8 
-  │  └─ calico-node-5mrjl                                        250.0m            __           __      __  +  │  └─ calico-node-5mrjl                                        250.0m            __           __      __ 
-  └─ kubenode2.ittraining.loc                               (6%) 250.0m            __          4.0     3.8  +  └─ kubenode2.ittraining.loc                               (6%) 250.0m            __          4.0     3.8 
-     └─ calico-node-j25xd                                        250.0m            __           __      __  +     └─ calico-node-j25xd                                        250.0m            __           __      __ 
-  ephemeral-storage                                                  __            __        50.9G      __  +  ephemeral-storage                                                  __            __        50.9G      __ 
-  ├─ kubemaster.ittraining.loc                                       __            __        17.0G      __  +  ├─ kubemaster.ittraining.loc                                       __            __        17.0G      __ 
-  ├─ kubenode1.ittraining.loc                                        __            __        17.0G      __  +  ├─ kubenode1.ittraining.loc                                        __            __        17.0G      __ 
-  └─ kubenode2.ittraining.loc                                        __            __        17.0G      __  +  └─ kubenode2.ittraining.loc                                        __            __        17.0G      __ 
-  memory                                                   (1%) 240.0Mi  (1%) 340.0Mi       31.0Gi  30.7Gi  +  memory                                                   (1%) 240.0Mi  (1%) 340.0Mi       31.0Gi  30.7Gi 
-  ├─ kubemaster.ittraining.loc                             (2%) 240.0Mi  (2%) 340.0Mi       15.6Gi  15.2Gi  +  ├─ kubemaster.ittraining.loc                             (2%) 240.0Mi  (2%) 340.0Mi       15.6Gi  15.2Gi 
-  │  ├─ coredns-6d4b75cb6d-dw4ph                                 70.0Mi       170.0Mi           __      __  +  │  ├─ coredns-6d4b75cb6d-dw4ph                                 70.0Mi       170.0Mi           __      __ 
-  │  ├─ coredns-6d4b75cb6d-ms2jm                                 70.0Mi       170.0Mi           __      __  +  │  ├─ coredns-6d4b75cb6d-ms2jm                                 70.0Mi       170.0Mi           __      __ 
-  │  └─ etcd-kubemaster.ittraining.loc                          100.0Mi            __           __      __  +  │  └─ etcd-kubemaster.ittraining.loc                          100.0Mi            __           __      __ 
-  ├─ kubenode1.ittraining.loc                                        __            __        7.7Gi      __  +  ├─ kubenode1.ittraining.loc                                        __            __        7.7Gi      __ 
-  └─ kubenode2.ittraining.loc                                        __            __        7.7Gi      __  +  └─ kubenode2.ittraining.loc                                        __            __        7.7Gi      __ 
-  pods                                                        (5%) 17.0     (5%) 17.0        330.0   313.0  +  pods                                                        (5%) 17.0     (5%) 17.0        330.0   313.0 
-  ├─ kubemaster.ittraining.loc                                 (7%) 8.0      (7%) 8.0        110.0   102.0  +  ├─ kubemaster.ittraining.loc                                 (7%) 8.0      (7%) 8.0        110.0   102.0 
-  ├─ kubenode1.ittraining.loc                                  (4%) 4.0      (4%) 4.0        110.0   106.0  +  ├─ kubenode1.ittraining.loc                                  (4%) 4.0      (4%) 4.0        110.0   106.0 
-  └─ kubenode2.ittraining.loc                                  (5%) 5.0      (5%) 5.0        110.0   105.0 +  └─ kubenode2.ittraining.loc                                  (5%) 5.0      (5%) 5.0        110.0   105.0
 </code> </code>
  
Ligne 1136: Ligne 1683:
 16)  kube-scheduler-kubemaster.ittraining.loc           kube-system  Running 16)  kube-scheduler-kubemaster.ittraining.loc           kube-system  Running
 17)  metrics-server-7cb867d5dc-g55k5                    kube-system  Running 17)  metrics-server-7cb867d5dc-g55k5                    kube-system  Running
-Select a Pod:   +Select a Pod:
 </code> </code>
  
Ligne 1153: Ligne 1700:
 I0713 03:28:28.435727       1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file I0713 03:28:28.435727       1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
 I0713 03:28:28.435735       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file I0713 03:28:28.435735       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
-I0713 03:28:28.534094       1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController  +I0713 03:28:28.534094       1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController 
-I0713 03:28:28.535893       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file  +I0713 03:28:28.535893       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file 
-I0713 03:28:28.535937       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file +I0713 03:28:28.535937       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file
 </code> </code>
  
Ligne 1256: Ligne 1803:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** - le contenu de ce fichier crée un **deployment** de 1 **replica** du pod **nginx** à partir de l'image **nginx:1.18.0**. **Important** - le contenu de ce fichier crée un **deployment** de 1 **replica** du pod **nginx** à partir de l'image **nginx:1.18.0**.
 </WRAP> </WRAP>
Ligne 1281: Ligne 1828:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** - le contenu de ce fichier crée un **service** de type **ClusterIP** en utilisant le **deployment** précédent. Le Service ClusterIP permet de regrouper les PODs offrant le même service afin de faciliter la communication. **Important** - le contenu de ce fichier crée un **service** de type **ClusterIP** en utilisant le **deployment** précédent. Le Service ClusterIP permet de regrouper les PODs offrant le même service afin de faciliter la communication.
 </WRAP> </WRAP>
Ligne 1302: Ligne 1849:
 </code> </code>
  
-<WRAP center round important>+<WRAP center round important 60%>
 **Important** - le contenu de ce fichier contient un **patch** pour l'application **nginx** créée par les deux fichiers précédent. Notez le tag **newTag** dans la section **images**. Dans la section **resources** se trouve la liste des manifests concernés par le patch. Notez que seul le manifest **deployment.yaml** fait référence à une image. Cependant, le fichier **service.yaml** est inclus ici car il sera nécessaire par la suite. **Important** - le contenu de ce fichier contient un **patch** pour l'application **nginx** créée par les deux fichiers précédent. Notez le tag **newTag** dans la section **images**. Dans la section **resources** se trouve la liste des manifests concernés par le patch. Notez que seul le manifest **deployment.yaml** fait référence à une image. Cependant, le fichier **service.yaml** est inclus ici car il sera nécessaire par la suite.
 </WRAP> </WRAP>
Ligne 1371: Ligne 1918:
 </code> </code>
  
-<WRAP center round important 40%>+<WRAP center round important 60%>
 **Important** - notez que le fichier généré contient les contenus des **deux** fichiers **deployment.yaml** et **service.yaml** séparés par les caractères **---**. Le contenu du fichier **service.yaml** n'a pas été modifié tandis que l'image a été modifiée de **image: nginx:1.18.0** vers **image: nginx:1.19.1** dans le contenu du fichier **deployment.yaml**. Notez que les deux fichiers d'origine n'ont **pas** été modifiés. **Important** - notez que le fichier généré contient les contenus des **deux** fichiers **deployment.yaml** et **service.yaml** séparés par les caractères **---**. Le contenu du fichier **service.yaml** n'a pas été modifié tandis que l'image a été modifiée de **image: nginx:1.18.0** vers **image: nginx:1.19.1** dans le contenu du fichier **deployment.yaml**. Notez que les deux fichiers d'origine n'ont **pas** été modifiés.
 </WRAP> </WRAP>
Ligne 1400: Ligne 1947:
 </code> </code>
  
-Créez le fichier **overlays/development/kustomization.yaml** :+Créez le fichier **dev_kustomization.yaml** :
  
 <code> <code>
-root@debian10:~/kustomize# vi overlays/development/kustomization.yaml +root@kubemaster:~/kustomize# vi overlays/development/kustomization.yaml 
-root@debian10:~/kustomize# cat overlays/development/kustomization.yaml+root@kubemaster:~/kustomize# cat overlays/development/kustomization.yaml
 apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization kind: Kustomization
Ligne 1422: Ligne 1969:
  
 <code> <code>
-root@debian10:~/kustomize# kubectl kustomize overlays/development/+root@kubemaster:~/kustomize# kubectl kustomize overlays/development/
 apiVersion: v1 apiVersion: v1
 kind: Service kind: Service
Ligne 1477: Ligne 2024:
 </code> </code>
  
-Maintenant créez le fichier **overlays/production/kustomization.yaml** :+Maintenant créez le fichier **prod_kustomization.yaml** :
  
 <code> <code>
-root@debian10:~/kustomize# vi overlays/production/kustomization.yaml +root@kubemaster:~/kustomize# vi overlays/production/kustomization.yaml 
-root@debian10:~/kustomize# cat overlays/production/kustomization.yaml+root@kubemaster:~/kustomize# cat overlays/production/kustomization.yaml
 apiVersion: kustomize.config.k8s.io/v1beta1 apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization kind: Kustomization
Ligne 1503: Ligne 2050:
  
 <code> <code>
-root@debian10:~/kustomize# kubectl kustomize overlays/production/+root@kubemaster:~/kustomize# kubectl kustomize overlays/production/
 apiVersion: v1 apiVersion: v1
 kind: Service kind: Service
Ligne 1639: Ligne 2186:
  
 ---- ----
-Copyright © 2020 Hugh Norris+Copyright © 2024 Hugh Norris
  
Menu