Pod
PODS
is an abstraction of a server
can run multiple container within single namespace, exposed by single IP
only started through Deployment
Init container is an additional container in POD that completes a task before the regular container is started.
Jobs
kubectl create cronjob sleep-job --image=busybox --schedule"*/2 * * * *" --dry-run -o yaml > job.yaml
Namespace
Namespace implements kernel level resource isolation. Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. Read more about namespaces at Kubernetes reference
Deployment
replicas - how many copies
strategy - how Pods should be updated
recreate - all pods killed and new created => temporary unavailability
đ rollingUpdate
selector - how labels are matched agains the Pod
template - Pod specification to create it
labels / selectors / annotations
label -> key/value pair to identify K8s resource
annotation is used to provide additional metadata in object (licenses, maintainer...)
âšī¸ đ kubectl label deployment [name] [key]=[value] âšī¸ kubectl get deployments.apps --show-labels âšī¸ kubectl get deployments.apps --selector [key]=[value]
History
kubectl rollout history deployment [name] kubectl rollout undo deployment [name] --to-revision=1
Patterns
Ambassador
Adapter
Sidecar container
Reloading ConfigMaps when there's a change.
Init container
Last updated