Question : The Nautilus DevOps team is planning to deploy some micro service on Kubernetes platform. The team has already set up a Kubernetes cluster and now they want to set up some namespaces, deployments etc. Based on the current requirements the team has shared the details below:
Create a namespace named dev and create a POD under it; name the pod dev-nginx-pod and use nginx image with latest tag only and remember to mention tag i.e nginx:latest.
Note: The kubectl utility on jump_host has been configured to work with the kubernetes cluster.
1. At first kubectl utility configure and working from jump server, run below commands
kubectl get namespace
kubectl get pods
2. Create a new namespace as per the task
thor@jump_host
/$ kubectl create namespace dev namespace/dev
created thor@jump_host
/$ thor@jump_host
/$ kubectl get namespace NAME STATUS AGE default Active 3m24s dev Active 44s kube-node-lease Active
3m26s kube-public Active 3m26s kube-system Active 3m27s thor@jump_host
/$ |
thor@jump_host
/$ kubectl run dev-nginx-pod --image=nginx:latest -n dev pod/dev-nginx-pod
created thor@jump_host
/$ |
thor@jump_host
/$ kubectl get pods -n dev NAME READY STATUS
RESTARTS AGE dev-nginx-pod 1/1
Running 0 89s thor@jump_host
/$ |
5. Click on Finish & Confirm to complete the task successfully
Happy Learning!!!!
0 Comments