Kubernetes Assignment 2 – Vishnupriya

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

kubectl get pods -o wide => to see detailed information about pod
curl http://10.44.0.1
kubectl describe pods Vishnu (podname)=> To show detailed description of pod
To edit pod => kubectl edit pods Vishnu => added one label as web: sample
kubectl get pods –show-labels => To see newly added labels
kubectl delete -f pod.yaml => To delete pod
2. What is Replication controller in 4 lines with 1 YAML example?

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

kubectl api-resources => to see list of resources available in system
To edit namespace => kubectl edit ns namespacename

To descibe namespace => kubectl describe ns namespcename

To create replication controller => kubectl create -f rc.yaml -n=namespacename

To View replication controller =>kubectl get rc -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

To see status of deployment => kubectl get deploy -n=vishnu
To edit deployment => kubectl edit deploy my-dep -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.

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