Kubernets-test-chandra

What is POD – in 10 lines with 1 YAML example

pod it will execute the containers . it may contains tightly or loosely coupled containers and it has yaml file we can write pod instructions.

kubctl create ns chandra
vi pod.yaml
kubectl get pods -n=chandra
kubectl apply -f pod.yaml -n=chandra
kubectl get pods -n=chandra
kubectl get pods -n=chandra -o wide
kubectl get pods -n=chandra -o wide --show-labels
 kubectl get pods -h
 vi pod.yaml
kubectl apply -f pod.yaml -n=chandra
kubectl delete -f pod.yaml -n=chandra

What is ReplicationController – in 4 lines with 1 YAML example

Replication means multiple pods. we can create multiple pods at a time by using rc.yml file. we need to give option like replicas: 3 in spect section in rc.yml file.

controller will recreate images. if you delete some images automatically recreate images in pod using controller.

vi rc.yaml
kubectl create -f rc.yaml -n=chandra
kubectl get rc -n=chandra
kubectl get pods -n=chandra
vi rc.yaml
kubectl apply -f rc.yaml -n=chandra
kubectl get rc -n=chandra
kubectl get pods -n=chandra
kubectl delete pods replicationcontroller-example-5hxrk replicationcontroller-example-8jpv9 
kubectl get pods -n=chandra
kubectl delete rc replicationcontroller-example -n=chandra

What is ReplicaSets – in 4 lines with 1 YAML example

Replicasets means Replications and Controller and Versioning.

creating multiple pods by using replication and when we delete any image in pod it will recreate by using controller

vi rc.yaml
kubectl create -f rc.yaml -n=chandra
kubectl get rc -n=chandra
kubectl get pods -n=chandra
vi rc.yaml
kubectl apply -f rc.yaml -n=chandra
kubectl get rc -n=chandra
kubectl get pods -n=chandra
kubectl delete pods replicationcontroller-example-5hxrk replicationcontroller-example-8jpv9 
kubectl get pods -n=chandra
kubectl delete rc replicationcontroller-example -n=chandra

What is Deployment – in 10 lines with 1 YAML example

deployment is combination of replicaset and rollout and rollback.

deployment follow the pods creation and recreation by using controller , rollout create a version for deployment and rollback it will rollback the version

kubectl create deployment my-dep --image=scmgalaxy/nginx-devopsschoolv1 -n=chandra
 kubectl get deploy -n=chandra
kubectl edit deploy my-dep -n=chandra
kubectl get pod -n=chandra
 kubectl scale --replicas=5 deployment/my-dep -n=chandra
 kubectl delete pod my-dep-747b4ffb56-2ftv5 my-dep-747b4ffb56-8nvwk
kubectl get pod -n=chandra

kubectl rollout -h
kubectl rollout history deploy/my-dep -n=chandra
kubectl edit deploy/my-dep -n=chandra
kubectl rollout history deploy/my-dep -n=chandra
 kubectl get pods -n=rajesh -o wide
kubectl rollout history deploy/my-dep -n=chandra

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x