3 - Create Namespaces in Kubernetes Cluster
Task
The Nautilus DevOps team is planning to deploy some micro services on Kubernetes platform. The team has already set up a Kubernetes cluster and now they want set up some namespaces, deployments etc. Based on the current requirements, the team has shared some details as 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.
CheckCompleteIncomplete
Solution
thor@jump_host ~$ k create ns dev
namespace/dev created
thor@jump_host ~$ k run dev-nginx-pod --image=nginx:latest -n dev
pod/dev-nginx-pod created
thor@jump_host ~$ k get po -n dev --watch
NAME READY STATUS RESTARTS AGE
dev-nginx-pod 1/1 Running 0 7s