added Don früh
This commit is contained in:
56
k8s/pods
56
k8s/pods
@@ -13,4 +13,58 @@ kubectl run whoami --image bee42/whoami:2.2.0 --expose --port 80
|
||||
kubectl get pod whoami -o yaml
|
||||
|
||||
# kann zur erstellung der YAML genutzt werden.
|
||||
kubectl run whoami2 --image bee42/whoami:2.2.0 --labels=run=whoami --dry-run=client -o yaml >whoami-pod.yaml
|
||||
kubectl run whoami2 --image bee42/whoami:2.2.0 --labels=run=whoami --dry-run=client -o yaml >whoami-pod.yaml
|
||||
|
||||
# Show Labels
|
||||
kubectl get pods --show-labels
|
||||
|
||||
# Test iin Pod
|
||||
kubectl run curl --tty -i --image curlimages/curl -- /bin/sh
|
||||
curl -i http://nginx
|
||||
|
||||
# port weiterleiten
|
||||
kubectl port-forward services/nginx 8091:80 &
|
||||
|
||||
# scale Pods
|
||||
|
||||
kubectl scale deployments/web --replicas=3
|
||||
|
||||
kubectl set image deployment/web nginx=nginx:1.19.4
|
||||
kubectl rollout status -w deployment/web
|
||||
kubectl rollout undo deployment/web
|
||||
kubectl rollout status -w deployment/web
|
||||
kubectl rollout history deployment/web
|
||||
kubectl rollout undo deployment/web --to-revision=1
|
||||
|
||||
# Better annotate replicaset !!
|
||||
kubectl annotate deployment web kubernetes.io/change-cause="Release 1.19.3" --overwrite=true
|
||||
|
||||
#or
|
||||
|
||||
kubectl get rs
|
||||
NAME DESIRED CURRENT READY AGE
|
||||
web-85dfdff5d 0 0 0 28m
|
||||
web-548df7676c 0 0 0 46m
|
||||
web-6f4f87dd45 3 3 3 26m
|
||||
kubectl annotate rs web-6f4f87dd45 kubernetes.io/change-cause="Release 1.19.5" --overwrite=true
|
||||
kubectl rollout history deploy web
|
||||
deployment.apps/web
|
||||
REVISION CHANGE-CAUSE
|
||||
4 <none>
|
||||
5 <none>
|
||||
6 Release 1.19.5
|
||||
# new deployment
|
||||
|
||||
kubectl get rs -o json |jq -r .items[].metadata.annotations.\"deployment.kubernetes.io/revision\"
|
||||
3
|
||||
6
|
||||
5
|
||||
|
||||
|
||||
|
||||
#cat pod.json | kubectl replace -f -
|
||||
#kubectl replace --force -f ./pod.json
|
||||
kubectl get pods
|
||||
kubectl get pod <web pod> -o yaml | sed 's/\(image: nginx\):.*$/\1:1.19.3/' | kubectl replace -f -
|
||||
|
||||
#kubectl get pod web-548df7676c-v48kv -o yaml | sed 's/\(image: nginx\):.*$/\1:1.19.4/' | kubectl replace -f - web-548df7676c-rzp7v
|
||||
Reference in New Issue
Block a user