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:k8s09 [2024/02/21 08:34] adminelearning:workbooks:kubernetes:k8s09 [2024/12/20 13:54] (Version actuelle) admin
Ligne 1: Ligne 1:
-<WRAP tabs> 
-  * [[elearning:kubernetes:start|Accueil]] 
-  * [[elearning:workbooks:kubernetes:start|DOF300]] 
-  * [[elearning:workbooks:kubernetes:k8s00|DOF301]] 
-  * [[elearning:workbooks:kubernetes:k8s01|DOF302]] 
-  * [[elearning:workbooks:kubernetes:k8s02|DOF303]] 
-  * [[elearning:workbooks:kubernetes:k8s03|DOF304]] 
-  * [[elearning:workbooks:kubernetes:k8s04|DOF305]] 
-  * [[elearning:workbooks:kubernetes:k8s05|DOF306]] 
-  * [[elearning:workbooks:kubernetes:k8s06|DOF307]] 
-  * [[elearning:workbooks:kubernetes:k8s07|DOF308]] 
-  * [[elearning:workbooks:kubernetes:k8s08|DOF309]] 
-  * [[elearning:workbooks:kubernetes:k8s09|DOF310]] 
-  * [[elearning:workbooks:kubernetes:k8s10|DOF311]] 
-</WRAP> 
- 
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version - **2023.01**+Version - **2024.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======DOF310 - Kubernetes Avancé - StatefulSets, StorageClass Avancé, Helm AvancéMonitoring et Harbor======+ 
 +======DOF310 - StatefulSets, StorageClass Avancé, Helm Avancé et Monitoring======
  
 =====Contenu du Module===== =====Contenu du Module=====
  
-  * **DOF310 - Kubernetes Avancé - StatefulSets, StorageClass Avancé, Helm AvancéMonitoring et Harbor**+  * **DOF310 - StatefulSets, StorageClass Avancé, Helm Avancé et Monitoring**
     * Contenu du Module     * Contenu du Module
     * StatefulSets     * StatefulSets
Ligne 52: Ligne 37:
         * 4.2 - Consultation des Données avec Grafana         * 4.2 - Consultation des Données avec Grafana
         * 4.3 - Consultation des Alertes avec le Web UI de Prometheus          * 4.3 - Consultation des Alertes avec le Web UI de Prometheus 
-    * Harbor + 
-      * LAB #5 - Installation et Configuration de Harbor +=====Ressources===== 
-        5.Installation de Docker et de Docker Compose + 
-        5.2 - Installation de Harbor +====Lab #1==== 
-        * 5.3 - Création d'un Nouveau Projet + 
-        5.4 - Création d'un Dépôt +  https://www.dropbox.com/scl/fi/xqqpanbovwrx7cknd0yam/quarkus-service.yaml?rlkey=buou4viy128u7cgxapwmpetpl&dl=0 
-        * 5.5 - Pousser des Images Supplémentaires +  https://www.dropbox.com/scl/fi/zqrdnfhcxuzcfftgbokx6/statefulset.yaml?rlkey=tqs0xxdlxjlukv30crwy2gll1&dl=0 
-        5.Travailler avec des Artefacts + 
-        5.7 - Copier un Artefact d'un Projet vers un autre Projet +====Lab #2==== 
-        5.8 - Utilisation de Labels + 
-        5.Authentification et RBAC +  https://www.dropbox.com/scl/fi/rk3xnorqu6gk6tstvlivz/pvc.yaml?rlkey=g1dr28lrs6ec6iejp07q2o4jf&dl=0 
-        5.10 - Utilisation d'Images Docker Personnalisées +  https://www.dropbox.com/scl/fi/1rjljxupug5wra2zpu84n/nfs-busybox.yaml?rlkey=yta13fyr2rh6a6dmsnjl10p7b&dl=0 
-        5.11 - Rétention de Tags +  https://www.dropbox.com/scl/fi/b2ocglzuqbadnnyzipfyc/pvc2.yaml?rlkey=xxc7wz3pwdo4ybfqa54zav63z&dl=0 
-        5.12 Immutabilité des Tags+ 
 +====Lab #3==== 
 + 
 +  https://www.dropbox.com/scl/fi/0d5znog6rdou1doko43yy/ghost.yaml?rlkey=hebkdn9ch0v9nctimiayondwc&dl=0 
 +  https://www.dropbox.com/scl/fi/m6fmpsz25lqugzqfqxpdt/ghost-service.yaml?rlkey=zyxh7ep17eujbuycddqjdsrqy&dl=0 
 +  https://www.dropbox.com/scl/fi/zot4i0u0hf4yw2yj3kyey/values.yaml?rlkey=apv0grxwvomxa9c0avig87pzy&dl=0 
 +  https://www.dropbox.com/scl/fi/zyf0mbbp3wuwnnfzzez3a/service.yaml?rlkey=47bpjs3f6u474f8v0tiunl3am&dl=0 
 +  https://www.dropbox.com/scl/fi/kark41xnz5hlilag5on0y/ghost-values.yaml?rlkey=fohccb7rwc8z66qhn4heyn2lj&dl=0
  
 =====StatefulSets===== =====StatefulSets=====
Ligne 399: Ligne 391:
 statefulset.apps "quarkus-statefulset" deleted statefulset.apps "quarkus-statefulset" deleted
  
-root@kubemaster:~# kubectl delete -f external-svc.yaml +root@kubemaster:~# kubectl delete -f quarkus-service.yaml 
 service "quarkus-statefulset-2" deleted service "quarkus-statefulset-2" deleted
  
Ligne 1393: Ligne 1385:
  
 ====LAB #4 - Mise en Place d'une Solution Prometheus==== ====LAB #4 - Mise en Place d'une Solution Prometheus====
 +
 +Connectez-vous à la VM **Gateway_10.0.2.40_VNC**.
  
 ===4.1 - Déploiement du Stack avec Helm=== ===4.1 - Déploiement du Stack avec Helm===
Ligne 1399: Ligne 1393:
  
 <code> <code>
-root@kubemaster:~helm repo add prometheus-community https://prometheus-community.github.io/helm-charts+trainee@gateway:~helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
 "prometheus-community" has been added to your repositories "prometheus-community" has been added to your repositories
-root@kubemaster:~helm repo update + 
-Hang tight while we grab the latest from your chart repositories... +trainee@gateway:~helm repo update
-...Successfully got an update from the "nfs-subdir-external-provisioner" chart repository +
-...Successfully got an update from the "prometheus-community" chart repository +
-...Successfully got an update from the "bitnami" chart repository +
-Update Complete. ⎈Happy Helming!⎈+
 </code> </code>
  
Ligne 1412: Ligne 1402:
  
 <code> <code>
-root@kubemaster:~helm install prometheus prometheus-community/kube-prometheus-stack+trainee@gateway:~helm install prometheus prometheus-community/kube-prometheus-stack
 NAME: prometheus NAME: prometheus
 LAST DEPLOYED: Thu Dec  8 17:04:17 2022 LAST DEPLOYED: Thu Dec  8 17:04:17 2022
Ligne 1428: Ligne 1418:
  
 <code> <code>
-root@kubemaster:~kubectl --namespace default get pods -l "release=prometheus"+trainee@gateway:~kubectl --namespace default get pods -l "release=prometheus"
 NAME                                                   READY   STATUS    RESTARTS   AGE NAME                                                   READY   STATUS    RESTARTS   AGE
 prometheus-kube-prometheus-operator-689dd6679c-2th6f   1/    Running            4m12s prometheus-kube-prometheus-operator-689dd6679c-2th6f   1/    Running            4m12s
Ligne 1440: Ligne 1430:
  
 <code> <code>
-root@kubemaster:~kubectl get all -l "release=prometheus"+trainee@gateway:~kubectl get all -l "release=prometheus"
 NAME                                                       READY   STATUS    RESTARTS   AGE NAME                                                       READY   STATUS    RESTARTS   AGE
 pod/prometheus-kube-prometheus-operator-689dd6679c-2th6f   1/    Running            13h pod/prometheus-kube-prometheus-operator-689dd6679c-2th6f   1/    Running            13h
Ligne 1488: Ligne 1478:
  
 <code> <code>
-root@kubemaster:~kubectl get configmap -l "release=prometheus"+trainee@gateway:~kubectl get configmap -l "release=prometheus"
 NAME                                                           DATA   AGE NAME                                                           DATA   AGE
 prometheus-kube-prometheus-alertmanager-overview                    13h prometheus-kube-prometheus-alertmanager-overview                    13h
Ligne 1522: Ligne 1512:
  
 <code> <code>
-root@kubemaster:~kubectl get secrets +trainee@gateway:~kubectl get secrets 
 NAME                                                                TYPE                 DATA   AGE NAME                                                                TYPE                 DATA   AGE
 alertmanager-prometheus-kube-prometheus-alertmanager                Opaque                    13h alertmanager-prometheus-kube-prometheus-alertmanager                Opaque                    13h
Ligne 1541: Ligne 1531:
  
 <code> <code>
-root@kubemaster:~kubectl get crd+trainee@gateway:~kubectl get crd
 NAME                                                  CREATED AT NAME                                                  CREATED AT
 alertmanagerconfigs.monitoring.coreos.com             2022-12-08T16:04:14Z alertmanagerconfigs.monitoring.coreos.com             2022-12-08T16:04:14Z
Ligne 1579: Ligne 1569:
  
 <code> <code>
-root@kubemaster:~kubectl get all | grep grafana+trainee@gateway:~kubectl get all | grep grafana
 pod/prometheus-grafana-5d9f5d6499-f4x6t                      3/3     Running     1 (13h ago)     14h pod/prometheus-grafana-5d9f5d6499-f4x6t                      3/3     Running     1 (13h ago)     14h
 service/prometheus-grafana                        ClusterIP   10.109.207.199   <none>        80/TCP                       14h service/prometheus-grafana                        ClusterIP   10.109.207.199   <none>        80/TCP                       14h
