Sei sulla pagina 1di 1

cheat sheet

This is an example cheat sheet, feel free to customize for your own needs by opening
https://github.com/zalando-incubator/kubernetes-on-aws/blob/dev/docs/user-guide/kubernetes-cheat-sheet.svg with Inkscape.

Installation & Conguration Troubleshooting


installs zkubect
l & zdeploy,
pip3 install -U stups zkubectl get deploy
might need "sudo" get all my application pods
stups configure foo.example.org
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

st clusters..
source <(zkubectl completion zsh) zkubectl get pod POD_NAME -o yaml

zkubectl top pod POD_NAME --containers


Cluster Login tail my app logs
zkubectl logs -f [-c CONTAINER_NAME] POD_NAME
shows all available clusters (or check scalyr.com)

only works in te
zkubectl list
zkubectl list-clusters zkubectl exec -it POD_NAME CONTAINER_NAME sh
writes ~/.kube/cong
zkubectl login CLUSTER_ALIAS zkubectl port-forward POD_NAME [LOCAL_PORT:]PORT
zkubectl cluster-info open Kubernetes Dashboard in browser
zkubectl dashboard
does my svc have endpoints?
Architecture
zkubectl describe svc SVC_NAME
ALB congured?
ALB congured via Ingress
zkubectl describe ingress INGRESS_NAME
makes my fan
zkubectl spin
https://kube-ops-view.foo.example.org

ELB Skipper

service container
apiserver
pod
scheduler
kubelet
master node worker node

Bootstrapping Deployment Congurations


create pipeline.yaml, Resource Types
zdeploy init [MYDIR] deployment.yaml and apply/*
in current folder or MYDIR
configmaps cm
echo -n "pw" | base64 | tr -d '\n' | zdeploy encrypt deployments deploy
endpoints ep
encrypt "pw" for data in Kubernetes secret events ev
usage in Kubernetes secret must be base64 encoded horizontalpodautoscalers hpa
ingresses ing
jobs
Running in Production limitranges limits
namespaces ns
nodes no
Always run at least two replicas to survive cluster updates. statefulsets for databases etc
better three pods po
Always set CPU/memory requests. replicasets rs
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. to only get trac when healthy services svc
thirdpartyresources Zalando specic:
platformcredentialssets declare needed
OAuth tokens/clients
Creating/Updating Resources
Documentation & Help
only in test

zkubectl apply -f myresource.yaml


https://kubernetes-on-aws.readthedocs.io/
zkubectl scale deploy DEPLOY_NAME --replicas=10 ask here - after
kubernetes-users@example.com
checking the docs!
zkubectl edit deploy DEPLOY_NAME #Kubernetes Users HipChat room
clusters

opens editor to change YAML


or here
Kubernetes Cheat Sheet v0.5, 2017-03-06
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Potrebbero piacerti anche