tech:notes_kubernetes_k8s_-_outils
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 | ||
| tech:notes_kubernetes_k8s_-_outils [2026/02/05 17:29] – Jean-Baptiste | tech:notes_kubernetes_k8s_-_outils [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Kubernetes k8s - Outils | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | * Octant / Lens | ||
| + | |||
| + | |||
| + | ## Arkade | ||
| + | |||
| + | Gestionnaire de paquets pour installer des outils K8S | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | ## kubectl | ||
| + | |||
| + | Afin d’interagir avec Kubernetes, kubectl - la CLI permettant d' | ||
| + | |||
| + | En outre, pour peu qu'on ait à interagir avec plusieurs clusters, avec différents crédentials, | ||
| + | |||
| + | |||
| + | ## Krew | ||
| + | |||
| + | Krew is the plugin manager for kubectl command-line tool. | ||
| + | |||
| + | Avec asdf (voir aussi mise.run) | ||
| + | ~~~bash | ||
| + | asdf plugin add krew | ||
| + | asdf install krew latest | ||
| + | asdf set --home krew latest | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Kubetail | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | ## kubectx / kubens | ||
| + | |||
| + | Voir : | ||
| + | * `kubectl config` | ||
| + | |||
| + | Permet de changer le contexte courant et le namespace courant | ||
| + | |||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | |||
| + | ~~~bash | ||
| + | apt install kubectx | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | Migrating to Kubectx and Kubens From KUBECONFIG | ||
| + | ~~~bash | ||
| + | # Reference all your config files so Kubectl load them all | ||
| + | $ export KUBECONFIG=~/ | ||
| + | | ||
| + | |||
| + | # Save a merged version of the current config to a new file | ||
| + | $ kubectl config view --flatten > ~/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## kube-ps1 | ||
| + | |||
| + | Permet d' | ||
| + | |||
| + | |||
| + | ## Helm | ||
| + | |||
| + | Templating & package manager | ||
| + | |||
| + | Helm est un package manager pour kubernetes, permettant de déployer facilement des composants sous forme de " | ||
| + | |||
| + | |||
| + | Install | ||
| + | ~~~bash | ||
| + | sudo snap install helm --classic | ||
| + | ~~~ | ||
| + | |||
| + | Dépôts Bitnami : \\ | ||
| + | https:// | ||
| + | |||
| + | Exemple avec OpenEBS | ||
| + | ~~~bash | ||
| + | helm repo add openebs https:// | ||
| + | helm repo update | ||
| + | helm search repo openebs | ||
| + | helm show values openebs/ | ||
| + | |||
| + | kubectl create ns openebs | ||
| + | helm install openebs openebs/ | ||
| + | |||
| + | helm upgrade openebs openebs/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## k9s | ||
| + | |||
| + | ~~~bash | ||
| + | snap install k9s --devmode | ||
| + | ln -s / | ||
| + | ~~~ | ||
| + | |||
| + | ## popeye | ||
| + | |||
| + | ## stern | ||
| + | |||
| + | |||
| + | ## nerdctl | ||
| + | |||
| + | Équivalent de la commande docker / podman / crictl / ctr mais pour ContainerD | ||
| + | |||
| + | |||
| + | Voir [Vidéo Docker vs Containerd: Understanding the Differences and Choosing the Right Containerization Tool](https:// | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## LinkerD | ||
| + | |||
| + | (Conçurent de Istio) | ||
| + | |||
| + | ## Istio | ||
| + | |||
| + | (Conçurent de LinkerD) | ||
| + | |||
| + | |||
| + | ## Kubectl (kubernetes-client) | ||
| + | |||
| + | Install de kubectl | ||
| + | ~~~bash | ||
| + | sudo apt-get install kubernetes-client | ||
| + | ~~~ | ||
| + | |||
| + | ou | ||
| + | ~~~bash | ||
| + | VERSION=$(curl -s https:// | ||
| + | curl -LO https:// | ||
| + | chmod +x ./kubectl | ||
| + | sudo mv ./kubectl / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ### Config | ||
| + | |||
| + | ~~~bash | ||
| + | mkdir $HOME/ | ||
| + | kubectl completion bash >> $HOME/ | ||
| + | ~~~ | ||
| + | |||
| + | ### Conf | ||
| + | |||
| + | `${HOME}/ | ||
| + | ou `$KUBECONFIG` | ||
| + | |||
| + | `~/.bashrc` | ||
| + | ~~~bash | ||
| + | alias k=kubectl | ||
| + | complete -F __start_kubectl k | ||
| + | |||
| + | alias kall=" | ||
| + | alias kapp=" | ||
| + | alias kdel=" | ||
| + | alias ksys=" | ||
| + | |||
| + | kshow() { | ||
| + | kubectl get " | ||
| + | } | ||
| + | |||
| + | alias kports=' | ||
| + | |||
| + | alias kcc=' | ||
| + | alias kg=' | ||
| + | alias kga=' | ||
| + | alias kgp=' | ||
| + | alias kgs=' | ||
| + | |||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ## Dashboard | ||
| + | |||
| + | Voir : | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Remplacé par https:// | ||
| + | |||
| + | |||
| + | ### Installation | ||
| + | |||
| + | ~~~bash | ||
| + | helm upgrade --install kubernetes-dashboard kubernetes-dashboard/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | `dashboard-admin.yaml` | ||
| + | ~~~yaml | ||
| + | apiVersion: v1 | ||
| + | kind: ServiceAccount | ||
| + | metadata: | ||
| + | name: admin-user | ||
| + | namespace: kubernetes-dashboard | ||
| + | --- | ||
| + | apiVersion: rbac.authorization.k8s.io/ | ||
| + | kind: ClusterRoleBinding | ||
| + | metadata: | ||
| + | name: admin-user | ||
| + | roleRef: | ||
| + | apiGroup: rbac.authorization.k8s.io | ||
| + | kind: ClusterRole | ||
| + | name: cluster-admin | ||
| + | subjects: | ||
| + | - kind: ServiceAccount | ||
| + | name: admin-user | ||
| + | namespace: kubernetes-dashboard | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | kubectl apply -f dashboard-admin.yaml | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ### Accès | ||
| + | |||
| + | ~~~bash | ||
| + | kubectl -n kubernetes-dashboard port-forward svc/ | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | # kubectl -n NAMESPACE create token SERVICE_ACCOUNT | ||
| + | kubectl -n kubernetes-dashboard create token admin-user | ||
| + | ~~~ | ||
| + | |||
| + | Source : https:// | ||
| + | |||
| + | |||
| + | Pour avoir les graphiques il faut installer **Metrics-server** | ||
| + | |||
| + | |||
| + | ## Stockage | ||
| + | |||
| + | https:// | ||
| + | |||
| + | |||
| + | ### Old | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | kubectl apply -f https:// | ||
| + | #kubectl delete -f https:// | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | # kubectl proxy | ||
| + | Starting to serve on 127.0.0.1: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Notes WebUI Rancher | ||
| + | |||
| + | ~~~bash | ||
| + | docker run -d --restart=unless-stopped -p 80:80 -p 443:443 rancher/ | ||
| + | ~~~ | ||
| + | |||
| + | |||
