Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:kubernetes:k8s02 [2022/09/04 11:44] – removed admin | elearning:workbooks:kubernetes:k8s02 [2024/12/15 06:47] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ~~PDF: | ||
+ | |||
+ | Version - **2024.01** | ||
+ | |||
+ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
+ | |||
+ | ======DOF303 - Les Commandes kubectl, krew et kustomize====== | ||
+ | |||
+ | =====Contenu du Module===== | ||
+ | |||
+ | * **DOF303 - Les Commandes kubectl, krew et kustomize** | ||
+ | * Contenu du Module | ||
+ | * LAB #1 - Utilisation de la Commande kubectl | ||
+ | * 1.1 - Obtenir de l'Aide sur les Commandes de kubectl | ||
+ | * 1.2 - Obtenir de l' | ||
+ | * La Commande version | ||
+ | * La Commande cluster-info | ||
+ | * La Commande api-versions | ||
+ | * La Commande api-resources | ||
+ | * 1.3 - Obtenir de l' | ||
+ | * La Commande describe node | ||
+ | * La Commande top | ||
+ | * 1.4 - Obtenir de l' | ||
+ | * 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.2 - Consultation de la liste des plugins | ||
+ | * 2.3 - Installation et utilisation de plugins | ||
+ | * 2.4 - Mise à jour et suppression de plugins | ||
+ | * LAB #3 - Gestion des patchs avec la Commande kustomize | ||
+ | |||
+ | =====Ressources===== | ||
+ | |||
+ | ====Lab #1===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | ====Lab #2==== | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | ====Lab #3==== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | |||
+ | =====LAB #1 - Utilisation de la Commande kubectl===== | ||
+ | |||
+ | ====1.1 - Obtenir de l'Aide sur les Commandes de kubectl==== | ||
+ | |||
+ | Les commandes de **kubectl** sont regroupées par catégorie : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | kubectl controls the Kubernetes cluster manager. | ||
+ | |||
+ | Find more information at: https:// | ||
+ | |||
+ | Basic Commands (Beginner): | ||
+ | create | ||
+ | expose | ||
+ | run Run a particular image on the cluster | ||
+ | set Set specific features on objects | ||
+ | |||
+ | Basic Commands (Intermediate): | ||
+ | explain | ||
+ | get | ||
+ | edit Edit a resource on the server | ||
+ | delete | ||
+ | |||
+ | Deploy Commands: | ||
+ | rollout | ||
+ | scale Set a new size for a deployment, replica set, or replication controller | ||
+ | autoscale | ||
+ | |||
+ | Cluster Management Commands: | ||
+ | certificate | ||
+ | cluster-info | ||
+ | top | ||
+ | cordon | ||
+ | uncordon | ||
+ | drain Drain node in preparation for maintenance | ||
+ | taint | ||
+ | |||
+ | Troubleshooting and Debugging Commands: | ||
+ | describe | ||
+ | logs Print the logs for a container in a pod | ||
+ | attach | ||
+ | exec Execute a command in a container | ||
+ | port-forward | ||
+ | proxy Run a proxy to the Kubernetes API server | ||
+ | cp Copy files and directories to and from containers | ||
+ | auth Inspect authorization | ||
+ | debug | ||
+ | |||
+ | Advanced Commands: | ||
+ | diff Diff the live version against a would-be applied version | ||
+ | apply Apply a configuration to a resource by file name or stdin | ||
+ | patch | ||
+ | replace | ||
+ | wait Experimental: | ||
+ | kustomize | ||
+ | |||
+ | Settings Commands: | ||
+ | label | ||
+ | annotate | ||
+ | completion | ||
+ | |||
+ | Other Commands: | ||
+ | alpha | ||
+ | api-resources | ||
+ | api-versions | ||
+ | config | ||
+ | plugin | ||
+ | version | ||
+ | |||
+ | Usage: | ||
+ | kubectl [flags] [options] | ||
+ | |||
+ | Use " | ||
+ | Use " | ||
+ | </ | ||
+ | |||
+ | Plus d' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | 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 | ||
+ | clusterrolebinding | ||
+ | configmap | ||
+ | cronjob | ||
+ | deployment | ||
+ | ingress | ||
+ | job | ||
+ | namespace | ||
+ | poddisruptionbudget | ||
+ | priorityclass | ||
+ | quota | ||
+ | role Create a role with single rule | ||
+ | rolebinding | ||
+ | secret | ||
+ | service | ||
+ | serviceaccount | ||
+ | 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=' | ||
+ | Must be " | ||
+ | sending it. If server strategy, submit server-side request without persisting the resource. | ||
+ | |||
+ | --edit=false: | ||
+ | Edit the API resource before creating | ||
+ | |||
+ | --field-manager=' | ||
+ | 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, | ||
+ | jsonpath-as-json, | ||
+ | |||
+ | --raw='': | ||
+ | Raw URI to POST to the server. | ||
+ | |||
+ | -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 ' | ||
+ | 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, | ||
+ | is golang templates [http:// | ||
+ | |||
+ | --validate=' | ||
+ | Must be one of: strict (or true), warn, ignore (or false). | ||
+ | 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 about unknown or duplicate fields without blocking the request if server-side field validation is enabled | ||
+ | on the API server, and behave as " | ||
+ | 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 " | ||
+ | Use " | ||
+ | </ | ||
+ | |||
+ | Dernièrement les commandes kubectl peuvent recevoir des options. Pour visualiser les options qui peuvent être passées à toutes les commandes kubectl, saisissez la commande suivante : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | The following options can be passed to any command: | ||
+ | |||
+ | --add-dir-header=false: | ||
+ | If true, adds the file directory to the header of the log messages (DEPRECATED: | ||
+ | release, see | ||
+ | https:// | ||
+ | |||
+ | --alsologtostderr=false: | ||
+ | log to standard error as well as files (no effect when -logtostderr=true) (DEPRECATED: | ||
+ | future release, see | ||
+ | https:// | ||
+ | |||
+ | --as='': | ||
+ | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | ||
+ | |||
+ | --as-group=[]: | ||
+ | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | ||
+ | |||
+ | --as-uid='': | ||
+ | UID to impersonate for the operation. | ||
+ | |||
+ | --cache-dir='/ | ||
+ | Default cache directory | ||
+ | |||
+ | --certificate-authority='': | ||
+ | Path to a cert file for the certificate authority | ||
+ | |||
+ | --client-certificate='': | ||
+ | Path to a client certificate file for TLS | ||
+ | |||
+ | --client-key='': | ||
+ | Path to a client key file for TLS | ||
+ | |||
+ | --cluster='': | ||
+ | The name of the kubeconfig cluster to use | ||
+ | |||
+ | --context='': | ||
+ | The name of the kubeconfig context to use | ||
+ | |||
+ | --insecure-skip-tls-verify=false: | ||
+ | If true, the server' | ||
+ | insecure | ||
+ | |||
+ | --kubeconfig='': | ||
+ | Path to the kubeconfig file to use for CLI requests. | ||
+ | |||
+ | --log-backtrace-at=: | ||
+ | when logging hits line file:N, emit a stack trace (DEPRECATED: | ||
+ | https:// | ||
+ | |||
+ | --log-dir='': | ||
+ | If non-empty, write log files in this directory (no effect when -logtostderr=true) (DEPRECATED: | ||
+ | removed in a future release, see | ||
+ | https:// | ||
+ | |||
+ | --log-file='': | ||
+ | If non-empty, use this log file (no effect when -logtostderr=true) (DEPRECATED: | ||
+ | release, see | ||
+ | https:// | ||
+ | |||
+ | --log-file-max-size=1800: | ||
+ | Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the | ||
+ | value is 0, the maximum file size is unlimited. (DEPRECATED: | ||
+ | https:// | ||
+ | |||
+ | --log-flush-frequency=5s: | ||
+ | Maximum number of seconds between log flushes | ||
+ | |||
+ | --logtostderr=true: | ||
+ | log to standard error instead of files (DEPRECATED: | ||
+ | https:// | ||
+ | |||
+ | --match-server-version=false: | ||
+ | Require server version to match client version | ||
+ | |||
+ | -n, --namespace='': | ||
+ | If present, the namespace scope for this CLI request | ||
+ | |||
+ | --one-output=false: | ||
+ | If true, only write logs to their native severity level (vs also writing to each lower severity level; no | ||
+ | effect when -logtostderr=true) (DEPRECATED: | ||
+ | https:// | ||
+ | |||
+ | --password='': | ||
+ | Password for basic authentication to the API server | ||
+ | |||
+ | --profile=' | ||
+ | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex) | ||
+ | |||
+ | --profile-output=' | ||
+ | Name of the file to write the profile to | ||
+ | |||
+ | --request-timeout=' | ||
+ | The length of time to wait before giving up on a single server request. Non-zero values should contain a | ||
+ | corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | ||
+ | |||
+ | -s, --server='': | ||
+ | The address and port of the Kubernetes API server | ||
+ | |||
+ | --skip-headers=false: | ||
+ | If true, avoid header prefixes in the log messages (DEPRECATED: | ||
+ | https:// | ||
+ | |||
+ | --skip-log-headers=false: | ||
+ | If true, avoid headers when opening log files (no effect when -logtostderr=true) (DEPRECATED: | ||
+ | in a future release, see | ||
+ | https:// | ||
+ | |||
+ | --stderrthreshold=2: | ||
+ | logs at or above this threshold go to stderr when writing to files and stderr (no effect when | ||
+ | -logtostderr=true or -alsologtostderr=false) (DEPRECATED: | ||
+ | https:// | ||
+ | |||
+ | --tls-server-name='': | ||
+ | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the | ||
+ | server is used | ||
+ | |||
+ | --token='': | ||
+ | Bearer token for authentication to the API server | ||
+ | |||
+ | --user='': | ||
+ | The name of the kubeconfig user to use | ||
+ | |||
+ | --username='': | ||
+ | Username for basic authentication to the API server | ||
+ | |||
+ | -v, --v=0: | ||
+ | number for the log level verbosity | ||
+ | |||
+ | --vmodule=: | ||
+ | comma-separated list of pattern=N settings for file-filtered logging | ||
+ | |||
+ | --warnings-as-errors=false: | ||
+ | Treat warnings received from the server as errors and exit with a non-zero exit code | ||
+ | </ | ||
+ | |||
+ | ====1.2 - Obtenir de l' | ||
+ | |||
+ | ===La Commande version=== | ||
+ | |||
+ | Commencez par obtenir l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Flag --short has been deprecated, and will be removed in the future. The --short output will become the default. | ||
+ | Client Version: v1.25.0 | ||
+ | Kustomize Version: v4.5.7 | ||
+ | Server Version: v1.25.0 | ||
+ | </ | ||
+ | |||
+ | ===La Commande cluster-info=== | ||
+ | |||
+ | Consultez ensuite les informations concernant le cluster : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Kubernetes control plane is running at https:// | ||
+ | CoreDNS is running at https:// | ||
+ | |||
+ | To further debug and diagnose cluster problems, use ' | ||
+ | </ | ||
+ | |||
+ | ===La Commande api-versions=== | ||
+ | |||
+ | Afin de connaître les versions des API compatibles avec la version de Kubernetes installée, exécutez la commande **api-versions** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | admissionregistration.k8s.io/ | ||
+ | apiextensions.k8s.io/ | ||
+ | apiregistration.k8s.io/ | ||
+ | apps/v1 | ||
+ | authentication.k8s.io/ | ||
+ | authorization.k8s.io/ | ||
+ | autoscaling/ | ||
+ | autoscaling/ | ||
+ | autoscaling/ | ||
+ | batch/v1 | ||
+ | certificates.k8s.io/ | ||
+ | coordination.k8s.io/ | ||
+ | crd.projectcalico.org/ | ||
+ | discovery.k8s.io/ | ||
+ | events.k8s.io/ | ||
+ | flowcontrol.apiserver.k8s.io/ | ||
+ | flowcontrol.apiserver.k8s.io/ | ||
+ | networking.k8s.io/ | ||
+ | node.k8s.io/ | ||
+ | policy/v1 | ||
+ | rbac.authorization.k8s.io/ | ||
+ | scheduling.k8s.io/ | ||
+ | storage.k8s.io/ | ||
+ | storage.k8s.io/ | ||
+ | v1 | ||
+ | </ | ||
+ | |||
+ | ===La Commande api-resources=== | ||
+ | |||
+ | La commande **api-resources** permet de consulter la liste des ressources du cluster, à savoir : | ||
+ | |||
+ | * le nom de la ressource - **NAME**, | ||
+ | * le nom court à utiliser avec kubectl - **SHORTNAMES**, | ||
+ | * le groupe API auquel la ressource appartient - **APIVERSION**, | ||
+ | * si oui ou non la ressource est liée à un namespace - **NAMESPACED**, | ||
+ | * le type KIND de la ressource - **KIND**. | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME SHORTNAMES | ||
+ | bindings | ||
+ | componentstatuses | ||
+ | configmaps | ||
+ | endpoints | ||
+ | events | ||
+ | limitranges | ||
+ | namespaces | ||
+ | nodes | ||
+ | persistentvolumeclaims | ||
+ | persistentvolumes | ||
+ | pods po | ||
+ | podtemplates | ||
+ | replicationcontrollers | ||
+ | resourcequotas | ||
+ | secrets | ||
+ | serviceaccounts | ||
+ | services | ||
+ | mutatingwebhookconfigurations | ||
+ | validatingwebhookconfigurations | ||
+ | customresourcedefinitions | ||
+ | apiservices | ||
+ | controllerrevisions | ||
+ | daemonsets | ||
+ | deployments | ||
+ | replicasets | ||
+ | statefulsets | ||
+ | tokenreviews | ||
+ | localsubjectaccessreviews | ||
+ | selfsubjectaccessreviews | ||
+ | selfsubjectrulesreviews | ||
+ | subjectaccessreviews | ||
+ | horizontalpodautoscalers | ||
+ | cronjobs | ||
+ | jobs | ||
+ | certificatesigningrequests | ||
+ | leases | ||
+ | bgpconfigurations | ||
+ | bgppeers | ||
+ | blockaffinities | ||
+ | caliconodestatuses | ||
+ | clusterinformations | ||
+ | felixconfigurations | ||
+ | globalnetworkpolicies | ||
+ | globalnetworksets | ||
+ | hostendpoints | ||
+ | ipamblocks | ||
+ | ipamconfigs | ||
+ | ipamhandles | ||
+ | ippools | ||
+ | ipreservations | ||
+ | kubecontrollersconfigurations | ||
+ | networkpolicies | ||
+ | networksets | ||
+ | endpointslices | ||
+ | events | ||
+ | flowschemas | ||
+ | prioritylevelconfigurations | ||
+ | ingressclasses | ||
+ | ingresses | ||
+ | networkpolicies | ||
+ | runtimeclasses | ||
+ | poddisruptionbudgets | ||
+ | clusterrolebindings | ||
+ | clusterroles | ||
+ | rolebindings | ||
+ | roles rbac.authorization.k8s.io/ | ||
+ | priorityclasses | ||
+ | csidrivers | ||
+ | csinodes | ||
+ | csistoragecapacities | ||
+ | storageclasses | ||
+ | volumeattachments | ||
+ | </ | ||
+ | |||
+ | ====1.3 - Obtenir de l' | ||
+ | |||
+ | ===La Commande describe node=== | ||
+ | |||
+ | De l' | ||
+ | |||
+ | * la section **Labels: | ||
+ | * la ligne **Unschedulable: | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Name: | ||
+ | Roles: | ||
+ | Labels: | ||
+ | beta.kubernetes.io/ | ||
+ | kubernetes.io/ | ||
+ | kubernetes.io/ | ||
+ | kubernetes.io/ | ||
+ | node-role.kubernetes.io/ | ||
+ | node.kubernetes.io/ | ||
+ | Annotations: | ||
+ | node.alpha.kubernetes.io/ | ||
+ | projectcalico.org/ | ||
+ | projectcalico.org/ | ||
+ | volumes.kubernetes.io/ | ||
+ | CreationTimestamp: | ||
+ | Taints: | ||
+ | Unschedulable: | ||
+ | Lease: | ||
+ | HolderIdentity: | ||
+ | AcquireTime: | ||
+ | RenewTime: | ||
+ | Conditions: | ||
+ | Type | ||
+ | ---- | ||
+ | NetworkUnavailable | ||
+ | MemoryPressure | ||
+ | DiskPressure | ||
+ | PIDPressure | ||
+ | Ready True Sun, 04 Sep 2022 16:52:48 +0200 Sun, 04 Sep 2022 12:15:32 +0200 | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | Dans la deuxième partie de la sortie, on peut constater : | ||
+ | |||
+ | * la section **Addresses: | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | Addresses: | ||
+ | InternalIP: | ||
+ | Hostname: | ||
+ | Capacity: | ||
+ | cpu: 4 | ||
+ | ephemeral-storage: | ||
+ | hugepages-2Mi: | ||
+ | memory: | ||
+ | pods: 110 | ||
+ | Allocatable: | ||
+ | cpu: 4 | ||
+ | ephemeral-storage: | ||
+ | hugepages-2Mi: | ||
+ | memory: | ||
+ | pods: 110 | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | Dans la troisième partie de la sortie, on peut constater : | ||
+ | |||
+ | * la section **System Info:** contenant de l' | ||
+ | * la section **Non-terminated Pods** contenant de l' | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | System Info: | ||
+ | Machine ID: | ||
+ | System UUID: 68639C3A-D77A-4C61-B7E8-4F4F70419B8A | ||
+ | Boot ID: 9bd56aa5-b94c-40d3-804a-a54bd8daf305 | ||
+ | Kernel Version: | ||
+ | OS Image: | ||
+ | Operating System: | ||
+ | Architecture: | ||
+ | Container Runtime Version: | ||
+ | Kubelet Version: | ||
+ | Kube-Proxy Version: | ||
+ | PodCIDR: | ||
+ | PodCIDRs: | ||
+ | Non-terminated Pods: (7 in total) | ||
+ | Namespace | ||
+ | --------- | ||
+ | kube-system | ||
+ | kube-system | ||
+ | kube-system | ||
+ | kube-system | ||
+ | kube-system | ||
+ | kube-system | ||
+ | kube-system | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | Dans la dernière partie de la sortie, on peut constater : | ||
+ | |||
+ | * la section **Allocated resources: | ||
+ | |||
+ | < | ||
+ | Allocated resources: | ||
+ | (Total limits may be over 100 percent, i.e., overcommitted.) | ||
+ | Resource | ||
+ | -------- | ||
+ | cpu 1 (25%) 0 (0%) | ||
+ | memory | ||
+ | ephemeral-storage | ||
+ | hugepages-2Mi | ||
+ | Events: | ||
+ | Type Reason | ||
+ | ---- ------ | ||
+ | Normal | ||
+ | </ | ||
+ | |||
+ | ===La Commande top=== | ||
+ | |||
+ | La commande **top** nécessite à ce que l'API **Metrics** soit disponible dans le cluster. Pour déployer le serveur Metrics, téléchargez le fichier **components.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | Modifiez la section **containers** du fichier **components.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | ... | ||
+ | spec: | ||
+ | containers: | ||
+ | - args: | ||
+ | - --cert-dir=/ | ||
+ | - --secure-port=4443 | ||
+ | - --kubelet-insecure-tls | ||
+ | - --kubelet-preferred-address-types=InternalIP, | ||
+ | - --kubelet-use-node-status-port | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | Déployez le serveur Metrics : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | serviceaccount/ | ||
+ | clusterrole.rbac.authorization.k8s.io/ | ||
+ | clusterrole.rbac.authorization.k8s.io/ | ||
+ | rolebinding.rbac.authorization.k8s.io/ | ||
+ | clusterrolebinding.rbac.authorization.k8s.io/ | ||
+ | clusterrolebinding.rbac.authorization.k8s.io/ | ||
+ | service/ | ||
+ | deployment.apps/ | ||
+ | apiservice.apiregistration.k8s.io/ | ||
+ | </ | ||
+ | |||
+ | Vérifiez l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAMESPACE | ||
+ | default | ||
+ | kube-system | ||
+ | kube-system | ||
+ | kube-system | ||
+ | </ | ||
+ | |||
+ | Pour connaître l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME CPU(cores) | ||
+ | kubemaster.ittraining.loc | ||
+ | kubenode1.ittraining.loc | ||
+ | kubenode2.ittraining.loc | ||
+ | </ | ||
+ | |||
+ | Pour voir l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Every 2,0s: kubectl top nodes kubemaster.ittraining.loc: | ||
+ | |||
+ | NAME CPU(cores) | ||
+ | kubemaster.ittraining.loc | ||
+ | kubenode1.ittraining.loc | ||
+ | kubenode2.ittraining.loc | ||
+ | ... | ||
+ | ^C | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : Notez l' | ||
+ | </ | ||
+ | |||
+ | Il est possible de trier la sortie par ordre décroissant de l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME CPU(cores) | ||
+ | kubemaster.ittraining.loc | ||
+ | kubenode1.ittraining.loc | ||
+ | kubenode2.ittraining.loc | ||
+ | </ | ||
+ | |||
+ | Dernièrement, | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME CPU(cores) | ||
+ | kubemaster.ittraining.loc | ||
+ | kubenode1.ittraining.loc | ||
+ | kubenode2.ittraining.loc | ||
+ | </ | ||
+ | |||
+ | ====1.4 - Obtenir de l' | ||
+ | |||
+ | ===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** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Name: | ||
+ | Namespace: | ||
+ | Priority: | ||
+ | Service Account: | ||
+ | Node: | ||
+ | Start Time: Sun, 04 Sep 2022 13:23:12 +0200 | ||
+ | Labels: | ||
+ | pod-template-hash=689f9d59 | ||
+ | type=front-end | ||
+ | Annotations: | ||
+ | cni.projectcalico.org/ | ||
+ | cni.projectcalico.org/ | ||
+ | Status: | ||
+ | IP: | ||
+ | IPs: | ||
+ | IP: | ||
+ | Controlled By: ReplicaSet/ | ||
+ | Containers: | ||
+ | nginx-container: | ||
+ | Container ID: | ||
+ | Image: | ||
+ | Image ID: | ||
+ | Port: < | ||
+ | Host Port: < | ||
+ | State: | ||
+ | Started: | ||
+ | Ready: | ||
+ | Restart Count: | ||
+ | Environment: | ||
+ | Mounts: | ||
+ | / | ||
+ | Conditions: | ||
+ | Type Status | ||
+ | Initialized | ||
+ | Ready | ||
+ | ContainersReady | ||
+ | PodScheduled | ||
+ | Volumes: | ||
+ | kube-api-access-fjdsw: | ||
+ | Type: Projected (a volume that contains injected data from multiple sources) | ||
+ | TokenExpirationSeconds: | ||
+ | ConfigMapName: | ||
+ | ConfigMapOptional: | ||
+ | DownwardAPI: | ||
+ | QoS Class: | ||
+ | Node-Selectors: | ||
+ | Tolerations: | ||
+ | | ||
+ | Events: | ||
+ | </ | ||
+ | |||
+ | ===La Commande top=== | ||
+ | |||
+ | Il est possible de voir l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME CPU(cores) | ||
+ | myapp-deployment-689f9d59-c25f9 | ||
+ | myapp-deployment-689f9d59-nn9sw | ||
+ | myapp-deployment-689f9d59-rnc4r | ||
+ | </ | ||
+ | |||
+ | Triez maintenant la sortie par ordre décroissant de l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME CPU(cores) | ||
+ | myapp-deployment-689f9d59-c25f9 | ||
+ | myapp-deployment-689f9d59-nn9sw | ||
+ | myapp-deployment-689f9d59-rnc4r | ||
+ | </ | ||
+ | |||
+ | Triez maintenant la sortie par ordre décroissant de l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME CPU(cores) | ||
+ | myapp-deployment-689f9d59-nn9sw | ||
+ | myapp-deployment-689f9d59-rnc4r | ||
+ | myapp-deployment-689f9d59-c25f9 | ||
+ | </ | ||
+ | |||
+ | ====1.5 - Travailler avec la commande kubectl==== | ||
+ | |||
+ | Créez le fichier **pod.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | apiVersion: v1 | ||
+ | kind: Pod | ||
+ | metadata: | ||
+ | name: my-pod | ||
+ | spec: | ||
+ | containers: | ||
+ | - name: busybox | ||
+ | image: radial/ | ||
+ | command: [' | ||
+ | </ | ||
+ | |||
+ | ====La Commande apply==== | ||
+ | |||
+ | Créez maintenant le pod en utilisant le fichier **pod.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | pod/my-pod created | ||
+ | </ | ||
+ | |||
+ | ====La Commande create==== | ||
+ | |||
+ | La commande **create** ne peut être utilisée que dans le cas où un objet du même nom n' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Error from server (AlreadyExists): | ||
+ | </ | ||
+ | |||
+ | Pour consulter la liste des objets qui peuvent être créés, utilisez la commande **kubectl create** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | 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 | ||
+ | clusterrolebinding | ||
+ | configmap | ||
+ | cronjob | ||
+ | deployment | ||
+ | ingress | ||
+ | job | ||
+ | namespace | ||
+ | poddisruptionbudget | ||
+ | priorityclass | ||
+ | quota | ||
+ | role Create a role with single rule | ||
+ | rolebinding | ||
+ | secret | ||
+ | service | ||
+ | serviceaccount | ||
+ | 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=' | ||
+ | Must be " | ||
+ | sending it. If server strategy, submit server-side request without persisting the resource. | ||
+ | |||
+ | --edit=false: | ||
+ | Edit the API resource before creating | ||
+ | |||
+ | --field-manager=' | ||
+ | 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, | ||
+ | jsonpath-as-json, | ||
+ | |||
+ | --raw='': | ||
+ | Raw URI to POST to the server. | ||
+ | |||
+ | -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 ' | ||
+ | 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, | ||
+ | is golang templates [http:// | ||
+ | |||
+ | --validate=' | ||
+ | Must be one of: strict (or true), warn, ignore (or false). | ||
+ | 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 about unknown or duplicate fields without blocking the request if server-side field validation is enabled | ||
+ | on the API server, and behave as " | ||
+ | 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 " | ||
+ | Use " | ||
+ | </ | ||
+ | |||
+ | La commande **apply** est ensuite utilisée pour appliquer des modifications apportées au fichier yaml : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | pod/my-pod unchanged | ||
+ | </ | ||
+ | |||
+ | ====La Commande get==== | ||
+ | |||
+ | Constatez le statut du pod : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME READY | ||
+ | my-pod | ||
+ | myapp-deployment-689f9d59-c25f9 | ||
+ | myapp-deployment-689f9d59-nn9sw | ||
+ | myapp-deployment-689f9d59-rnc4r | ||
+ | </ | ||
+ | |||
+ | Rappelez-vous que vous pouvez utiliser une abréviation pour pods : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME READY | ||
+ | my-pod | ||
+ | myapp-deployment-689f9d59-c25f9 | ||
+ | myapp-deployment-689f9d59-nn9sw | ||
+ | myapp-deployment-689f9d59-rnc4r | ||
+ | </ | ||
+ | |||
+ | Pour ne voir qu'un seul pod, il convient de préciser son nom en tant qu' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME | ||
+ | my-pod | ||
+ | </ | ||
+ | |||
+ | ====Utilisation des Options==== | ||
+ | |||
+ | Rappelez-vous que l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME READY | ||
+ | my-pod | ||
+ | myapp-deployment-689f9d59-c25f9 | ||
+ | myapp-deployment-689f9d59-nn9sw | ||
+ | myapp-deployment-689f9d59-rnc4r | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ": | ||
+ | "while true; do sleep 3600; done\" | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | "while true; do sleep 3600; done" | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | --More-- | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | apiVersion: v1 | ||
+ | items: | ||
+ | - apiVersion: v1 | ||
+ | kind: Pod | ||
+ | metadata: | ||
+ | annotations: | ||
+ | cni.projectcalico.org/ | ||
+ | cni.projectcalico.org/ | ||
+ | cni.projectcalico.org/ | ||
+ | kubectl.kubernetes.io/ | ||
+ | {" | ||
+ | ers": | ||
+ | creationTimestamp: | ||
+ | name: my-pod | ||
+ | namespace: default | ||
+ | resourceVersion: | ||
+ | uid: 628ca9e4-2fbe-4fc9-b0fa-9a05ef942a07 | ||
+ | spec: | ||
+ | containers: | ||
+ | - command: | ||
+ | - sh | ||
+ | - -c | ||
+ | - while true; do sleep 3600; done | ||
+ | image: radial/ | ||
+ | imagePullPolicy: | ||
+ | name: busybox | ||
+ | resources: {} | ||
+ | terminationMessagePath: | ||
+ | terminationMessagePolicy: | ||
+ | volumeMounts: | ||
+ | - mountPath: / | ||
+ | name: kube-api-access-qwzzv | ||
+ | readOnly: true | ||
+ | dnsPolicy: ClusterFirst | ||
+ | enableServiceLinks: | ||
+ | nodeName: kubenode2.ittraining.loc | ||
+ | preemptionPolicy: | ||
+ | priority: 0 | ||
+ | restartPolicy: | ||
+ | --More-- | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME READY | ||
+ | myapp-deployment-689f9d59-c25f9 | ||
+ | myapp-deployment-689f9d59-nn9sw | ||
+ | myapp-deployment-689f9d59-rnc4r | ||
+ | my-pod | ||
+ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME READY | ||
+ | calico-node-5htrc | ||
+ | calico-node-dc7hd | ||
+ | calico-node-qk5kt | ||
+ | </ | ||
+ | |||
+ | ====La Commande exec==== | ||
+ | |||
+ | La commande **exec** permet d' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Hello, world! | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : Notez l' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====5.6 - Commandes Impératives ==== | ||
+ | |||
+ | Avant de poursuivre, supprimez le pod **my-pod** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | pod " | ||
+ | </ | ||
+ | |||
+ | Créez ensuite un deployment avec une commande impérative : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | deployment.apps/ | ||
+ | </ | ||
+ | |||
+ | En exécutant la même commande impérative, | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | W0910 15: | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | creationTimestamp: | ||
+ | labels: | ||
+ | app: my-deployment | ||
+ | name: my-deployment | ||
+ | spec: | ||
+ | replicas: 1 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: my-deployment | ||
+ | strategy: {} | ||
+ | template: | ||
+ | metadata: | ||
+ | creationTimestamp: | ||
+ | labels: | ||
+ | app: my-deployment | ||
+ | spec: | ||
+ | containers: | ||
+ | - image: nginx | ||
+ | name: nginx | ||
+ | resources: {} | ||
+ | status: {} | ||
+ | </ | ||
+ | |||
+ | Ces instructions peuvent ensuite être injectées dans un fichier afin d' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | W0910 15: | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | creationTimestamp: | ||
+ | labels: | ||
+ | app: my-deployment | ||
+ | name: my-deployment | ||
+ | spec: | ||
+ | replicas: 1 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: my-deployment | ||
+ | strategy: {} | ||
+ | template: | ||
+ | metadata: | ||
+ | creationTimestamp: | ||
+ | labels: | ||
+ | app: my-deployment | ||
+ | spec: | ||
+ | containers: | ||
+ | - image: nginx | ||
+ | name: nginx | ||
+ | resources: {} | ||
+ | status: {} | ||
+ | </ | ||
+ | |||
+ | =====LAB #2 - Géstion les plugins de kubectl avec la Commande krew===== | ||
+ | |||
+ | Les plugins de kubectl étendent ses fonctionnalités. Le gestionnaire des plugins **krew** est disponible pour macOS(tm), Windows(tm) et Linux. Un plugin est un simple exécutable écrit, par exemple, en **bash** ou en **Go**. | ||
+ | |||
+ | ====2.1 - Installation de krew==== | ||
+ | |||
+ | Afin d' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | Installez ensuite krew avec la commande suivante : | ||
+ | |||
+ | < | ||
+ | ( | ||
+ | set -x; cd " | ||
+ | curl -fsSLO " | ||
+ | tar zxvf krew-linux_amd64.tar.gz && | ||
+ | KREW=./ | ||
+ | " | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | Vous obtiendrez : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | > set -x; cd " | ||
+ | > curl -fsSLO " | ||
+ | > tar zxvf krew-linux_amd64.tar.gz && | ||
+ | > | ||
+ | > " | ||
+ | > ) | ||
+ | ++ mktemp -d | ||
+ | + cd / | ||
+ | + curl -fsSLO https:// | ||
+ | + tar zxvf krew-linux_amd64.tar.gz | ||
+ | ./LICENSE | ||
+ | ./ | ||
+ | ++ uname | ||
+ | ++ tr ' | ||
+ | ++ uname -m | ||
+ | ++ sed -e s/ | ||
+ | + KREW=./ | ||
+ | + ./ | ||
+ | Adding " | ||
+ | Updated the local copy of plugin index. | ||
+ | Installing plugin: krew | ||
+ | Installed plugin: krew | ||
+ | \ | ||
+ | | Use this plugin: | ||
+ | | ||
+ | | Documentation: | ||
+ | | ||
+ | | Caveats: | ||
+ | | \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Ensuite ajoutez **$HOME/ | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | Afin de ne pas avoir besoin de redéfinir le PATH après chaque ouverture de session, ajoutez la ligne à la fin du fichier **.bashrc** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | ====2.2 - Consultation de la liste des plugins ==== | ||
+ | |||
+ | Mettez à jour la liste des plugins : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Updated the local copy of plugin index. | ||
+ | </ | ||
+ | |||
+ | Pour visualiser la liste des plugins, utiisez la commande **search** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME DESCRIPTION | ||
+ | access-matrix | ||
+ | accurate | ||
+ | advise-policy | ||
+ | advise-psp | ||
+ | allctx | ||
+ | apparmor-manager | ||
+ | assert | ||
+ | auth-proxy | ||
+ | aws-auth | ||
+ | azad-proxy | ||
+ | bd-xray | ||
+ | blame Show who edited resource fields. | ||
+ | bulk-action | ||
+ | ca-cert | ||
+ | capture | ||
+ | cert-manager | ||
+ | change-ns | ||
+ | cilium | ||
+ | cluster-group | ||
+ | clusternet | ||
+ | cm Provides commands for OCM/ | ||
+ | cnpg Manage your CloudNativePG clusters | ||
+ | config-cleanup | ||
+ | config-registry | ||
+ | cost View cluster cost information | ||
+ | creyaml | ||
+ | ctx | ||
+ | custom-cols | ||
+ | cyclonus | ||
+ | datadog | ||
+ | datree | ||
+ | dds | ||
+ | debug-shell | ||
+ | deprecations | ||
+ | df-pv Show disk usage (like unix df) for persistent v... no | ||
+ | direct-csi | ||
+ | directpv | ||
+ | doctor | ||
+ | dtlogin | ||
+ | duck List custom resources with ducktype support | ||
+ | edit-status | ||
+ | eds | ||
+ | eksporter | ||
+ | emit-event | ||
+ | evict-pod | ||
+ | example | ||
+ | exec-as | ||
+ | exec-cronjob | ||
+ | explore | ||
+ | fields | ||
+ | flame | ||
+ | fleet Shows config and resources of a fleet of clusters | ||
+ | flyte | ||
+ | fuzzy Fuzzy and partial string search for kubectl | ||
+ | gadget | ||
+ | get-all | ||
+ | gke-credentials | ||
+ | gopass | ||
+ | graph | ||
+ | grep Filter Kubernetes resources by matching their n... no | ||
+ | gs Handle custom resources with Giant Swarm no | ||
+ | hlf | ||
+ | hns | ||
+ | htpasswd | ||
+ | ice View configuration settings of containers insid... | ||
+ | iexec | ||
+ | images | ||
+ | ingress-nginx | ||
+ | ingress-rule | ||
+ | ipick A kubectl wrapper for interactive resource sele... | ||
+ | istiolog | ||
+ | janitor | ||
+ | kadalu | ||
+ | karbon | ||
+ | karmada | ||
+ | konfig | ||
+ | krew Package manager for kubectl plugins. | ||
+ | kruise | ||
+ | ks Simple management of KubeSphere components | ||
+ | ktop A top tool to display workload metrics | ||
+ | kubesec-scan | ||
+ | kudo Declaratively build, install, and run operators... | ||
+ | kuota-calc | ||
+ | kurt Find what's restarting and why no | ||
+ | kuttl | ||
+ | kyverno | ||
+ | lineage | ||
+ | linstor | ||
+ | liqo Install and manage Liqo on your clusters | ||
+ | log2rbac | ||
+ | match-name | ||
+ | mc Run kubectl commands against multiple clusters ... no | ||
+ | minio | ||
+ | moco Interact with MySQL operator MOCO. no | ||
+ | modify-secret | ||
+ | mtail Tail logs from multiple pods matching label sel... | ||
+ | multiforward | ||
+ | multinet | ||
+ | neat Remove clutter from Kubernetes manifests to mak... | ||
+ | net-forward | ||
+ | node-admin | ||
+ | node-restart | ||
+ | node-shell | ||
+ | np-viewer | ||
+ | ns Switch between Kubernetes namespaces | ||
+ | nsenter | ||
+ | oidc-login | ||
+ | open-svc | ||
+ | openebs | ||
+ | operator | ||
+ | oulogin | ||
+ | outdated | ||
+ | passman | ||
+ | pexec | ||
+ | pod-dive | ||
+ | pod-inspect | ||
+ | pod-lens | ||
+ | pod-logs | ||
+ | pod-shell | ||
+ | podevents | ||
+ | popeye | ||
+ | preflight | ||
+ | print-env | ||
+ | profefe | ||
+ | promdump | ||
+ | prompt | ||
+ | prune-unused | ||
+ | psp-util | ||
+ | pv-migrate | ||
+ | pvmigrate | ||
+ | rabbitmq | ||
+ | rbac-lookup | ||
+ | rbac-tool | ||
+ | rbac-view | ||
+ | realname-diff | ||
+ | reap Delete unused Kubernetes resources. | ||
+ | relay | ||
+ | reliably | ||
+ | rename-pvc | ||
+ | resource-capacity | ||
+ | resource-snapshot | ||
+ | resource-versions | ||
+ | restart | ||
+ | rm-standalone-pods | ||
+ | rolesum | ||
+ | roll Rolling restart of all persistent pods in a nam... | ||
+ | rook-ceph | ||
+ | safe Prompts before running edit commands | ||
+ | schemahero | ||
+ | score | ||
+ | secretdata | ||
+ | service-tree | ||
+ | shovel | ||
+ | sick-pods | ||
+ | skew Find if your cluster/ | ||
+ | slice Split a multi-YAML file into individual files. | ||
+ | snap Delete half of the pods in a namespace or cluster | ||
+ | sniff Start a remote packet capture on pods using tcp... | ||
+ | socks5-proxy | ||
+ | sort-manifests | ||
+ | split-yaml | ||
+ | spy pod debugging tool for kubernetes clusters with... | ||
+ | sql Query the cluster via pseudo-SQL | ||
+ | ssh-jump | ||
+ | sshd Run SSH server in a Pod no | ||
+ | ssm-secret | ||
+ | starboard | ||
+ | status | ||
+ | stern Multi pod and container log tailing | ||
+ | strace | ||
+ | sudo Run Kubernetes commands impersonated as group s... no | ||
+ | support-bundle | ||
+ | switch-config | ||
+ | tail Stream logs from multiple pods and containers u... no | ||
+ | tap | ||
+ | tmux-exec | ||
+ | topology | ||
+ | trace Trace Kubernetes pods and nodes with system tools no | ||
+ | tree Show a tree of object hierarchies through owner... | ||
+ | tunnel | ||
+ | unused-volumes | ||
+ | vela Easily interact with KubeVela | ||
+ | view-allocations | ||
+ | view-cert | ||
+ | view-secret | ||
+ | view-serviceaccount-kubeconfig | ||
+ | view-utilization | ||
+ | view-webhook | ||
+ | viewnode | ||
+ | virt Control KubeVirt virtual machines using virtctl | ||
+ | volsync | ||
+ | vpa-recommendation | ||
+ | warp Sync and execute local files in Pod no | ||
+ | whisper-secret | ||
+ | who-can | ||
+ | whoami | ||
+ | </ | ||
+ | |||
+ | ====2.3 - Installation et utilisation de plugins==== | ||
+ | |||
+ | Installez les plugins **ctx**, **ns**, **view-allocations** et **pod-logs** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Updated the local copy of plugin index. | ||
+ | Installing plugin: ctx | ||
+ | Installed plugin: ctx | ||
+ | \ | ||
+ | | Use this plugin: | ||
+ | | ||
+ | | Documentation: | ||
+ | | ||
+ | | Caveats: | ||
+ | | \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | / | ||
+ | / | ||
+ | WARNING: You installed plugin " | ||
+ | These plugins are not audited for security by the Krew maintainers. | ||
+ | Run them at your own risk. | ||
+ | Installing plugin: ns | ||
+ | Installed plugin: ns | ||
+ | \ | ||
+ | | Use this plugin: | ||
+ | | ||
+ | | Documentation: | ||
+ | | ||
+ | | Caveats: | ||
+ | | \ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | / | ||
+ | / | ||
+ | WARNING: You installed plugin " | ||
+ | These plugins are not audited for security by the Krew maintainers. | ||
+ | Run them at your own risk. | ||
+ | Installing plugin: view-allocations | ||
+ | Installed plugin: view-allocations | ||
+ | \ | ||
+ | | Use this plugin: | ||
+ | | ||
+ | | Documentation: | ||
+ | | ||
+ | / | ||
+ | WARNING: You installed plugin " | ||
+ | These plugins are not audited for security by the Krew maintainers. | ||
+ | Run them at your own risk. | ||
+ | Installing plugin: pod-logs | ||
+ | Installed plugin: pod-logs | ||
+ | \ | ||
+ | | Use this plugin: | ||
+ | | ||
+ | | Documentation: | ||
+ | | ||
+ | / | ||
+ | WARNING: You installed plugin " | ||
+ | These plugins are not audited for security by the Krew maintainers. | ||
+ | Run them at your own risk. | ||
+ | </ | ||
+ | |||
+ | Le plugin **ctx** permet de basculer entre les **contextes** facilement. Un contexte est un élément qui regroupe les paramètres d' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | kubernetes-admin@kubernetes | ||
+ | </ | ||
+ | |||
+ | Le plugin **ns** permet de basculer entre les **namespaces** facilement. | ||
+ | |||
+ | Les Namespaces : | ||
+ | |||
+ | * peuvent être considérées comme des clusters virtuels, | ||
+ | * permettent l' | ||
+ | * permettent le regroupement d' | ||
+ | * sont utilisés avec des applications, | ||
+ | |||
+ | Listez les namespaces dans le cluster : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | default | ||
+ | kube-node-lease | ||
+ | kube-public | ||
+ | kube-system | ||
+ | </ | ||
+ | |||
+ | Le plugin **view-allocations** permet de visualiser les allocations de ressources telles le CPU, la mémoire, le stockage etc : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | | ||
+ | cpu (13%) 1.6 __ | ||
+ | ├─ kubemaster.ittraining.loc | ||
+ | │ ├─ calico-node-688lw | ||
+ | │ ├─ coredns-6d4b75cb6d-dw4ph | ||
+ | │ ├─ coredns-6d4b75cb6d-ms2jm | ||
+ | │ ├─ etcd-kubemaster.ittraining.loc | ||
+ | │ ├─ kube-apiserver-kubemaster.ittraining.loc | ||
+ | │ ├─ kube-controller-manager-kubemaster.ittraining.loc | ||
+ | │ └─ kube-scheduler-kubemaster.ittraining.loc | ||
+ | ├─ kubenode1.ittraining.loc | ||
+ | │ └─ calico-node-5mrjl | ||
+ | └─ kubenode2.ittraining.loc | ||
+ | | ||
+ | ephemeral-storage | ||
+ | ├─ kubemaster.ittraining.loc | ||
+ | ├─ kubenode1.ittraining.loc | ||
+ | └─ kubenode2.ittraining.loc | ||
+ | memory | ||
+ | ├─ kubemaster.ittraining.loc | ||
+ | │ ├─ coredns-6d4b75cb6d-dw4ph | ||
+ | │ ├─ coredns-6d4b75cb6d-ms2jm | ||
+ | │ └─ etcd-kubemaster.ittraining.loc | ||
+ | ├─ kubenode1.ittraining.loc | ||
+ | └─ kubenode2.ittraining.loc | ||
+ | pods (5%) 17.0 (5%) 17.0 330.0 313.0 | ||
+ | ├─ kubemaster.ittraining.loc | ||
+ | ├─ kubenode1.ittraining.loc | ||
+ | └─ kubenode2.ittraining.loc | ||
+ | </ | ||
+ | |||
+ | Le plugin **pod-logs** vous fourni avec une liste de pods en cours d' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | 1) | ||
+ | 2) | ||
+ | 3) | ||
+ | 4) | ||
+ | 5) | ||
+ | 6) | ||
+ | 7) | ||
+ | 8) | ||
+ | 9) | ||
+ | 10) etcd-kubemaster.ittraining.loc | ||
+ | 11) kube-apiserver-kubemaster.ittraining.loc | ||
+ | 12) kube-controller-manager-kubemaster.ittraining.loc | ||
+ | 13) kube-proxy-bwctz | ||
+ | 14) kube-proxy-j89vg | ||
+ | 15) kube-proxy-jx76x | ||
+ | 16) kube-scheduler-kubemaster.ittraining.loc | ||
+ | 17) metrics-server-7cb867d5dc-g55k5 | ||
+ | Select a Pod: | ||
+ | </ | ||
+ | |||
+ | Choisissez le pod **17**. Vous verrez la sortie de la commande logs : | ||
+ | |||
+ | < | ||
+ | Select a Pod: 17 | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | I0713 03: | ||
+ | </ | ||
+ | |||
+ | Pour lister les plugins installés, utilisez la commande **list** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | PLUGIN | ||
+ | ctx | ||
+ | krew v0.4.3 | ||
+ | ns v0.9.4 | ||
+ | pod-logs | ||
+ | view-allocations | ||
+ | </ | ||
+ | |||
+ | ====2.4 - Mise à jour et suppression de plugins==== | ||
+ | |||
+ | Pour mettre à jour les plugins installés, utilisez la commande **upgrade** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | Updated the local copy of plugin index. | ||
+ | Upgrading plugin: ctx | ||
+ | Skipping plugin ctx, it is already on the newest version | ||
+ | Upgrading plugin: krew | ||
+ | Skipping plugin krew, it is already on the newest version | ||
+ | Upgrading plugin: ns | ||
+ | Skipping plugin ns, it is already on the newest version | ||
+ | Upgrading plugin: pod-logs | ||
+ | Skipping plugin pod-logs, it is already on the newest version | ||
+ | Upgrading plugin: view-allocations | ||
+ | Skipping plugin view-allocations, | ||
+ | </ | ||
+ | |||
+ | Pour supprimer un plugin, utilisez la commande **remove** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | |||
+ | Uninstalled plugin: pod-logs | ||
+ | root@kubemaster: | ||
+ | PLUGIN | ||
+ | ctx | ||
+ | krew v0.4.3 | ||
+ | ns v0.9.4 | ||
+ | view-allocations | ||
+ | </ | ||
+ | |||
+ | =====LAB #3 - Géstion des patchs avec la Commande kustomize==== | ||
+ | |||
+ | Commencez par installer l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | Créez ensuite le répertoire **kustomize** contenant le répertoire **base** et placez-vous dans ce dernier : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | Créez le manifest **deployment.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | name: nginx | ||
+ | labels: | ||
+ | app: nginx | ||
+ | spec: | ||
+ | replicas: 1 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: nginx | ||
+ | template: | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | spec: | ||
+ | affinity: | ||
+ | podAntiAffinity: | ||
+ | requiredDuringSchedulingIgnoredDuringExecution: | ||
+ | - labelSelector: | ||
+ | matchExpressions: | ||
+ | - key: app | ||
+ | operator: In | ||
+ | values: | ||
+ | - nginx | ||
+ | topologyKey: | ||
+ | containers: | ||
+ | - image: nginx: | ||
+ | imagePullPolicy: | ||
+ | name: nginx | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** - le contenu de ce fichier crée un **deployment** de 1 **replica** du pod **nginx** à partir de l' | ||
+ | </ | ||
+ | |||
+ | Créez ensuite le manifest **service.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | apiVersion: v1 | ||
+ | kind: Service | ||
+ | metadata: | ||
+ | name: nginx | ||
+ | labels: | ||
+ | app: nginx | ||
+ | spec: | ||
+ | type: ClusterIP | ||
+ | ports: | ||
+ | - port: 80 | ||
+ | protocol: TCP | ||
+ | targetPort: 80 | ||
+ | selector: | ||
+ | app: nginx | ||
+ | </ | ||
+ | |||
+ | <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. | ||
+ | </ | ||
+ | |||
+ | Dernièrement, | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | apiVersion: kustomize.config.k8s.io/ | ||
+ | kind: Kustomization | ||
+ | |||
+ | images: | ||
+ | - name: nginx | ||
+ | newTag: 1.19.1 | ||
+ | |||
+ | resources: | ||
+ | - deployment.yaml | ||
+ | - service.yaml | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** - le contenu de ce fichier contient un **patch** pour l' | ||
+ | </ | ||
+ | |||
+ | Consultez donc l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | . | ||
+ | └── base | ||
+ | ├── deployment.yaml | ||
+ | ├── kustomization.yaml | ||
+ | └── service.yaml | ||
+ | |||
+ | 1 directory, 3 files | ||
+ | </ | ||
+ | |||
+ | Exécutez maintenant la commande **kustomize** pour créer un **patch** pour les fichiers se trouvant dans le répertoire **base** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | apiVersion: v1 | ||
+ | kind: Service | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | name: nginx | ||
+ | spec: | ||
+ | ports: | ||
+ | - port: 80 | ||
+ | protocol: TCP | ||
+ | targetPort: 80 | ||
+ | selector: | ||
+ | app: nginx | ||
+ | type: ClusterIP | ||
+ | --- | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | name: nginx | ||
+ | spec: | ||
+ | replicas: 1 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: nginx | ||
+ | template: | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | spec: | ||
+ | affinity: | ||
+ | podAntiAffinity: | ||
+ | requiredDuringSchedulingIgnoredDuringExecution: | ||
+ | - labelSelector: | ||
+ | matchExpressions: | ||
+ | - key: app | ||
+ | operator: In | ||
+ | values: | ||
+ | - nginx | ||
+ | topologyKey: | ||
+ | containers: | ||
+ | - image: nginx: | ||
+ | imagePullPolicy: | ||
+ | name: nginx | ||
+ | </ | ||
+ | |||
+ | <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' | ||
+ | </ | ||
+ | |||
+ | Imaginons maintenant que vous souhaitez déployer deux environnements **différents** de la même application, | ||
+ | |||
+ | Créez les répertoires **kustomize/ | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | </ | ||
+ | |||
+ | Consultez l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | . | ||
+ | ├── base | ||
+ | │ | ||
+ | │ | ||
+ | │ | ||
+ | └── overlays | ||
+ | ├── development | ||
+ | └── production | ||
+ | |||
+ | 4 directories, | ||
+ | </ | ||
+ | |||
+ | Créez le fichier **dev_kustomization.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | apiVersion: kustomize.config.k8s.io/ | ||
+ | kind: Kustomization | ||
+ | |||
+ | bases: | ||
+ | - ../ | ||
+ | |||
+ | nameSuffix: -development # < | ||
+ | |||
+ | commonLabels: | ||
+ | environment: | ||
+ | |||
+ | namespace: nginx-dev # < | ||
+ | </ | ||
+ | |||
+ | Appliquez ces modifications : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | apiVersion: v1 | ||
+ | kind: Service | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | name: nginx-development # < | ||
+ | namespace: nginx-dev # < | ||
+ | spec: | ||
+ | ports: | ||
+ | - port: 80 | ||
+ | protocol: TCP | ||
+ | targetPort: 80 | ||
+ | selector: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | type: ClusterIP | ||
+ | --- | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | name: nginx-development | ||
+ | namespace: nginx-dev | ||
+ | spec: | ||
+ | replicas: 1 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | template: | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | spec: | ||
+ | affinity: | ||
+ | podAntiAffinity: | ||
+ | requiredDuringSchedulingIgnoredDuringExecution: | ||
+ | - labelSelector: | ||
+ | matchExpressions: | ||
+ | - key: app | ||
+ | operator: In | ||
+ | values: | ||
+ | - nginx | ||
+ | topologyKey: | ||
+ | containers: | ||
+ | - image: nginx: | ||
+ | imagePullPolicy: | ||
+ | name: nginx | ||
+ | </ | ||
+ | |||
+ | Maintenant créez le fichier **prod_kustomization.yaml** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | root@kubemaster: | ||
+ | apiVersion: kustomize.config.k8s.io/ | ||
+ | kind: Kustomization | ||
+ | |||
+ | bases: | ||
+ | - ../../base # < | ||
+ | |||
+ | nameSuffix: -production # < | ||
+ | |||
+ | commonLabels: | ||
+ | environment: | ||
+ | |||
+ | namespace: nginx-prod # < | ||
+ | |||
+ | images: | ||
+ | - name: nginx | ||
+ | newTag: 1.19.2 # < | ||
+ | </ | ||
+ | |||
+ | Appliquez ces modifications : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | apiVersion: v1 | ||
+ | kind: Service | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | name: nginx-production # < | ||
+ | namespace: nginx-prod # < | ||
+ | spec: | ||
+ | ports: | ||
+ | - port: 80 | ||
+ | protocol: TCP | ||
+ | targetPort: 80 | ||
+ | selector: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | type: ClusterIP | ||
+ | --- | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | name: nginx-production | ||
+ | namespace: nginx-prod | ||
+ | spec: | ||
+ | replicas: 1 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | template: | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: nginx | ||
+ | environment: | ||
+ | spec: | ||
+ | affinity: | ||
+ | podAntiAffinity: | ||
+ | requiredDuringSchedulingIgnoredDuringExecution: | ||
+ | - labelSelector: | ||
+ | matchExpressions: | ||
+ | - key: app | ||
+ | operator: In | ||
+ | values: | ||
+ | - nginx | ||
+ | topologyKey: | ||
+ | containers: | ||
+ | - image: nginx: | ||
+ | imagePullPolicy: | ||
+ | name: nginx | ||
+ | </ | ||
+ | |||
+ | Créez maintenant le namespace **nginx-prod** : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | namespace/ | ||
+ | </ | ||
+ | |||
+ | Installez l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | service/ | ||
+ | deployment.apps/ | ||
+ | </ | ||
+ | |||
+ | Constatez le résultat de l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME READY | ||
+ | nginx-production-75d9486bb9-7xpr6 | ||
+ | |||
+ | root@kubemaster: | ||
+ | NAME | ||
+ | nginx-production | ||
+ | |||
+ | root@kubemaster: | ||
+ | NAME | ||
+ | nginx-production | ||
+ | </ | ||
+ | |||
+ | Supprimez le deployment et le service nginx-production : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | deployment.apps " | ||
+ | |||
+ | root@kubemaster: | ||
+ | No resources found in nginx-prod namespace. | ||
+ | |||
+ | root@kubemaster: | ||
+ | NAME | ||
+ | nginx-production | ||
+ | |||
+ | root@kubemaster: | ||
+ | No resources found in nginx-prod namespace. | ||
+ | |||
+ | root@kubemaster: | ||
+ | service " | ||
+ | |||
+ | root@kubemaster: | ||
+ | No resources found in nginx-prod namespace. | ||
+ | </ | ||
+ | |||
+ | Installez l' | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | namespace/ | ||
+ | root@kubemaster: | ||
+ | service/ | ||
+ | deployment.apps/ | ||
+ | </ | ||
+ | |||
+ | Constatez le résultat : | ||
+ | |||
+ | < | ||
+ | root@kubemaster: | ||
+ | NAME | ||
+ | nginx-development-5f8d7bdd88-fsnc6 | ||
+ | |||
+ | root@kubemaster: | ||
+ | NAME READY | ||
+ | nginx-development | ||
+ | |||
+ | root@kubemaster: | ||
+ | NAME TYPE CLUSTER-IP | ||
+ | nginx-development | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | Copyright © 2024 Hugh Norris | ||