cheat sheet (EXAMPLE)
This is an example cheat sheet, feel free to customize for your own needs by opening
[Link] with Inkscape.
Installation & Configuration Troubleshooting
installs zkubectl,
pip3 install -U stups zkubectl get deploy
might need "sudo" get all my application pods
stups configure [Link]
zkubectl get pods -l application=APP_NAME
put in ~/.bashrc
see status and
reason
source <(zkubectl completion bash) zkubectl describe pod POD_NAME (e.g. OOM killed
)
put in ~/.zsh
rc
source <(zkubectl completion zsh) zkubectl get pod POD_NAME -o yaml
st clusters..
zkubectl top pod POD_NAME --containers
Cluster Login tail my app logs
zkubectl logs -f [-c CONTAINER_NAME] POD_NAME
zkubectl list shows all available clusters zkubectl logtail REGEX_PATTERN [-s TIME]
(or check [Link])
only works in te
zkubectl list-clusters
writes ~/.kube/config zkubectl exec -it POD_NAME [-c CONTAINER_NAME] sh
zkubectl login CLUSTER_ALIAS
zkubectl cluster-info zkubectl port-forward POD_NAME [LOCAL_PORT:]PORT
open Kubernetes Dashboard in browser
zkubectl dashboard does my svc have endpoints?
Architecture
zkubectl describe svc SVC_NAME
ALB configured via Ingress ALB configured?
zkubectl describe ingress INGRESS_NAME
zkubectl
makes my fan
spin
zkubectl opsview
ELB Skipper
Emergency/Manual Access & Cluster Updates
service container
only for prod
apiserver zkubectl emergency-access -i INC-1234 REASON
pod
scheduler zkubectl manual-access REASON
kubelet zkubectl list-access-requests
master node worker node zkubectl approve-manual-access USERNAME
zkubectl cluster-update status
zkubectl cluster-update block|unblock
Bootstrapping Deployment Configurations in case of emergency: prevent cluster updates
Resource Types
zkubectl init [DIR] [--from-senza=SENZA_YAML_PATH]
create [Link] and deploy/apply/*
configmaps cm
in current folder or DIR (empty or from existing Senza def)
deployments deploy
echo "pw" | zkubectl encrypt endpoints ep
events ev
encrypt "pw" for usage in Kubernetes secret horizontalpodautoscalers hpa
ingresses ing
jobs
limitranges limits
Running in Production namespaces ns
nodes no
statefulsets for databases etc
Always run at least two replicas to survive cluster updates.
pods po
better three replicasets rs
Always set CPU/memory requests.
Always set memory limit. cronjob to store DB passwords
Use Downwards API and MEM_TOTAL_KB to set JVM max heap. secrets and other credentials
serviceaccount sa
Use readinessProbe. services svc
to only get traffic when healthy
thirdpartyresources Zalando specific:
platformcredentialssets declare needed
OAuth tokens/clients
Creating/Updating Resources
Documentation & Help
only in test
zkubectl apply -f [Link]
use the search!
[Link]
zkubectl scale deploy DEPLOY_NAME --replicas=10 [Link] community channels
my-kubernetes-users@[Link] official support
zkubectl edit deploy DEPLOY_NAME
clusters
#Kubernetes Users HipChat room my-support@[Link]
opens editor to change YAML
Kubernetes Cheat Sheet v1.0, 2018-06-08
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.