kubectl create -f nginx-rc.yaml
kubectl get pods
kubectl get po -l app=nginx-app
kubectl get rs nginx-rc -o wide
kubectl describe rs nginx-rc
kubectl set image deploy nginx-deployment nginx-container=nginx:1.9.1
kubectl rollout status deploy/nginx-deployment
kubectl get deploy
kubectl get po -o wide
kubectl get nodes
kubectl get po -o wide
kubectl scale rs nginx-rc --replicas=5
kubectl get rs nginx-rc
kubectl get po -o wide
kubectl scale rs nginx-rs --replicas=4
kubectl get rs nginx-rc
kubectl get po -o wide
kubectl delete -f nginx-rc.yaml
kubectl get rs
kubectl get po -l app=nginx-app
kubectl create -f nginx-deployment.yaml
kubectl get deploy
kubectl get deploy -l app=nginx-app
kubectl get rs -l app=nginx-app
kubectl get po -l app=nginx-app
kubectl describe deploy nginx-deployment
## kubectl set image deploy nginx-deployment nginx-container=nginx:1.9.1
## kubectl rollout status deploy/nginx-deployment
## kubectl get deploy
## kubectl set image deploy nginx-deployment nginx-container=nginx:1.91 --record
## kubectl rollout status deploy/nginx-deployment
## kubectl rollout history deploy/nginx-deployment
## kubectl rollout undo deploy/nginx-deployment
## kubectl rollout status deploy/nginx-deployment
## kubectl get po -o wide
## kubectl get nodes
## kubectl get po -o wide
## kubectl scale deployment nginx-deployment --replicas=5
## kubectl get deploy
## kubectl get po -o wide
## kubectl scale deployment nginx-deployment --replicas=2
## kubectl get deploy
## kubectl get po -o wide
## kubectl get po -l app=nginx-app
## kubectl delete -f nginx-deployment.yaml
## kubectl get rs
## kubectl get po -l app=nginx-app
-
apiVersion: v1 kind: Pod metadata: name: test-nginx spec: containers: - image: nginx name: test-nginx volumeMounts: - mountPath: /cache name: cache-volume volumes: - name: cache-volume emptyDir: {} ## Create & Display EmptyDir volume Let's try K8 : kubectl apply -f emptydir.yml pod/test-nginx created Let's try K8 : kubectl get pods NAME READY STATUS RESTARTS AGE test-nginx 1/1 Running 0 7s Let's try K8 : kubectl exec -it test-nginx -- /bin/bash root@test-nginx:/# mount | grep -i cache /dev/vda1 on /cache type ext4 (rw,relatime) kubectl describe pod test-nginx kubectl delete po test-nginx
-
kubectl create -f hostpath-test.yaml kubectl get po kubectl exec redis-hostpath df /test-mnt kubectl delete po redis-hostpath
- ### HostPath - From HOST to Pod : (Node2) ```t cd /test-vol echo "From host" > from-host.txt cat from-host.txt ``` - ### Pod (Master) ```t kubectl exec redis-hostpath cat /test-mnt/from-host.txt echo "From host" > from-host.txt cat from-host.txt kubectl exec redis-hostpath -it -- /bin/sh cd /test-mnt echo "test host" > from-pod.txt cat from-pod.txt ``` - ### HostPath - From HOST to Pod : (Node2) ```t cd /test-vol ls cat from-pod.txt ```