Kubernetes Assignment 2 – Vishnupriya
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
1.What is POD in 10 lines with 1 YAML example –
A POD is a collection of container and its storage inside a node of kubernetes cluster. We can have single or multiple container inside POD.
Create a pod.yaml file with list of lines needs to be executed
kubectl create -f pod.yaml => Will create pod now
kubectl get pods => To see list of pods
Replication controller is responsible for making sure that the specified number of pod replicas are running at any point of time. It is used for managing POD life cycle. It is used to make sure specified number of pod is running or atleast one POD is running. It has ability to bring up or down the specified no of pod. If there are too many pods, the replication controller has ability to terminate extra pods.
to create namespace => kubectl create ns namespacename
To see list of namespaces => kubeclt get ns
To descibe namespace => kubectl describe ns namespcename
To create replication controller => kubectl create -f rc.yaml -n=namespacename
To update/ apply changes to resources => kubectl apply -f rc.yaml -n=namespacename
To delete replication controller => delete rc replicationcontroller-example -n=namespacename
3.What is ReplicaSets – in 4 lines with 1 YAML example?
Replica set is used to maintain number of running state of pods. It helps to ensure specified number of pod replicas are running at any given time.
To create replicaset => kubectl apply -f example.yaml
To see list of replicassets deployed => kubectl get rs
To see state of replicaset => kubectl describe rs/example
To see list of pods => kubectl get pods
4.What is Deployment – in 10 lines with 1 YAML example?
A deployment provides declarative updates for pods and replicasets.
features of deployment => replication + controller + versioning + zero time rollout + zero time rollback
To create deployment => kubectl create deployment my-dep –image=scmgalaxy/nginx-devopsschoolv1 -n=vishnu
type of deployment can be 2 ways => Recreate & Rolling Update
Recreate => Before creating new one all existing pods will be terminated. while doing deployment, it will ensures older version of pod has terminated before creating a new Pods.
Rolling Update => The update strategy will be taken care pod-by-pod and so greater system can remain active.