Imran_Kubernet_assignment
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
- what is pod?.
->Pod is a collection of conatiner.
-> It is storage inside a node of kubernet clusters.
Types of Pod.
- Single Container Pod –> With the help of kubectl command we can create single container pod.
kubectl run <name of the Pod> –image=<name of the image from registry>
kubectl run jboss –image=jboss6.1
2. Multi Container Pod.-> it can be created using yaml mail with defenation of the container.
Below is the example
apiVersion: v1
kind: Pod
metadata:
name: Jboss
spec:
containers:
- name: Tomcat
image: Jboss: 6.1
ports:
containerPort: 7500
imagePullPolicy: Always
-name: Database
Image: Oracle
Ports:
containerPort: 7501
imagePullPolicy: Always
2. What is ReplicationController – in 4 lines with 1 YAML example
It is responsible to manage the pod life cycle. It is responsible to make sure that specified number of pod replicas are running at any point of time.
It has the capability to bring up or down the specified number of pods. It is good practice to use replication controller to manage the pod life cyclee rather then creating pod again and again.
apiVersion: v1
kind: ReplicationController ————————–> 1
metadata:
name: Jboss-ReplicationController ————————–> 2
spec:
replicas: 3 ————————> 3
template:
metadata:
name: Jboss-ReplicationController
labels:
app: App
component: neo4j
spec:
containers:
- name: Jboss- ———————–> 4
image: Jboss: 8.0
ports: - containerPort: 7474 ————————> 5
3. What is ReplicaSets – in 4 lines with 1 YAML example?.
Replicaset ensure how many replica pod is running.
It can be considered as a replacement of replication controller.
The key difference between the replica set and replication controller, where replication controller support equality based selector and replca set support set based selector.
apiVersion: extensions/v1beta1 ———————>1
kind: ReplicaSet ————————–> 2
metadata:
name: Jboss-ReplicaSet
spec:
replicas: 3
selector:
matchLables:
tier: Backend ——————> 3
matchExpression:
{ key: tier, operation: In, values: [Backend]} ————–> 4
template:
metadata:
lables:
app: Jboss-ReplicaSet
tier: Backend
labels:
app: App
component: neo4j
spec:
containers:
- name: Jboss
image: jboss: 8.0
ports: - containerPort: 7474
4. What is Deployment – in 10 lines with 1 YAML example?.
Deployment is a higher and upgraded version of replocation controller.
they manage the deloyment of replica set and also an upgarded version of replication controller.
Deployment have the capability to update the replica set and also have the capability to roll back to previous version.
apiVersion: extensions/v1beta1 ———————>1
kind: Deployment ————————–> 2
metadata:
name: Jboss-ReplicaSet
spec:
replicas: 3
template:
metadata:
lables:
app: Jboss-ReplicaSet
tier: Backend
spec:
containers:
- name: Tomcatimage:
jboss: 8.0
ports: - containerPort: 7474