Lab Information
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 to 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 deploy a POD within it. Name the pod dev-nginx-pod and use the nginx image with the latest tag. Ensure to specify the tag as nginx:latest.
Note: The kubectl utility on jump_host is configured to operate with the Kubernetes cluster.
Lab Solutions
Step 1: Create the Namespace
Create the dev namespace
kubectl create namespace dev
Step 2: Create the Nginx Pod in the dev Namespace
# Create the nginx pod in the dev namespace
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: dev-nginx-pod
namespace: dev
spec:
containers:
- name: nginx-container
image: nginx:latest
ports:
- containerPort: 80
EOF
Step 3: Verification
Check if the namespace was created:
kubectl get namespaces | grep dev
Check if the pod is running in the dev namespace:
kubectl get pods -n dev
Get detailed information about the pod:
kubectl describe pod dev-nginx-pod -n dev
Check the pod logs to ensure nginx started correctly:
kubectl logs dev-nginx-pod -n dev





Top comments (0)