Answer for Kodekloud DEVOPS Questions - Create Replicaset in Kubernetes Cluster

The Nautilus DevOps team is going to deploy some applications on kubernetes cluster as they are planning to migrate some of their applications there. Recently one of the team members has been assigned a task to write a template as per the details mentioned below:

1. Create a ReplicaSet using httpd image with latest tag only and remember to mention tag i.e httpd:latest and name it as httpd-replicaset.

2. Labels app should be httpd_app, labels type should be front-end. The container should be named as httpd-container; also make sure replicas counts are 4.


Sample Answer: 

# first we need to create a replicate-set YAML file based on the given details in the question.

check below the Github link for the sample YAML file for this task.( replica-set.yaml) 



#Hope you prepared the YAML file from the above step using your question details.
NOW let's do the task.

 #deploy the file 

        kubectl apply -f replica-set.yaml

#checking

    kubectl get pods

Note: **The Question copied for learning purposes.** Commands are correct but based on your question the server, user name, and other details might differ, so please do check.

check the below video too for how to do this task (i have done a sample task on Ubuntu OS)



No comments:

Post a Comment

Featured Post

Answer for Kodekloud DEVOPS Questions - Init container in Kubernetes

Question: 1. Create a Deployment named as ic-deploy-devops. 2. Configure spec as replicas should be 1 , labels app should be ic-devops , ...