Kubernetes Assignment– 1

Kubenetes Core Concepts

Basic Questions

  1. Install Minikube on your system and verify the installation using minikube version.
  2. Start a Minikube cluster and check its status.
  3. Deploy your first Pod using the kubectl run hello-pod –image=nginx.
  4. View all running Pods in the default namespace.
  5. Inspect Pod details using kubectl describe pod <pod-name>.
  6. Delete a Pod and verify it is removed from the cluster.
  7. Create a ReplicaSet with 2 replicas of an nginx Pod.
  8. Scale the ReplicaSet to 4 replicas.
  9. View all ReplicaSets running in the cluster.
  10. Delete the ReplicaSet and confirm all Pods are terminated.
  11. Create a Deployment with 3 replicas of a simple httpd Pod.
  12. Check Deployment details using kubectl get deployments.
  13. Perform a rolling update on the Deployment by changing the image version.
  14. Roll back the Deployment to its previous version.
  15. Create a new namespace called dev.
  16. Deploy a Pod inside the dev namespace.
  17. List all Pods running in all namespaces.
  18. Create a Service of type ClusterIP to expose a Deployment internally.
  19. Create a Service of type NodePort to expose a Deployment externally.
  20. Verify Pod-to-Service communication using kubectl exec with curl.

Intermediate Questions

  1. Deploy a Deployment with 2 replicas of nginx and expose it as a Service.
  2. Scale the Deployment to 5 replicas and verify changes.
  3. Perform a rolling update by upgrading the nginx image from 1.19 to 1.21.
  4. Perform a rollback of the Deployment to the earlier version.
  5. Create a namespace test and deploy a Deployment inside it.
  6. Restrict a Deployment to the test namespace only.
  7. Deploy a ReplicaSet with labels (app=web, tier=frontend) and check Pod selection.
  8. Delete a Pod managed by a ReplicaSet and verify it is recreated automatically.
  9. Deploy two different Deployments in different namespaces and verify isolation.
  10. Create a Service in one namespace and confirm it cannot be accessed directly from another namespace.
  11. Add resource requests (CPU/Memory) to a Deployment and check Pod allocation.
  12. Add resource limits (CPU/Memory) to the same Deployment and verify enforcement.
  13. Run kubectl rollout history on a Deployment and view revision history.
  14. Pause a Deployment rollout, make changes, and then resume it.
  15. Expose a Deployment as a NodePort Service and test it via Minikube’s IP.
  16. Use kubectl port-forward to access a Pod locally.
  17. Label a namespace and view it using kubectl get ns –show-labels.
  18. Annotate a Deployment with metadata and inspect it.
  19. Deploy a ReplicaSet that runs 3 Pods of busybox to run infinite sleep.
  20. Verify inter-Pod communication using kubectl exec to ping another Pod.

Advanced Questions

  1. Write a Deployment YAML file for an nginx web app with 3 replicas and apply it.
  2. Modify the Deployment YAML to include rolling update strategy (maxSurge=1, maxUnavailable=1).
  3. Trigger a rolling update by changing the container image in the YAML and reapply it.
  4. Roll back the Deployment to a specific revision using kubectl rollout undo.
  5. Create two namespaces (frontend and backend) and deploy apps in each.
  6. Verify namespace isolation by testing connectivity between Pods in different namespaces.
  7. Create a ReplicaSet YAML file for an nginx app with labels and selectors.
  8. Delete one Pod manually and observe how ReplicaSet recreates it.
  9. Deploy a full-stack app: frontend (nginx), backend (httpd), both managed by Deployments, exposed via NodePort Services.
  10. Deliver a final hands-on project:
    • Start Minikube → Create namespace project → Deploy web app via Deployment (3 replicas) → Expose with NodePort Service → Perform rolling update → Rollback → Verify scaling.