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
This commit was merged in pull request #4.
This commit is contained in:
jf
2024-10-04 14:27:06 +02:00
parent ff2087950f
commit 39e13c7946
16 changed files with 33 additions and 7 deletions

View 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`

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB