K8
Kubernetes
Contents
kubectl
Nützliche kubectl Kommandos
Default namespace setzen
kubectl config set-context minikube --namespace=mynamespace
Netzwerk image aufstarten mit bash
kubectl run my-shell --rm -it --image amouat/network-utils -- bash
https://hub.docker.com/r/amouat/network-utils/
Auf Container verbinden
kubectl exec -it <pod-name> -- /bin/sh
Reverse Proxy zu einem pod erstellen
kubectl port-forward <podname> 8000:80
YAML Samples
Einfaches Deployment
apiVersion: apps/v1 kind: Deployment metadata: name: web spec: selector: matchLabels: app: web template: metadata: labels: app: web spec: containers: - name: web image: nginx
kustomize
YAML Files generieren (in stdout)
kubectl kustomize ./kostomize
Apply kustomize
kubectl apply -k ./kustomize/