Interview Question for DevOps
- How do you find which pod is taking more systems resources across nodes using kubectl.
-> to find out which pod is taking more system resources across nodes using kubectl, you can use following commands
CPU usage: kubectl top pod --all-namespaces --sort-by=cpu
Memory usage: kubectl top pod --all-namespaces --sort-by=memory
Detailed resource usage: kubectl top top --all-namespaces --containers
Node-specific resource usage: kubectl top node
How do you find which pod is taking more system resources across nodes using kubectl?
to determine which node is consuming more resources across the cluster using kubectl, you can use following command.
1.Node resource usage- kubectl top node-this command displays the resource usage(CPU, memory, and storage) for all nodes in the cluster.
Detailed Node Information:
- kubectl describe node <node-name>
How do you set up a Docker Hub private registry and integrate it with a CI/CD pipeline? What is the procedure?
ans-> Setting up a Docker private registry and integrating it with a CI/CD pipeline involves several steps:
step 1: Setup a Docker private registry
. install Docker Registry on a server or use a cloud based service like Docker hub, GCR, or AWS
. Configure the registry to use a secure protocol(HTTPS) ans authentication.
step 2: Create a CI/CD pipeline
. Choose a CI/CD tools like jenkins, Gitlab CI/CD
. Create a new pipeline and add stages for building, testing, and Deploying your docker image.
step 3:Integrate the private registry with CI/CD pipeline
a. in the pipeline, add a stage to authenticate with the private registry using docker login command.
b. use the docker build command to build your docker image and tag it with the private registry URL
c. Push the image to the private registry using the Docker push command.
d. In the development stage, pull the image from the private registry using the docker pull command.
q)What is the terraform taint
command?
The terraform taint command is used to manually mark a resource as tainted, indicating that it needs to be replaced or updated. When a resource is tainted, terraform will recreate or update it during the next terraform apply command.
the taint command is useful in scenarios such as:
Resource corruption: if a resource becomes corrupted or misconfigured, you can taint it to force Terraform to recreate it.
Manual Intervention: if you need to manually update a resource, tainting it ensures Terraform will update it during the next apply.