Create a new namespace
kubectl create namespace NOM_NAMESPACE_A_CREER
Get resources from a namespace
kubectl get namespace|pods|service|deployment|logs --namespace NAMESPACE_CIBLE
Get resources from ALL namespaces
kubectl get namespace|pods|service|deployment --all-namespaces
Apply a yaml file
kubectl apply --namespace NAMESPACE_CIBLE -f FICHIER_YAML
kubectl version
Détail par noeud :
kubectl get nodes
Permet de tester le fonctionnement d'un pod sans ingress ou service.
kubectl port-forward PODID LOCALPORT:CONTAINERPORT
kubectl exec -it PODID COMMAND
Lancer un shell 'sh' dans le pod 'monsuperpod':
kubectl exec -it monsuperpod sh
kubectl cp PODID:FILEPATH LOCALTARGETFILEPATH
kubectl cp LOCALFILEPATH PODID:TARGETFILEPATH
ex:
kubectl cp monpod:/log/last.txt /tmp/last.txt
kubectl cp ./config.txt monpod:/tmp/new-config.txt