Ligne 1589: Ligne 1579:
  
 <code> <code>
-root@kubemaster:~kubectl logs prometheus-grafana-5d9f5d6499-f4x6t -c grafana | grep HTTP+trainee@gateway:~kubectl logs prometheus-grafana-5d9f5d6499-f4x6t -c grafana | grep HTTP
 logger=http.server t=2022-12-08T16:16:51.215644746Z level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket= logger=http.server t=2022-12-08T16:16:51.215644746Z level=info msg="HTTP Server Listen" address=[::]:3000 protocol=http subUrl= socket=
 </code> </code>
Ligne 1596: Ligne 1586:
  
 <code> <code>
-root@kubemaster:~kubectl logs prometheus-grafana-5d9f5d6499-f4x6t -c grafana | grep "user="+trainee@gateway:~kubectl logs prometheus-grafana-5d9f5d6499-f4x6t -c grafana | grep "user="
 logger=sqlstore t=2022-12-08T16:16:50.536980031Z level=info msg="Created default admin" user=admin logger=sqlstore t=2022-12-08T16:16:50.536980031Z level=info msg="Created default admin" user=admin
 </code> </code>
Ligne 1609: Ligne 1599:
  
 <code> <code>
-root@kubemaster:~kubectl port-forward deployment/prometheus-grafana 3000+trainee@gateway:~kubectl port-forward deployment/prometheus-grafana 3000
 Forwarding from 127.0.0.1:3000 -> 3000 Forwarding from 127.0.0.1:3000 -> 3000
 Forwarding from [::1]:3000 -> 3000 Forwarding from [::1]:3000 -> 3000
Ligne 1615: Ligne 1605:
 </code> </code>
  
-Consultez maintenant la VM kubemaster en mode graphique et lancez le navigateur web. Saisissez l'URL **http://127.0.0.1:3000** et connectez-vous à Grafana :+Consultez maintenant la VM **Gateway_10.0.2.40_VNC** et lancez le navigateur web. Saisissez l'URL **http://127.0.0.1:3000** et connectez-vous à Grafana :
  
 {{ :elearning:workbooks:kubernetes:capture_d_ecran_du_2022-12-09_06-50-22.png?direct&800 |Image}} {{ :elearning:workbooks:kubernetes:capture_d_ecran_du_2022-12-09_06-50-22.png?direct&800 |Image}}
Ligne 1632: Ligne 1622:
  
 <code> <code>
-root@kubemaster:~kubectl port-forward prometheus-prometheus-kube-prometheus-prometheus-0 9090+trainee@gateway:~kubectl port-forward prometheus-prometheus-kube-prometheus-prometheus-0 9090
 Forwarding from 127.0.0.1:9090 -> 9090 Forwarding from 127.0.0.1:9090 -> 9090
 Forwarding from [::1]:9090 -> 9090 Forwarding from [::1]:9090 -> 9090
 </code> </code>
  
-Retournez dans l'interface graphique de la VM kubemaster et saisissez l'URL **http://127.0.0.1:9090** :+Retournez dans l'interface graphique de la VM **Gateway_10.0.2.40_VNC** et saisissez l'URL **http://127.0.0.1:9090** :
  
 {{ :elearning:workbooks:kubernetes:capture_d_ecran_du_2022-12-09_07-13-13.png?direct&800 |}} {{ :elearning:workbooks:kubernetes:capture_d_ecran_du_2022-12-09_07-13-13.png?direct&800 |}}
Ligne 1644: Ligne 1634:
  
 {{ :elearning:workbooks:kubernetes:capture_d_ecran_du_2022-12-09_07-14-08.png?direct&800 |}} {{ :elearning:workbooks:kubernetes:capture_d_ecran_du_2022-12-09_07-14-08.png?direct&800 |}}
- 
-=====Harbor===== 
- 
-**Harbor** est un registre open source qui : 
- 
-  * sécurise les artefacts (images) avec des politiques 
-  * utilise un contrôle d'accès basé sur les rôles 
-  * garantit que les images sont analysées et exemptes de vulnérabilités 
-  * signe les images comme fiables. 
- 
-====LAB #5 - Installation et Configuration de Harbor==== 
- 
-===5.1 - Installation de Docker et de Docker Compose=== 
- 
-Connectez-vous à votre instance de Debian11 en tant que trainee au 10.0.2.45 puis devenez l'utilisateur **root**. 
- 
-Installez les dépendances de Docker : 
- 
-<code> 
-root@debian11:~# apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common 
-</code> 
- 
-Téléchargez la clef GPG officielle de docker : 
- 
-<code> 
-root@debian11:~# curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - 
-OK 
-</code> 
- 
-Ajoutez le dépôt stable de docker : 
- 
-<code> 
-root@debian11:~# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" 
-</code> 
- 
-Installez maintenant **docker-ce** : 
- 
-<code> 
-root@debian11:~# apt-get install docker-ce lvm2 libdevmapper-dev 
-</code> 
- 
-Téléchargez docker-compose : 
- 
-<code> 
-root@debian11:~#  wget https://github.com/docker/compose/releases/download/v2.14.0/docker-compose-linux-x86_64 
-</code> 
- 
-Rendez docker-compose exécutable et déplacez-le dans le répertoire **/usr/bin:** : 
- 
-<code> 
-root@debian11:~# chmod +x docker-compose-linux-x86_64 
- 
-root@debian11:~# mv docker-compose-linux-x86_64 /usr/bin/docker-compose 
-</code> 
- 
-===5.2 - Installation de Harbor=== 
- 
-Téléchargez Harbor : 
- 
-<code> 
-root@debian11:~# wget https://github.com/goharbor/harbor/releases/download/v2.6.2/harbor-offline-installer-v2.6.2.tgz 
-</code> 
- 
-Désarchivez Harbor : 
- 
-<code> 
-root@debian11:~# tar xvzf harbor-offline-installer*.tgz 
-harbor/harbor.v2.6.2.tar.gz 
-harbor/prepare 
-harbor/LICENSE 
-harbor/install.sh 
-harbor/common.sh 
-harbor/harbor.yml.tmpl 
-</code> 
- 
-Placez-vous dans le répertoire **harbor** et copiez le fichier **harbor.yml.tmpl** vers **harbor.yml** : 
- 
-<code> 
-root@debian11:~# cd harbor/ 
- 
-root@debian11:~/harbor# cp harbor.yml.tmpl harbor.yml 
-</code> 
- 
-Créez le fichier **/etc/docker/daemon.json** afin de configurer Docker pour l'utilisation du dépôt non-sécurisé : 
- 
-<code> 
-root@debian11:~/harbor# vi /etc/docker/daemon.json 
-root@debian11:~/harbor# cat /etc/docker/daemon.json 
-{ 
-"insecure-registries" : ["10.0.2.45:5000", "0.0.0.0"] 
-} 
-</code> 
- 
-Modifiez maintenant l'entrée **hostname** du fichier **harbor/harbor.yml** et commentez la section concernant les connexions https : 
- 
-<code> 
-root@debian11:~/harbor# vi harbor.yml 
-root@debian11:~/harbor# head -n 20 harbor.yml 
-# Configuration file of Harbor 
- 
-# The IP address or hostname to access admin UI and registry service. 
-# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients. 
-hostname: 10.0.2.45  
- 
-# http related config 
-http: 
-  # port for http, default is 80. If https enabled, this port will redirect to https port 
-  port: 80 
- 
-# https related config 
-# https: 
-  # https port for harbor, default is 443 
-  # port: 443 
-  # The path of cert and key files for nginx 
-  # certificate: /your/certificate/path 
-  # private_key: /your/private/key/path 
- 
-# # Uncomment following will enable tls communication between all harbor components 
-</code> 
- 
-Constatez la présence du script **install.sh** dans le répertoire **harbor/** : 
- 
-<code> 
-root@debian11:~/harbor# ls 
-common.sh             harbor.yml       install.sh  prepare 
-harbor.v2.6.2.tar.gz  harbor.yml.tmpl  LICENSE 
-</code> 
- 
-Désactivez le service nginx dans la VM Debian11 : 
- 
-<code> 
-root@debian11:~/harbor# systemctl stop nginx 
- 
-root@debian11:~/harbor# systemctl disable nginx 
-</code> 
- 
-Installez maintenant Harbor avec le support pour **Chart Museum** et **Trivy** : 
- 
-<code> 
-root@debian11:~/harbor# ./install.sh --with-trivy --with-chartmuseum 
- 
-[Step 0]: checking if docker is installed ... 
- 
-Note: docker version: 20.10.21 
- 
-[Step 1]: checking docker-compose is installed ... 
- 
-Note: docker-compose version: 2.14.0 
- 
-[Step 2]: loading Harbor images ... 
-... 
-[Step 3]: preparing environment ... 
-... 
-[Step 4]: preparing harbor configs ... 
-... 
-[Step 5]: starting Harbor ... 
-➜  
-    Chartmusuem will be deprecated as of Harbor v2.6.0 and start to be removed in v2.8.0 or later. 
-    Please see discussion here for more details. https://github.com/goharbor/harbor/discussions/15057 
-[+] Running 13/13 
- ⠿ Network harbor_harbor              Created                                                                                                                                                                0.2s 
- ⠿ Network harbor_harbor-chartmuseum  Created                                                                                                                                                                0.3s 
- ⠿ Container harbor-log               Started                                                                                                                                                               14.1s 
- ⠿ Container registry                 Started                                                                                                                                                               15.8s 
- ⠿ Container registryctl              Started                                                                                                                                                               18.1s 
- ⠿ Container harbor-portal            Started                                                                                                                                                               18.1s 
- ⠿ Container redis                    Started                                                                                                                                                               16.9s 
- ⠿ Container chartmuseum              Started                                                                                                                                                               15.7s 
- ⠿ Container harbor-db                Started                                                                                                                                                               16.4s 
- ⠿ Container trivy-adapter            Started                                                                                                                                                               14.8s 
- ⠿ Container harbor-core              Started                                                                                                                                                               15.0s 
- ⠿ Container nginx                    Started                                                                                                                                                               13.4s 
- ⠿ Container harbor-jobservice        Started                                                                                                                                                               13.2s 
-✔ ----Harbor has been installed and started successfully.---- 
-</code> 
- 
-Constatez les conteneurs créés par l'installation : 
- 
-<code> 
-root@debian11:~/harbor# docker ps -a 
-CONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS                    PORTS                                   NAMES 
-b8e4e3934c7a   goharbor/harbor-jobservice:v2.6.2      "/harbor/entrypoint.…"   15 minutes ago   Up 15 minutes (healthy)                                           harbor-jobservice 
-579b4b43877f   goharbor/nginx-photon:v2.6.2           "nginx -g 'daemon of…"   15 minutes ago   Up 15 minutes (healthy)   0.0.0.0:80->8080/tcp, :::80->8080/tcp   nginx 
-57c8697b4d39   goharbor/trivy-adapter-photon:v2.6.2   "/home/scanner/entry…"   16 minutes ago   Up 15 minutes (healthy)                                           trivy-adapter 
-ce4823c62886   goharbor/harbor-core:v2.6.2            "/harbor/entrypoint.…"   16 minutes ago   Up 15 minutes (healthy)                                           harbor-core 
-57992f8f573a   goharbor/chartmuseum-photon:v2.6.2     "./docker-entrypoint…"   16 minutes ago   Up 15 minutes (healthy)                                           chartmuseum 
-e2df863f7009   goharbor/harbor-portal:v2.6.2          "nginx -g 'daemon of…"   16 minutes ago   Up 15 minutes (healthy)                                           harbor-portal 
-3e7e2093a4a2   goharbor/harbor-db:v2.6.2              "/docker-entrypoint.…"   16 minutes ago   Up 15 minutes (healthy)                                           harbor-db 
-406aa384c742   goharbor/redis-photon:v2.6.2           "redis-server /etc/r…"   16 minutes ago   Up 15 minutes (healthy)                                           redis 
-ddf08dcc8390   goharbor/harbor-registryctl:v2.6.2     "/home/harbor/start.…"   16 minutes ago   Up 15 minutes (healthy)                                           registryctl 
-b5cedbab739d   goharbor/registry-photon:v2.6.2        "/home/harbor/entryp…"   16 minutes ago   Up 15 minutes (healthy)                                           registry 
-13665ace83fd   goharbor/harbor-log:v2.6.2             "/bin/sh -c /usr/loc…"   16 minutes ago   Up 15 minutes (healthy)   127.0.0.1:1514->10514/tcp               harbor-log 
-</code> 
- 
-Ainsi que les images téléchargées : 
- 
-<code> 
-root@debian11:~/harbor# docker images 
-REPOSITORY                      TAG       IMAGE ID       CREATED       SIZE 
-goharbor/harbor-exporter        v2.6.2    ae230e335853   4 weeks ago   95.4MB 
-goharbor/chartmuseum-photon     v2.6.2    be361eee8a36   4 weeks ago   225MB 
-goharbor/redis-photon           v2.6.2    84fa3669bb10   4 weeks ago   154MB 
-goharbor/trivy-adapter-photon   v2.6.2    beef2527c7b2   4 weeks ago   441MB 
-goharbor/notary-server-photon   v2.6.2    b43e7c963f06   4 weeks ago   112MB 
-goharbor/notary-signer-photon   v2.6.2    4e9982286316   4 weeks ago   109MB 
-goharbor/harbor-registryctl     v2.6.2    d403d4e0f990   4 weeks ago   137MB 
-goharbor/registry-photon        v2.6.2    596e445b18f0   4 weeks ago   77.5MB 
-goharbor/nginx-photon           v2.6.2    cbbdf28947a5   4 weeks ago   154MB 
-goharbor/harbor-log             v2.6.2    3ce902023f73   4 weeks ago   161MB 
-goharbor/harbor-jobservice      v2.6.2    05791a75c8b8   4 weeks ago   250MB 
-goharbor/harbor-core            v2.6.2    484e2a64616d   4 weeks ago   213MB 
-goharbor/harbor-portal          v2.6.2    932297030d4e   4 weeks ago   162MB 
-goharbor/harbor-db              v2.6.2    351b19e366cb   4 weeks ago   225MB 
-goharbor/prepare                v2.6.2    eecc993c7643   4 weeks ago   164MB 
-</code> 
- 
-Constatez maintenant les réseaux créés par l'installation : 
- 
-<code> 
-root@debian11:~/harbor# docker network ls 
-NETWORK ID     NAME                        DRIVER    SCOPE 
-c080bf952007   bridge                      bridge    local 
-380a2401fb01   harbor_harbor               bridge    local 
-b5d0cc4623f6   harbor_harbor-chartmuseum   bridge    local 
-3e48278ae275   host                        host      local 
-4dd9174d8e25   none                        null      local 
-</code> 
- 
-===5.3 - Création d'un Nouveau Projet=== 
- 
-Connectez-vous à votre gateway en RDP et ouvrez le navigateur web. Allez à l'URL http://10.0.2.45 : 
- 
-{{ :elearning:workbooks:kubernetes:harbor.png?direct&800 |}} 
- 
-Connectez-vous avec les identifiants par défaut - admin / Harbor12345 : 
- 
-{{ :elearning:workbooks:kubernetes:harbor2.png?direct&800 |}} 
- 
-Harbor est organisé autour de **Projets**. Dans un projet se trouvent des **Dépôts** ou //Repositories//. Le projet nous permet de configurer le RBAC. Créez donc un nouveau projet en cliquant sur le bouton **New Project** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor03.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que la valeur de **-1** indique que le projet a un quota de disque **illimité**. 
-</WRAP> 
- 
-Cliquez sur le bouton **OK** puis cliquez sur le nom **myproject** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor04.png?direct&800 |}} 
- 
-===5.4 - Création d'un Dépôt=== 
- 
-Téléchargez maintenant l'image de **hello-world** à partir de docker.io : 
- 
-<code> 
-root@debian11:~/harbor# docker pull hello-world 
-Using default tag: latest 
-latest: Pulling from library/hello-world 
-2db29710123e: Pull complete  
-Digest: sha256:faa03e786c97f07ef34423fccceeec2398ec8a5759259f94d99078f264e9d7af 
-Status: Downloaded newer image for hello-world:latest 
-docker.io/library/hello-world:latest 
-</code> 
- 
-Retournez dans Harbor et cliquez sur **PUSH COMMAND** à droite. Dans la liste des commandes vous vous apercevrez la commande pour //tagger// une image pour le porjet **myproject** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor05.png?direct&800 |}} 
- 
-Copiez cette commande puis modifiez la ainsi : 
- 
-<code> 
-root@debian11:~/harbor# docker tag hello-world 10.0.2.45:80/myproject/hello-world 
- 
-root@debian11:~/harbor# docker images 
-REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE 
-goharbor/harbor-exporter             v2.6.2    ae230e335853   4 weeks ago     95.4MB 
-goharbor/chartmuseum-photon          v2.6.2    be361eee8a36   4 weeks ago     225MB 
-goharbor/redis-photon                v2.6.2    84fa3669bb10   4 weeks ago     154MB 
-goharbor/trivy-adapter-photon        v2.6.2    beef2527c7b2   4 weeks ago     441MB 
-goharbor/notary-server-photon        v2.6.2    b43e7c963f06   4 weeks ago     112MB 
-goharbor/notary-signer-photon        v2.6.2    4e9982286316   4 weeks ago     109MB 
-goharbor/harbor-registryctl          v2.6.2    d403d4e0f990   4 weeks ago     137MB 
-goharbor/registry-photon             v2.6.2    596e445b18f0   4 weeks ago     77.5MB 
-goharbor/nginx-photon                v2.6.2    cbbdf28947a5   4 weeks ago     154MB 
-goharbor/harbor-log                  v2.6.2    3ce902023f73   4 weeks ago     161MB 
-goharbor/harbor-jobservice           v2.6.2    05791a75c8b8   4 weeks ago     250MB 
-goharbor/harbor-core                 v2.6.2    484e2a64616d   4 weeks ago     213MB 
-goharbor/harbor-portal               v2.6.2    932297030d4e   4 weeks ago     162MB 
-goharbor/harbor-db                   v2.6.2    351b19e366cb   4 weeks ago     225MB 
-goharbor/prepare                     v2.6.2    eecc993c7643   4 weeks ago     164MB 
-hello-world                          latest    feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/hello-world   latest    feb5d9fea6a5   14 months ago   13.3kB 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez la spécification du port **80**. Sans spécifier le port le port par défaut **443** serait utilisé. 
-</WRAP> 
- 
-Connectez-vous à Harbor : 
- 
-<code> 
-root@debian11:~/harbor# docker login 10.0.2.45:80 
-Username: admin 
-Password: Harbor12345 
-Error response from daemon: Get "https://10.0.2.45:80/v2/": http: server gave HTTP response to HTTPS client 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez l'erreur **Error response from daemon: Get "https://10.0.2.45:80/v2/": http: server gave HTTP response to HTTPS client**. Ceci est du à la configuration de docker dans le fichier **/etc/docker/daemon.json** où le port 80 n'a pas été spécifié : 
-</WRAP> 
- 
-<code> 
-root@debian11:~/harbor# cat /etc/docker/daemon.json 
-{ 
-"insecure-registries" : ["10.0.2.45:5000", "0.0.0.0"] 
-} 
-</code> 
- 
-Modifiez donc ce fichier : 
- 
-<code> 
-root@debian11:~/harbor# vi /etc/docker/daemon.json 
-root@debian11:~/harbor# cat /etc/docker/daemon.json 
-{ 
-"insecure-registries" : ["10.0.2.45:5000", "10.0.2.45:80", "0.0.0.0"] 
-} 
-</code> 
- 
-Redémarrez le service docker : 
- 
-<code> 
-root@debian11:~/harbor# systemctl restart docker 
-root@debian11:~/harbor# systemctl status docker 
-● docker.service - Docker Application Container Engine 
-     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) 
-     Active: active (running) since Sun 2022-12-11 08:57:36 CET; 20s ago 
-TriggeredBy: ● docker.socket 
-       Docs: https://docs.docker.com 
-   Main PID: 487567 (dockerd) 
-      Tasks: 44 
-     Memory: 56.2M 
-        CPU: 2.275s 
-     CGroup: /system.slice/docker.service 
-             ├─487567 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock 
-             ├─487820 /usr/bin/docker-proxy -proto tcp -host-ip 127.0.0.1 -host-port 1514 -contain> 
-             ├─488485 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 80 -container-i> 
-             └─488494 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 80 -container-ip 172> 
- 
-Dec 11 08:57:14 debian11 dockerd[487567]: time="2022-12-11T08:57:14.186814789+01:00" level=info ms> 
-Dec 11 08:57:14 debian11 dockerd[487567]: time="2022-12-11T08:57:14.571406314+01:00" level=info ms> 
-Dec 11 08:57:19 debian11 dockerd[487567]: time="2022-12-11T08:57:19.175392656+01:00" level=info ms> 
-Dec 11 08:57:21 debian11 dockerd[487567]: time="2022-12-11T08:57:21.464318214+01:00" level=error m> 
-Dec 11 08:57:21 debian11 dockerd[487567]: time="2022-12-11T08:57:21.464360074+01:00" level=error m> 
-Dec 11 08:57:31 debian11 dockerd[487567]: time="2022-12-11T08:57:31.545302044+01:00" level=info ms> 
-Dec 11 08:57:35 debian11 dockerd[487567]: time="2022-12-11T08:57:35.749031343+01:00" level=info ms> 
-Dec 11 08:57:36 debian11 dockerd[487567]: time="2022-12-11T08:57:36.596800068+01:00" level=info ms> 
-</code> 
- 
-Maintenant redémarrez Harbor : 
- 
-<code> 
-root@debian11:~/harbor# docker-compose down -v 
-[+] Running 13/13 
- ⠿ Container harbor-jobservice        Removed                                                 5.7s 
- ⠿ Container nginx                    Removed                                                 5.8s 
- ⠿ Container chartmuseum              Removed                                                 0.2s 
- ⠿ Container trivy-adapter            Removed                                                 5.8s 
- ⠿ Container registryctl              Removed                                                13.9s 
- ⠿ Container harbor-portal            Removed                                                 4.7s 
- ⠿ Container harbor-core              Removed                                                 5.3s 
- ⠿ Container harbor-db                Removed                                                 8.9s 
- ⠿ Container registry                 Removed                                                 4.0s 
- ⠿ Container redis                    Removed                                                 8.7s 
- ⠿ Container harbor-log               Removed                                                14.2s 
- ⠿ Network harbor_harbor              Removed                                                 0.8s 
- ⠿ Network harbor_harbor-chartmuseum  Removed                                                 0.6s 
- 
-root@debian11:~/harbor# docker-compose up -d 
-[+] Running 13/13 
- ⠿ Network harbor_harbor              Created                                                 0.4s 
- ⠿ Network harbor_harbor-chartmuseum  Created                                                 0.3s 
- ⠿ Container harbor-log               Started                                                13.5s 
- ⠿ Container harbor-db                Started                                                12.9s 
- ⠿ Container harbor-portal            Started                                                14.8s 
- ⠿ Container chartmuseum              Started                                                14.3s 
- ⠿ Container redis                    Started                                                16.8s 
- ⠿ Container registryctl              Started                                                16.3s 
- ⠿ Container registry                 Started                                                15.2s 
- ⠿ Container trivy-adapter            Started                                                14.0s 
- ⠿ Container harbor-core              Started                                                14.9s 
- ⠿ Container harbor-jobservice        Started                                                14.8s 
- ⠿ Container nginx                    Started                                                15.0s 
-</code> 
- 
-Connectez-vous à Harbor : 
- 
-<code> 
-root@debian11:~/harbor# docker login 10.0.2.45:80 
-Username: admin 
-Password:  
-WARNING! Your password will be stored unencrypted in /root/.docker/config.json. 
-Configure a credential helper to remove this warning. See 
-https://docs.docker.com/engine/reference/commandline/login/#credentials-store 
- 
-Login Succeeded 
-</code> 
- 
-Les coordonnées de connexion sont stockées dans le fichier **/root/.docker/config.json** : 
- 
-<code> 
-root@debian11:~/harbor# cat /root/.docker/config.json 
-{ 
-        "auths": { 
-                "10.0.2.45:80": { 
-                        "auth": "YWRtaW46SGFyYm9yMTIzNDU=" 
-                } 
-        } 
-}root@debian11:~/harbor# 
-</code> 
- 
-De cette façon, lors des logins futur, docker ne demandera ni le nom de l'utilisateur, ni le mot de passe : 
- 
-<code> 
-root@debian11:~/harbor# docker logout 
-Removing login credentials for https://index.docker.io/v1/ 
- 
-root@debian11:~/harbor# docker login 10.0.2.45:80 
-Authenticating with existing credentials... 
-WARNING! Your password will be stored unencrypted in /root/.docker/config.json. 
-Configure a credential helper to remove this warning. See 
-https://docs.docker.com/engine/reference/commandline/login/#credentials-store 
- 
-Login Succeeded 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/harbor# docker push 10.0.2.45:80/myproject/hello-world 
-Using default tag: latest 
-The push refers to repository [10.0.2.45:80/myproject/hello-world] 
-e07ee1baac5f: Pushed  
-latest: digest: sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4 size: 525 
-</code> 
- 
-Retournez à Harbor et constatez la présence du dépôt : 
- 
-{{ :elearning:workbooks:kubernetes:harbor06.png?direct&800 |}} 
- 
-Cliquez sur le nom du dépôt et constatez son contenu : 
- 
-{{ :elearning:workbooks:kubernetes:harbor07.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que l'image stocké dans Harbor est appeléé un **Artefact**. 
-</WRAP> 
- 
-===5.5 - Pousser des Images Supplémentaires=== 
- 
-Modifiez le tag de l'image hello-world : 
- 
-<code> 
-root@debian11:~/harbor# docker tag hello-world 10.0.2.45:80/myproject/hello-world:1.0 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/harbor# docker push 10.0.2.45:80/myproject/hello-world:1.0 
-The push refers to repository [10.0.2.45:80/myproject/hello-world] 
-e07ee1baac5f: Layer already exists  
-1.0: digest: sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4 size: 525 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que la valeur du SHA256 est indentique au push précédent. De cette façon Docker n'a pas poussé l'image mais seulement le nouveau tag. 
-</WRAP> 
- 
-Constatez le résultat dans Harbor : 
- 
-{{ :elearning:workbooks:kubernetes:harbor08.png?direct&800 |}} 
- 
-Téléchargez maintenant l'image de **alpine** à partir de docker.io : 
- 
-<code> 
-root@debian11:~/harbor# docker pull alpine 
-Using default tag: latest 
-latest: Pulling from library/alpine 
-c158987b0551: Pull complete  
-Digest: sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4 
-Status: Downloaded newer image for alpine:latest 
-docker.io/library/alpine:latest 
-</code> 
- 
-Modifiez le tag de l'image alpine : 
- 
-<code> 
-root@debian11:~/harbor# docker tag alpine 10.0.2.45:80/myproject/alpine 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/harbor# docker push 10.0.2.45:80/myproject/alpine 
-Using default tag: latest 
-The push refers to repository [10.0.2.45:80/myproject/alpine] 
-ded7a220bb05: Pushed  
-latest: digest: sha256:c0d488a800e4127c334ad20d61d7bc21b4097540327217dfab52262adc02380c size: 528 
-</code> 
- 
-Constatez le résultat dans Harbor : 
- 
-{{ :elearning:workbooks:kubernetes:harbor9.png?direct&800 |}} 
- 
-===5.6 - Travailler avec des Artefacts=== 
- 
-Cliquez sur **Projects > myproject > myproject/hello-world** puis sur le nom de l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor10.png?direct&800 |}} 
- 
-Cliquez ensuite sur le bouton **ADD TAG** et ajoutez le tag **anothertag** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor11.png?direct&800 |}} 
- 
-Sur la ligne 1.0 et dans la colonne **Pull Command**, cliquez sur l'icône : 
- 
-{{ :elearning:workbooks:kubernetes:harbor12.png?direct&800 |}} 
- 
-Revenez à l'interface en ligne de commande et consultez la liste des images :  
- 
-<code> 
-REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE 
-10.0.2.45:80/myproject/alpine        latest    49176f190c7e   2 weeks ago     7.05MB 
-alpine                               latest    49176f190c7e   2 weeks ago     7.05MB 
-goharbor/harbor-exporter             v2.6.2    ae230e335853   4 weeks ago     95.4MB 
-goharbor/chartmuseum-photon          v2.6.2    be361eee8a36   4 weeks ago     225MB 
-goharbor/redis-photon                v2.6.2    84fa3669bb10   4 weeks ago     154MB 
-goharbor/trivy-adapter-photon        v2.6.2    beef2527c7b2   4 weeks ago     441MB 
-goharbor/notary-server-photon        v2.6.2    b43e7c963f06   4 weeks ago     112MB 
-goharbor/notary-signer-photon        v2.6.2    4e9982286316   4 weeks ago     109MB 
-goharbor/harbor-registryctl          v2.6.2    d403d4e0f990   4 weeks ago     137MB 
-goharbor/registry-photon             v2.6.2    596e445b18f0   4 weeks ago     77.5MB 
-goharbor/nginx-photon                v2.6.2    cbbdf28947a5   4 weeks ago     154MB 
-goharbor/harbor-log                  v2.6.2    3ce902023f73   4 weeks ago     161MB 
-goharbor/harbor-jobservice           v2.6.2    05791a75c8b8   4 weeks ago     250MB 
-goharbor/harbor-core                 v2.6.2    484e2a64616d   4 weeks ago     213MB 
-goharbor/harbor-portal               v2.6.2    932297030d4e   4 weeks ago     162MB 
-goharbor/harbor-db                   v2.6.2    351b19e366cb   4 weeks ago     225MB 
-goharbor/prepare                     v2.6.2    eecc993c7643   4 weeks ago     164MB 
-10.0.2.45:80/myproject/hello-world   1.0       feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/hello-world   latest    feb5d9fea6a5   14 months ago   13.3kB 
-hello-world                          latest    feb5d9fea6a5   14 months ago   13.3kB 
-</code> 
- 
-Supprimez l'image **10.0.2.45:80/myproject/hello-world:1.0** : 
- 
-<code> 
-root@debian11:~/harbor# docker image rm 10.0.2.45:80/myproject/hello-world:1.0 
-Untagged: 10.0.2.45:80/myproject/hello-world:1.0 
-</code> 
- 
-Consultez la liste des images de nouveau :  
- 
-<code> 
-root@debian11:~/harbor# docker images 
-REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE 
-10.0.2.45:80/myproject/alpine        latest    49176f190c7e   2 weeks ago     7.05MB 
-alpine                               latest    49176f190c7e   2 weeks ago     7.05MB 
-goharbor/harbor-exporter             v2.6.2    ae230e335853   4 weeks ago     95.4MB 
-goharbor/chartmuseum-photon          v2.6.2    be361eee8a36   4 weeks ago     225MB 
-goharbor/redis-photon                v2.6.2    84fa3669bb10   4 weeks ago     154MB 
-goharbor/trivy-adapter-photon        v2.6.2    beef2527c7b2   4 weeks ago     441MB 
-goharbor/notary-server-photon        v2.6.2    b43e7c963f06   4 weeks ago     112MB 
-goharbor/notary-signer-photon        v2.6.2    4e9982286316   4 weeks ago     109MB 
-goharbor/harbor-registryctl          v2.6.2    d403d4e0f990   4 weeks ago     137MB 
-goharbor/registry-photon             v2.6.2    596e445b18f0   4 weeks ago     77.5MB 
-goharbor/nginx-photon                v2.6.2    cbbdf28947a5   4 weeks ago     154MB 
-goharbor/harbor-log                  v2.6.2    3ce902023f73   4 weeks ago     161MB 
-goharbor/harbor-jobservice           v2.6.2    05791a75c8b8   4 weeks ago     250MB 
-goharbor/harbor-core                 v2.6.2    484e2a64616d   4 weeks ago     213MB 
-goharbor/harbor-portal               v2.6.2    932297030d4e   4 weeks ago     162MB 
-goharbor/harbor-db                   v2.6.2    351b19e366cb   4 weeks ago     225MB 
-goharbor/prepare                     v2.6.2    eecc993c7643   4 weeks ago     164MB 
-10.0.2.45:80/myproject/hello-world   latest    feb5d9fea6a5   14 months ago   13.3kB 
-hello-world                          latest    feb5d9fea6a5   14 months ago   13.3kB 
-</code> 
- 
-Téléchargez maintenant l'image de **10.0.2.45:80/myproject/hello-world:1.0** à partir de Harbor : 
- 
-<code> 
-root@debian11:~/harbor# docker pull 10.0.2.45:80/myproject/hello-world:1.0 
-1.0: Pulling from myproject/hello-world 
-Digest: sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4 
-Status: Downloaded newer image for 10.0.2.45:80/myproject/hello-world:1.0 
-10.0.2.45:80/myproject/hello-world:1.0 
-</code>  
- 
-Lister maintenant les images : 
- 
-<code> 
-root@debian11:~/harbor# docker images 
-REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE 
-10.0.2.45:80/myproject/alpine        latest    49176f190c7e   2 weeks ago     7.05MB 
-alpine                               latest    49176f190c7e   2 weeks ago     7.05MB 
-goharbor/harbor-exporter             v2.6.2    ae230e335853   4 weeks ago     95.4MB 
-goharbor/chartmuseum-photon          v2.6.2    be361eee8a36   4 weeks ago     225MB 
-goharbor/redis-photon                v2.6.2    84fa3669bb10   4 weeks ago     154MB 
-goharbor/trivy-adapter-photon        v2.6.2    beef2527c7b2   4 weeks ago     441MB 
-goharbor/notary-server-photon        v2.6.2    b43e7c963f06   4 weeks ago     112MB 
-goharbor/notary-signer-photon        v2.6.2    4e9982286316   4 weeks ago     109MB 
-goharbor/harbor-registryctl          v2.6.2    d403d4e0f990   4 weeks ago     137MB 
-goharbor/registry-photon             v2.6.2    596e445b18f0   4 weeks ago     77.5MB 
-goharbor/nginx-photon                v2.6.2    cbbdf28947a5   4 weeks ago     154MB 
-goharbor/harbor-log                  v2.6.2    3ce902023f73   4 weeks ago     161MB 
-goharbor/harbor-jobservice           v2.6.2    05791a75c8b8   4 weeks ago     250MB 
-goharbor/harbor-core                 v2.6.2    484e2a64616d   4 weeks ago     213MB 
-goharbor/harbor-portal               v2.6.2    932297030d4e   4 weeks ago     162MB 
-goharbor/harbor-db                   v2.6.2    351b19e366cb   4 weeks ago     225MB 
-goharbor/prepare                     v2.6.2    eecc993c7643   4 weeks ago     164MB 
-hello-world                          latest    feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/hello-world   1.0       feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/hello-world   latest    feb5d9fea6a5   14 months ago   13.3kB 
-</code> 
- 
-Modifiez le tag de l'image téléchargée : 
- 
-<code> 
-root@debian11:~/harbor# docker tag hello-world 10.0.2.45:80/myproject/production:latest 
- 
-root@debian11:~/harbor# docker images 
-REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE 
-10.0.2.45:80/myproject/alpine        latest    49176f190c7e   2 weeks ago     7.05MB 
-alpine                               latest    49176f190c7e   2 weeks ago     7.05MB 
-goharbor/harbor-exporter             v2.6.2    ae230e335853   4 weeks ago     95.4MB 
-goharbor/chartmuseum-photon          v2.6.2    be361eee8a36   4 weeks ago     225MB 
-goharbor/redis-photon                v2.6.2    84fa3669bb10   4 weeks ago     154MB 
-goharbor/trivy-adapter-photon        v2.6.2    beef2527c7b2   4 weeks ago     441MB 
-goharbor/notary-server-photon        v2.6.2    b43e7c963f06   4 weeks ago     112MB 
-goharbor/notary-signer-photon        v2.6.2    4e9982286316   4 weeks ago     109MB 
-goharbor/harbor-registryctl          v2.6.2    d403d4e0f990   4 weeks ago     137MB 
-goharbor/registry-photon             v2.6.2    596e445b18f0   4 weeks ago     77.5MB 
-goharbor/nginx-photon                v2.6.2    cbbdf28947a5   4 weeks ago     154MB 
-goharbor/harbor-log                  v2.6.2    3ce902023f73   4 weeks ago     161MB 
-goharbor/harbor-jobservice           v2.6.2    05791a75c8b8   4 weeks ago     250MB 
-goharbor/harbor-core                 v2.6.2    484e2a64616d   4 weeks ago     213MB 
-goharbor/harbor-portal               v2.6.2    932297030d4e   4 weeks ago     162MB 
-goharbor/harbor-db                   v2.6.2    351b19e366cb   4 weeks ago     225MB 
-goharbor/prepare                     v2.6.2    eecc993c7643   4 weeks ago     164MB 
-10.0.2.45:80/myproject/hello-world   1.0       feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/hello-world   latest    feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/production    latest    feb5d9fea6a5   14 months ago   13.3kB 
-hello-world                          latest    feb5d9fea6a5   14 months ago   13.3kB 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/harbor# docker push 10.0.2.45:80/myproject/production:latest 
-The push refers to repository [10.0.2.45:80/myproject/production] 
-e07ee1baac5f: Mounted from myproject/hello-world  
-latest: digest: sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4 size: 525 
-</code> 
- 
-===5.7 - Copier un Artefact d'un Projet vers un autre Projet=== 
- 
-Commencez par créer un autre projet appelé **devtest** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor14.png?direct&800 |}} 
- 
-Cliquez sur **Projects > myproject > myproject/hello-world** et cochez l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor15.png?direct&800 |}} 
- 
-Cliquez ensuite sur **ACTIONS > Copy** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor16.png?direct&800 |}} 
- 
-Renseignez les champs et cliquez sur le bouton **CONFIRM** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor17.png?direct&800 |}} 
- 
-Cliquez sur **Projects > devtest** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor18.png?direct&800 |}} 
- 
-Cliquez ensuite sur **devtest/performancetest** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor19.png?direct&800 |}} 
- 
-===5.8 - Suppression d'un Artefact, d'un Dépôt et d'un Projet=== 
- 
-Sélectionnez l'Artefact puis cliquez sur **ACTIONS > Delete** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor20.png?direct&800 |}} 
- 
-Confirmez la suppression en cliquant sur le bouton **CONFIRM** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor21.png?direct&800 |}} 
- 
-Cliquez sur **devtest** et cochez **devtest/Performancetest** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor22.png?direct&800 |}} 
- 
-Cliquez sur le bouton **DELETE** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor23.png?direct&800 |}} 
- 
-Confirmez la suppression en cliquant sur le bouton **CONFIRM** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor24.png?direct&800 |}} 
- 
-Cliquez sur **Projects** puis cochez **devtest** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor25.png?direct&800 |}} 
- 
-Cliquez sur **ACTION** puis sur **Delete** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor26.png?direct&800 |}} 
- 
-Confirmez la suppression en cliquant sur le bouton **CONFIRM** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor27.png?direct&800 |}} 
- 
-===5.8 - Utilisation de Labels=== 
- 
-Harbor gère des **Labels** ou étiquettes. Ces étiquettes peuvent être globales ou spécifiques à un Projet. Quand une étiquette est spécifique, celle-ci est utilisée pour marquer les Artefacts pour une utilisation spécifique. Les étiguettes globales ne peuvent être gérées que par l'Administrateur de Harbor. 
- 
-Cliquez sur **Labels** dans Harbor : 
- 
-{{ :elearning:workbooks:kubernetes:harbor28.png?direct&800 |}} 
- 
-Cliquez sur **NEW LABEL** et créez les deux étiquettes suivantes : 
- 
-  * **gtested** - global tested 
-  * **gprodready** global production ready 
- 
-{{ :elearning:workbooks:kubernetes:harbor29.png?direct&800 |}} 
- 
-Cliquez sur **Projects > myproject > myproject/hello-world** puis sélectionnez l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor30.png?direct&800 |}} 
- 
-Cliquez sur **ACTIONS** > **Add Labels** puis sélectionnez **gtested** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor31.png?direct&800 |}} 
- 
-Cliquez maintenant sur **myproject > Labels** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor32.png?direct&800 |}} 
- 
-Cliquez ensuite sur **NEW LABEL** et créez ensuite une étiguette spécifique au projet appelé **myproject-deploy** ayant une description **myproject label** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor33.png?direct&800 |}} 
- 
-Cliquez sur **Repositories > myproject/hello-world** et sélectionnez l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor34.png?direct&800 |}} 
- 
-Cliquez sur **ACTIONS** > **Add Labels** et sélectionnez l'étiquette **myproject-deploy** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor35.png?direct&800 |}} 
- 
-Pour visualiser toutes les étiguettes, cliquez sur les 3 points à droite de **gtested** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor36.png?direct&800 |}} 
- 
-Cliquez sur **Projects > NEW PROJECT** et créez le projet **project2** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor37.png?direct&800 |}} 
- 
-Cliquez sur **project2 > Labels > NEW LABEL** et créez l'étiquette **project2label** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor38.png?direct&800 |}} 
- 
-Cliquez sur **Projects > myproject > myproject/alpine** et sélectionnez l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor39.png?direct&800 |}} 
- 
-Cliquez sur **ACTIONS** > **Add Labels** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor40.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que l'étiquette **project2label** n'est pas disponible. 
-</WRAP> 
- 
-===5.9 - Authentification et RBAC=== 
- 
-Cliquez sur **Users** puis sur **NEW USER** et creéz l'utilisateur **user3** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor41.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que pour être valide le mot de passe doit comporter une lettre Majuscule et un chiffre. 
-</WRAP> 
- 
-Sélectionnez l'utilisateur **user3** et cliquez sur le bouton **SET AS ADMIN** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor42.png?direct&800 |}} 
- 
-Cliquez sur **Projects > myproject** puis sur **Members** et **+ USER** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor43.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Pour consulter les privilèges de chaque rôle, cliquez sur **[[https://goharbor.io/docs/2.6.0/administration/managing-users/user-permissions-by-role/|ce lien]]**.  
-</WRAP> 
- 
-Cliquez sur **OK** et sélectionnez l'utilisateur **user3** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor44.png?direct&800 |}} 
- 
-Pour modifier son rôle, cliquez sur **ACTION** et choississez le rôle désiré : 
- 
-{{ :elearning:workbooks:kubernetes:harbor45.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que le bouton **+ GROUP** est grisé. Si un Active Directory ou bien LDAP avait été configuré, Harbor pourrait lire la liste des groupes et n ous permettrait d'ajouter des utilisateurs à un des groupes.  
-</WRAP> 
- 
-===5.10 - Utilisation d'Images Docker Personalisées=== 
- 
-Créez un répertoire nommé myDocker : 
- 
-<code> 
-root@debian11:~/harbor# cd .. 
-root@debian11:~# mkdir ~/myDocker 
-root@debian11:~# cd ~/myDocker 
-root@debian11:~/myDocker#  
-</code> 
- 
-Créez le fichier myEntrypoint.sh : 
- 
-<code> 
-root@debian11:~/myDocker# vi myEntrypoint.sh 
-root@debian11:~/myDocker# cat myEntrypoint.sh 
-#!/bin/bash 
-if [ -z "$myVariable" ]; then 
-        echo "La variable myVariable doit être renseignée" 
-        return 1 
-fi 
- 
-while true; 
-do 
-        echo $1 \($(date +%H:%M:%S)\); 
-        sleep "$myVariable"; 
-done 
-</code> 
- 
-Testez ce script : 
- 
-<code> 
-root@debian11:~/myDocker# myVariable=3 . ./myEntrypoint.sh salut 
-salut (16:12:59) 
-salut (16:13:02) 
-salut (16:13:05) 
-^C 
-root@debian11:~/myDocker#  
-</code> 
- 
-Rendez ce script exécutable : 
- 
-<code> 
-root@debian11:~/myDocker# chmod u+x myEntrypoint.sh  
-</code> 
- 
-Créez maintenant le fichier **Dockerfile** dans le répertoire **~/myDocker** : 
- 
-<code> 
-root@debian11:~/myDocker# cat Dockerfile 
-FROM centos:latest 
-MAINTAINER ittraining "infos@ittraining.io" 
-COPY myEntrypoint.sh /entrypoint.sh 
-ENV myVariable 3 
-ENTRYPOINT ["/entrypoint.sh"] 
-CMD ["mycommand"] 
-</code> 
- 
-Connectez-vous à Harbor : 
- 
-<code> 
-root@debian11:~/myDocker# docker login 10.0.2.45:80 
-Authenticating with existing credentials... 
-WARNING! Your password will be stored unencrypted in /root/.docker/config.json. 
-Configure a credential helper to remove this warning. See 
-https://docs.docker.com/engine/reference/commandline/login/#credentials-store 
- 
-Login Succeeded 
-</code> 
- 
-Générez maintenant l'image : 
- 
-<code> 
-root@debian11:~/myDocker# docker build --tag "10.0.2.45:80/myproject/mydocker:latest" . 
-Sending build context to Docker daemon  3.072kB 
-Step 1/6 : FROM centos:latest 
-latest: Pulling from library/centos 
-a1d0c7532777: Pull complete  
-Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177 
-Status: Downloaded newer image for centos:latest 
- ---> 5d0da3dc9764 
-Step 2/6 : MAINTAINER ittraining "infos@ittraining.io" 
- ---> Running in 7e359420ea95 
-Removing intermediate container 7e359420ea95 
- ---> 7ce8d150d72d 
-Step 3/6 : COPY myEntrypoint.sh /entrypoint.sh 
- ---> c1fda8d1e43c 
-Step 4/6 : ENV myVariable 3 
- ---> Running in edf989144c38 
-Removing intermediate container edf989144c38 
- ---> 628615e7003a 
-Step 5/6 : ENTRYPOINT ["/entrypoint.sh"] 
- ---> Running in 0490b6a50bbc 
-Removing intermediate container 0490b6a50bbc 
- ---> c2ed329815ef 
-Step 6/6 : CMD ["mycommand"] 
- ---> Running in e2ecfea5be53 
-Removing intermediate container e2ecfea5be53 
- ---> ccb27534d7f2 
-Successfully built ccb27534d7f2 
-Successfully tagged 10.0.2.45:80/myproject/mydocker:latest 
- 
-root@debian11:~/myDocker# docker images 
-REPOSITORY                           TAG       IMAGE ID       CREATED         SIZE 
-10.0.2.45:80/myproject/mydocker      latest    ccb27534d7f2   2 minutes ago   231MB 
-10.0.2.45:80/myproject/alpine        latest    49176f190c7e   2 weeks ago     7.05MB 
-alpine                               latest    49176f190c7e   2 weeks ago     7.05MB 
-goharbor/harbor-exporter             v2.6.2    ae230e335853   4 weeks ago     95.4MB 
-goharbor/chartmuseum-photon          v2.6.2    be361eee8a36   4 weeks ago     225MB 
-goharbor/redis-photon                v2.6.2    84fa3669bb10   4 weeks ago     154MB 
-goharbor/trivy-adapter-photon        v2.6.2    beef2527c7b2   4 weeks ago     441MB 
-goharbor/notary-server-photon        v2.6.2    b43e7c963f06   4 weeks ago     112MB 
-goharbor/notary-signer-photon        v2.6.2    4e9982286316   4 weeks ago     109MB 
-goharbor/harbor-registryctl          v2.6.2    d403d4e0f990   4 weeks ago     137MB 
-goharbor/registry-photon             v2.6.2    596e445b18f0   4 weeks ago     77.5MB 
-goharbor/nginx-photon                v2.6.2    cbbdf28947a5   4 weeks ago     154MB 
-goharbor/harbor-log                  v2.6.2    3ce902023f73   4 weeks ago     161MB 
-goharbor/harbor-jobservice           v2.6.2    05791a75c8b8   4 weeks ago     250MB 
-goharbor/harbor-core                 v2.6.2    484e2a64616d   4 weeks ago     213MB 
-goharbor/harbor-portal               v2.6.2    932297030d4e   4 weeks ago     162MB 
-goharbor/harbor-db                   v2.6.2    351b19e366cb   4 weeks ago     225MB 
-goharbor/prepare                     v2.6.2    eecc993c7643   4 weeks ago     164MB 
-10.0.2.45:80/myproject/production    latest    feb5d9fea6a5   14 months ago   13.3kB 
-hello-world                          latest    feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/hello-world   1.0       feb5d9fea6a5   14 months ago   13.3kB 
-10.0.2.45:80/myproject/hello-world   latest    feb5d9fea6a5   14 months ago   13.3kB 
-centos                               latest    5d0da3dc9764   15 months ago   231MB 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:latest 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Pushed  
-74ddd0ec08fa: Pushed  
-latest: digest: sha256:323ab8f05733ac369963b338bb8fe81bd5cb2d77b46ac3650b7924e7da3aa9cf size: 736 
-</code> 
- 
-Retournez à l'interface de Harbor et cliquez sur **Projects > myproject** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor46.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que le dépôt **myproject/mydocker** a été créé.  
-</WRAP> 
- 
-Cliquez sur **myproject/mydocker** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor47.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que l'Artefact est présent et qu'il possède un tag **latest**.  
-</WRAP> 
- 
-Refaites un  build de l'image en changant le tag : 
- 
-<code> 
-root@debian11:~/myDocker# docker build --tag "10.0.2.45:80/myproject/mydocker:rel1" . 
-Sending build context to Docker daemon  3.072kB 
-Step 1/6 : FROM centos:latest 
- ---> 5d0da3dc9764 
-Step 2/6 : MAINTAINER ittraining "infos@ittraining.io" 
- ---> Using cache 
- ---> 7ce8d150d72d 
-Step 3/6 : COPY myEntrypoint.sh /entrypoint.sh 
- ---> Using cache 
- ---> c1fda8d1e43c 
-Step 4/6 : ENV myVariable 3 
- ---> Using cache 
- ---> 628615e7003a 
-Step 5/6 : ENTRYPOINT ["/entrypoint.sh"] 
- ---> Using cache 
- ---> c2ed329815ef 
-Step 6/6 : CMD ["mycommand"] 
- ---> Using cache 
- ---> ccb27534d7f2 
-Successfully built ccb27534d7f2 
-Successfully tagged 10.0.2.45:80/myproject/mydocker:rel1 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez l'utilisation des images intermédiares issues du cache.  
-</WRAP> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:rel1 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Layer already exists  
-74ddd0ec08fa: Layer already exists  
-rel1: digest: sha256:323ab8f05733ac369963b338bb8fe81bd5cb2d77b46ac3650b7924e7da3aa9cf size: 736 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que seul le nouveau tag a été poussé.  
-</WRAP> 
- 
-Editez le Dockerfile et changez la valeur de **myVariable** de 3 à **5** : 
- 
-<code> 
-root@debian11:~/myDocker# vi Dockerfile  
-root@debian11:~/myDocker# cat Dockerfile  
-FROM centos:latest 
-MAINTAINER ittraining "infos@ittraining.io" 
-COPY myEntrypoint.sh /entrypoint.sh 
-ENV myVariable 5  
-ENTRYPOINT ["/entrypoint.sh"] 
-CMD ["mycommand"] 
-</code> 
- 
-Compilez de nouveau l'image : 
- 
-<code> 
-root@debian11:~/myDocker# docker build --tag "10.0.2.45:80/myproject/mydocker:rel2" . 
-Sending build context to Docker daemon  3.072kB 
-Step 1/6 : FROM centos:latest 
- ---> 5d0da3dc9764 
-Step 2/6 : MAINTAINER ittraining "infos@ittraining.io" 
- ---> Using cache 
- ---> 7ce8d150d72d 
-Step 3/6 : COPY myEntrypoint.sh /entrypoint.sh 
- ---> Using cache 
- ---> c1fda8d1e43c 
-Step 4/6 : ENV myVariable 5 
- ---> Running in c90f60beee6f 
-Removing intermediate container c90f60beee6f 
- ---> d9a704d55c69 
-Step 5/6 : ENTRYPOINT ["/entrypoint.sh"] 
- ---> Running in 8aabb88b172d 
-Removing intermediate container 8aabb88b172d 
- ---> 6ca7239b3489 
-Step 6/6 : CMD ["mycommand"] 
- ---> Running in 8e1bd939a7c2 
-Removing intermediate container 8e1bd939a7c2 
- ---> 9a12b543b94b 
-Successfully built 9a12b543b94b 
-Successfully tagged 10.0.2.45:80/myproject/mydocker:rel2 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:rel2 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Layer already exists  
-74ddd0ec08fa: Layer already exists  
-rel2: digest: sha256:b918acd244c70cf528d8e96584d8d34099d2a8eefc1edd86ba972dd975934f52 size: 736 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que la valeur du SHA256 de rel2 est différente - **b918acd244c70cf528d8e96584d8d34099d2a8eefc1edd86ba972dd975934f52** par rapport à **323ab8f05733ac369963b338bb8fe81bd5cb2d77b46ac3650b7924e7da3aa9cf**.  
-</WRAP> 
- 
-De ce fait un nouvel Artefact a été créé : 
- 
-{{ :elearning:workbooks:kubernetes:harbor48.png?direct&800 |}} 
- 
-Editez le Dockerfile et changez la valeur de **CMD** de "mycommand" à **"mycommand modified"** : 
- 
-<code> 
-root@debian11:~/myDocker# cat Dockerfile  
-FROM centos:latest 
-MAINTAINER ittraining "infos@ittraining.io" 
-COPY myEntrypoint.sh /entrypoint.sh 
-ENV myVariable 5  
-ENTRYPOINT ["/entrypoint.sh"] 
-CMD ["mycommand modified"] 
-</code> 
- 
-Compilez de nouveau l'image en utilisant le même tag qu'avant : 
- 
-<code> 
-root@debian11:~/myDocker# docker build --tag "10.0.2.45:80/myproject/mydocker:rel2" . 
-Sending build context to Docker daemon  3.072kB 
-Step 1/6 : FROM centos:latest 
- ---> 5d0da3dc9764 
-Step 2/6 : MAINTAINER ittraining "infos@ittraining.io" 
- ---> Using cache 
- ---> 7ce8d150d72d 
-Step 3/6 : COPY myEntrypoint.sh /entrypoint.sh 
- ---> Using cache 
- ---> c1fda8d1e43c 
-Step 4/6 : ENV myVariable 5 
- ---> Using cache 
- ---> d9a704d55c69 
-Step 5/6 : ENTRYPOINT ["/entrypoint.sh"] 
- ---> Using cache 
- ---> 6ca7239b3489 
-Step 6/6 : CMD ["mycommand modified"] 
- ---> Running in ac174f91145b 
-Removing intermediate container ac174f91145b 
- ---> 56cc6362dc99 
-Successfully built 56cc6362dc99 
-Successfully tagged 10.0.2.45:80/myproject/mydocker:rel2 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:rel2 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Layer already exists  
-74ddd0ec08fa: Layer already exists  
-rel2: digest: sha256:fcf710f98e14ac3df4d3cf365f04423da8ceb42325eca9efe87f67082904728e size: 736 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que la valeur du SHA256 de rel2 est différente - **fcf710f98e14ac3df4d3cf365f04423da8ceb42325eca9efe87f67082904728e** par rapport à **b918acd244c70cf528d8e96584d8d34099d2a8eefc1edd86ba972dd975934f52**. Par contre, puisque le même tag a été utilisé, le tag **rel2** a été attribué au dernier Artefact créé et le même tag a été supprimé de l'Artefact dont le SHA256 est **b918acd244c70cf528d8e96584d8d34099d2a8eefc1edd86ba972dd975934f52** 
-</WRAP> 
- 
-===5.11 - Rétention de Tags=== 
- 
-Pour gérer ce comportement, il est possible de créer des règles. Cliquez sur **myproject > Policy** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor50.png?direct&800 |}} 
- 
-Cliquez sur **ADD RULE** et remplissez le formulaire ainsi : 
- 
-{{ :elearning:workbooks:kubernetes:harbor51.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Cette règle s'appliquera à tous les dépôts et concernera tous les tags. La règle retiendra les 2 Artefacts les plus recemment poussés vers le dépôt. 
-</WRAP> 
- 
-Cliquez sur **EDIT** sur la ligne **Schedule** et choisissez **hourly** puis cliquez **Save** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor52.png?direct&800 |}} 
- 
-Cliquez sur **OK** dans la boîte d'avertissement : 
- 
-{{ :elearning:workbooks:kubernetes:harbor53.png?direct&800 |}} 
- 
-Cliquez ensuite sur le bouton **DRY RUN**. Quand le Dry Run a terminé avec le message **Success**, cliquez sur le bouton **Expand** du Dry Run : 
- 
-{{ :elearning:workbooks:kubernetes:harbor54.png?direct&800 |}} 
- 
-Sur la dernière ligne, cliquez sur le bouton **Log** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor56.png?direct&800 |}} 
- 
-Consultez la colonne **Retention** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor57.png?direct&800 |}} 
- 
-Revenez dans l'interface de Harbor et exécutez la règle en cliquant sur le bouton **RUN NOW**, puis cliquez sur **RUN** dans la boîte d'avertissement : 
- 
-{{ :elearning:workbooks:kubernetes:harbor58.png?direct&800 |}} 
- 
-Editez de nouveau le Dockerfile et changez la valeur de **myVariable** de 5 à **10** : 
- 
-<code> 
-root@debian11:~/myDocker# vi Dockerfile  
-root@debian11:~/myDocker# cat Dockerfile  
-FROM centos:latest 
-MAINTAINER ittraining "infos@ittraining.io" 
-COPY myEntrypoint.sh /entrypoint.sh 
-ENV myVariable 10  
-ENTRYPOINT ["/entrypoint.sh"] 
-CMD ["mycommand"] 
-</code> 
- 
-Compilez de nouveau l'image : 
- 
-<code> 
-root@debian11:~/myDocker# docker build --tag "10.0.2.45:80/myproject/mydocker:rel3" . 
-Sending build context to Docker daemon  3.072kB 
-Step 1/6 : FROM centos:latest 
- ---> 5d0da3dc9764 
-Step 2/6 : MAINTAINER ittraining "infos@ittraining.io" 
- ---> Using cache 
- ---> 7ce8d150d72d 
-Step 3/6 : COPY myEntrypoint.sh /entrypoint.sh 
- ---> Using cache 
- ---> c1fda8d1e43c 
-Step 4/6 : ENV myVariable 10 
- ---> Running in 7c938717175f 
-Removing intermediate container 7c938717175f 
- ---> ef07118050c5 
-Step 5/6 : ENTRYPOINT ["/entrypoint.sh"] 
- ---> Running in b2dc04a9363d 
-Removing intermediate container b2dc04a9363d 
- ---> f73a3c2f7930 
-Step 6/6 : CMD ["mycommand modified"] 
- ---> Running in fd7a8952dd7f 
-Removing intermediate container fd7a8952dd7f 
- ---> 3bbe34d8d430 
-Successfully built 3bbe34d8d430 
-Successfully tagged 10.0.2.45:80/myproject/mydocker:rel3 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:rel3 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Layer already exists  
-74ddd0ec08fa: Layer already exists  
-rel3: digest: sha256:ae649a586f5d9dcae71440bf88eb98d95c3cc86d40f27eb54fa68e65869c3b48 size: 736 
-</code> 
- 
-Exécutez la règle : 
- 
-{{ :elearning:workbooks:kubernetes:harbor60.png?direct&800 |}} 
- 
-Constatez la liste des Artefacts dans **mydocker** : 
- 
-{{ :elearning:workbooks:kubernetes:harbour61.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que c'est l'Artefact le plus ancien qui a été supprimé. 
-</WRAP> 
- 
-===5.12 - Immutabilité des Tags=== 
- 
-Cliquez sur **myproject > Policy > TAG IMMUTABILITY** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor62.png?direct&800 |}} 
- 
-Cliquez maintenant sur le bouton **ADD RULE** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor63.png?direct&800 |}} 
- 
-Cliquez sur le bouton **ADD** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor64.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Cette règle s'appliquera à tous les dépôts et concernera tous les tags. 
-</WRAP> 
- 
-Essayez de faire un push de l'image **mydocker:rel2** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:rel2 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Layer already exists  
-74ddd0ec08fa: Layer already exists  
-unknown: Failed to process request due to 'mydocker:rel2' configured as immutable. 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez qu'il n'est pas possible de faire un push car la règle d'immutabilité l'interdit. 
-</WRAP> 
- 
-Editez le Dockerfile et changez la valeur de **myVariable** de 10 à **8** : 
- 
-<code> 
-root@debian11:~/myDocker# vi Dockerfile  
-root@debian11:~/myDocker# cat Dockerfile  
-FROM centos:latest 
-MAINTAINER ittraining "infos@ittraining.io" 
-COPY myEntrypoint.sh /entrypoint.sh 
-ENV myVariable 8  
-ENTRYPOINT ["/entrypoint.sh"] 
-CMD ["mycommand"] 
-</code> 
- 
-Faites un build de **mydocker:rel4** : 
- 
-<code> 
-root@debian11:~/myDocker# docker build --tag "10.0.2.45:80/myproject/mydocker:rel4" . 
-Sending build context to Docker daemon  3.072kB 
-Step 1/6 : FROM centos:latest 
- ---> 5d0da3dc9764 
-Step 2/6 : MAINTAINER ittraining "infos@ittraining.io" 
- ---> Using cache 
- ---> 7ce8d150d72d 
-Step 3/6 : COPY myEntrypoint.sh /entrypoint.sh 
- ---> Using cache 
- ---> c1fda8d1e43c 
-Step 4/6 : ENV myVariable 8 
- ---> Running in 541758cf561f 
-Removing intermediate container 541758cf561f 
- ---> 45f622ff8362 
-Step 5/6 : ENTRYPOINT ["/entrypoint.sh"] 
- ---> Running in 9d309f201613 
-Removing intermediate container 9d309f201613 
- ---> 749b47fe344a 
-Step 6/6 : CMD ["mycommand modified"] 
- ---> Running in e7397e408526 
-Removing intermediate container e7397e408526 
- ---> 85f1cbc19cee 
-Successfully built 85f1cbc19cee 
-Successfully tagged 10.0.2.45:80/myproject/mydocker:rel4 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:rel4 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Layer already exists  
-74ddd0ec08fa: Layer already exists  
-rel4: digest: sha256:ae649a586f5d9dcae71440bf88eb98d95c3cc86d40f27eb54fa68e65869c3b48 size: 736 
-</code> 
- 
-<WRAP center round important 60%> 
-**Important** : Notez qu'il est possible de faire un push car le tag rel4 n'existait pas. 
-</WRAP> 
- 
-Dans l'interface de Harbor, cliquez sur **Projects > myproject > myproject/mydocker** et cochez **rel2** : 
- 
-{{ :elearning:workbooks:kubernetes:harbor65.png?direct&800 |}} 
- 
-Essayez de supprimer l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor66.png?direct&800 |}} 
- 
-Notez l'erreur : 
- 
-{{ :elearning:workbooks:kubernetes:harbor67.png?direct&800 |}} 
- 
-Pour pouvoir supprimer l'Artefact, il faut désactiver la règle d'immutabilité : 
- 
-{{ :elearning:workbooks:kubernetes:harbor68.png?direct&800 |}} 
- 
-Maintenant, essayez de supprimer l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor69.png?direct&800 |}} 
- 
-Vous verrez que la suppression a réussi : 
- 
-{{ :elearning:workbooks:kubernetes:harbor70.png?direct&800 |}} 
- 
-Editez le Dockerfile et changez la valeur de **myVariable** de 8 à **7** : 
- 
-<code> 
-root@debian11:~/myDocker# vi Dockerfile  
-root@debian11:~/myDocker# cat Dockerfile  
-FROM centos:latest 
-MAINTAINER ittraining "infos@ittraining.io" 
-COPY myEntrypoint.sh /entrypoint.sh 
-ENV myVariable 7  
-ENTRYPOINT ["/entrypoint.sh"] 
-CMD ["mycommand"] 
-</code> 
- 
-Faites un build de **mydocker:rel5** : 
- 
-<code> 
-root@debian11:~/myDocker# docker build --tag "10.0.2.45:80/myproject/mydocker:rel5" . 
-Sending build context to Docker daemon  3.072kB 
-Step 1/6 : FROM centos:latest 
- ---> 5d0da3dc9764 
-Step 2/6 : MAINTAINER ittraining "infos@ittraining.io" 
- ---> Using cache 
- ---> 7ce8d150d72d 
-Step 3/6 : COPY myEntrypoint.sh /entrypoint.sh 
- ---> Using cache 
- ---> c1fda8d1e43c 
-Step 4/6 : ENV myVariable 7 
- ---> Running in b2153c9b0781 
-Removing intermediate container b2153c9b0781 
- ---> 3b18a7da4503 
-Step 5/6 : ENTRYPOINT ["/entrypoint.sh"] 
- ---> Running in 81b97d9082ed 
-Removing intermediate container 81b97d9082ed 
- ---> c283e1e64dca 
-Step 6/6 : CMD ["mycommand modified"] 
- ---> Running in 7252818184fc 
-Removing intermediate container 7252818184fc 
- ---> f9466edbe1f3 
-Successfully built f9466edbe1f3 
-Successfully tagged 10.0.2.45:80/myproject/mydocker:rel5 
-</code> 
- 
-Procédez maintenant au **push** : 
- 
-<code> 
-root@debian11:~/myDocker# docker push 10.0.2.45:80/myproject/mydocker:rel5 
-The push refers to repository [10.0.2.45:80/myproject/mydocker] 
-7c7558b01004: Layer already exists  
-74ddd0ec08fa: Layer already exists  
-rel5: digest: sha256:887e7751d8a7271b238f536327c38a867881a9c354ff54d9ab5db45502a160d7 size: 736 
-</code> 
- 
-Pour pouvoir supprimer l'Artefact, il faut désactiver la règle d'immutabilité : 
- 
-{{ :elearning:workbooks:kubernetes:harbor68.png?direct&800 |}} 
- 
-Maintenant, essayez de supprimer l'Artefact : 
- 
-{{ :elearning:workbooks:kubernetes:harbor69.png?direct&800 |}} 
- 
-Vous verrez que la suppression a réussi : 
- 
-{{ :elearning:workbooks:kubernetes:harbor70.png?direct&800 |}} 
- 
-Retournez dans Harbor et modifier la règle d'immutabilité en ne spécifiant que le tag **rel3** puis activez cette règle : 
- 
-{{ :elearning:workbooks:kubernetes:harbor71.png?direct&800 |}} 
- 
-Rappelez-vous que la règle de Rétention de Tags ne garde que les deux Artefacts les plus récents : 
- 
-{{ :elearning:workbooks:kubernetes:harbor72.png?direct&800 |}} 
- 
-Procédez à un Dry Run de la règle de Rétention de Tags et consultez le log de mydocker : 
- 
-{{ :elearning:workbooks:kubernetes:harbor73.png?direct&800 |}} 
- 
-<WRAP center round important 60%> 
-**Important** : Notez que la règle d'immutabilité empêche la règle de rétention des tags de supprimer l'Artefact **rel3**. 
-</WRAP> 
  
 ----- -----
 Copyright © 2024 Hugh Norris Copyright © 2024 Hugh Norris
Menu