add-kubernetes-section (#4)
All checks were successful
continuous-integration/drone/push Build is passing
Co-authored-by: JF D <jean-francois.daguin@sharingcloud.com> Reviewed-on: jf/SavaneWiki#4
24
docs/Kubernetes/2024-10-04-kubernetes-pense-bete.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "Pense-bête Kubernetes"
|
||||
summary: "Trucs et astuces pour Kubernetes"
|
||||
author:
|
||||
- JF
|
||||
date: 2024-10-04
|
||||
---
|
||||
# Pense-bête Kubernetes
|
||||
|
||||
* `kubectl api-resources` pour obtenir les APIversion des objets utilisables.
|
||||
|
||||
* Avoir les logs selon un label. Exemple de `app=stateless-flask` : ` kubectl -n stateless-flask logs -l app=stateless-flask`
|
||||
|
||||
* Accéder à un pod : ` kubectl -n stateless-flask exec -ti < Pod name > -- pwd`
|
||||
|
||||
* Exposer temporairement un pod ou un déploiement : `kubectl -n stateless-flask port -forward pods/< Pod name > 9000:5000`
|
||||
|
||||
* Suivre (watch) une commande grâce à l'agument -w : `kubectl get svc -w`
|
||||
|
||||
* Obtenir les classes de stockage disponibles: `kubectl get storageclasses`
|
||||
|
||||
* Récupérer une info d'un objet dans la CLI, jsonpath : `kubectl get pods -l app=stateful-flask -o jsonpath='{.items[0].metadata.name}'`
|
||||
|
||||
* Adapter le nombre de replica-sets à la volée : `kubectl scale deployment deploymentName --replicas=N`
|
||||
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |