-
kubectl run nginx-pod --image=nginx:alpine
-
kubectl run messaging --image=redis:alpine --labels=tier=msg
-
kubectl create namespace apx-x998-ishay
-
kubectl get node -o json > /tmp/nodes-ishay.json
-
kubectl expose pod messaging --port=6379 --name=messaging-service
-
kubectl create service clusterip messaging-service --tcp=6379 --dry-run=client -o yaml > messaging-service.yaml
-
kubectl create deployment hr-web-app --image odekloud/webapp-color --replicas 2
-
kubectl run static-busybox --image=busybox -o yaml --command -- sleep 1000 --dry-run=client > /etc/kubernetes/manifests/static-busybox.yaml
-
kubectl create ns finance-ishay
kubectl -n finance-ishay run temp-bus --image redis:alpine
-
Stored as pv-analytics.yaml
-
Stored as redis-storage-ishay.yaml
-
??
-
Using nginx-deploy.yaml
kubectl create -f nginx-deploy.yaml --record
kubectl set image deploy nginx-deploy nginx=nginx:1.17 --record
kubectl rollout history deploy nginx-deploy
15.-
kubectl get pods --show-labels
-
kubectl run nginx-dev1 --image nginx --labels=env=dev
kubectl run nginx-dev2 --image nginx --labels=env=dev
kubectl run nginx-dev3 --image nginx --labels=env=dev
kubectl run nginx-prod1 —-image nginx --labels=env=prod
kubectl run nginx-prod2 —-image nginx --labels=env=prod
-
kubectl get pod —-show-labels
-
kubectl get pod -l env=dev
-
kubectl get pods -l env=dev --show-labels
-
kubectl get pod -l env=prod
-
kubectl get pod -l env=prod —show-labels
-
kubectl get pod -L env
-
kubectl get pod -l 'env in (dev,prod)'
-
kubectl get pod -l 'env in (dev,prod)' --show-labels
-
kubectl label pod/nginx-dev1 env=uat --overwrite
kubectl get pod —show-labels
-
kubectl label pod nginx-dev{1..3} env-
kubectl label pod nginx-prod{1..2} env-
kubectl get pod --show-labels
-
kubectl label pod nginx-dev{1..3} app=nginx
kubectl label pod nginx-prod{1..2} app=nginx
kubectl get po --show-labels
-
kubectl get nodes --show-labels
-
kubectl label node worker nodeName=nginx-node
-
kubectl create -f pod-nginx.yaml
-
kubectl describe po nginx | grep Node-Selector
-
kubectl describe po nginx | grep Labels
-
kubectl create -f webapp.yaml
-
kubectl rollout status deployment webapp
-
kubectl get rs -l app=webapp
-
kubectl get rs -l app=webapp -o yaml > webapp-rs.yaml
kubectl get pods -l app=webapp -o yaml > webapp-pods.yaml
-
kubectl delete deployment webapp
-
kubectl create -f webapp2.yaml
-
kubectl set image deployment webapp nginx=nginx:1.17.4
kubectl describe deployment webapp | grep -i image
-
kubectl rollout history deployment webapp
-
kubectl rollout undo deployment webapp
kubectl describe deployment webapp | grep -i image
-
kubectl set image deployment webapp nginx=nginx:1.100
kubectl rollout status deployment webapp
kubectl rollout undo deployment webapp
kubectl rollout status deployment webapp
-
kubectl autoscale deployment webapp --min=10 --max=20 --cpu-percent=85
kubectl get hpa
kubectl get pod -l app=webapp
-
kubectl delete deployment webapp
kubectl delete hpa webapp
-
Created config.txt
-
kubectl create cm keyvalcfgmap --from-file=config.txt
kubectl get cm keyvalcfgmap -o yaml > keyvalcfgmap.yaml
-
kubectl create -f secret-pod.yaml
kubectl exec -it nginx -- env
kubectl delete pod nginx
kubectl delete cm keyvalcfgmap