From cbb2c66c00d0e334121f30ee05d31d6c90f77588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20CHABERNAUD?= Date: Sun, 22 Sep 2019 11:09:47 +0200 Subject: [PATCH] Update kubernetes cheat --- cheats/kubernetes.cheat | 44 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/cheats/kubernetes.cheat b/cheats/kubernetes.cheat index f4dfba3..c4584d2 100644 --- a/cheats/kubernetes.cheat +++ b/cheats/kubernetes.cheat @@ -1,7 +1,43 @@ % kubernetes, k8s -# Edit deployment -kubectl edit deployment +# Print resource documentation +kubectl explain -# Get pods -kubectl get pods +# Get nodes (add option `-o wide` for details) +kubectl get nodes + +# Get namespaces +kubectl get namespaces + +# Get pods from namespace (add option `-o wide` for details) +kubectl get pods -n + +# Get pods from all namespace (add option `-o wide` for details) +kubectl get pods --all-namespaces + +# Get services from namespace +kubectl get services -n + +# Get details from resource on namespace +kubectl describe / -n + +# Print logs from namespace +kubectl logs -f pods/ -n + +# Get deployments +kubectl get deployments -n + +# Edit deployments +kubectl edit deployment/ -n + +# Drain node in preparation for maintenance +kubectl drain + +# Mark node as schedulable +kubectl uncordon + +# Mark node as unschedulable +kubectl cordon + +# Display resource (cpu/memory/storage) usage +kubectl top