Kubernetes Assignment– 2

Networking & Services

Basic Questions

  1. Explain in your own words the Kubernetes flat networking model.
  2. List the installed CNI plugin in your cluster using kubectl get pods -n kube-system.
  3. Deploy a Pod running nginx and check if it can be pinged from another Pod.
  4. Create a Service of type ClusterIP for the nginx Pod.
  5. Verify that the Service ClusterIP is accessible from another Pod.
  6. Create a Service of type NodePort for the nginx Deployment.
  7. Access the NodePort Service using the Minikube or cluster node IP.
  8. Create a Service of type LoadBalancer (on Minikube with minikube tunnel).
  9. Verify the external IP of the LoadBalancer Service.
  10. Create a Service of type ExternalName pointing to example.com.
  11. Run kubectl exec into a Pod and test DNS resolution for example.com.
  12. Inspect CoreDNS pods in the kube-system namespace.
  13. Check the CoreDNS ConfigMap with kubectl get cm coredns -n kube-system -o yaml.
  14. Deploy two different Services (frontend and backend) and test DNS-based access.
  15. Use nslookup inside a Pod to resolve a Service DNS name.
  16. Run a Pod and test access to another Pod via Service name instead of IP.
  17. Create a namespace networking and deploy a Service in it.
  18. Verify that Service DNS names include namespace (e.g., service-name.networking.svc.cluster.local).
  19. Expose an app using kubectl expose with –port and –type=NodePort.
  20. Document the difference between ClusterIP, NodePort, and LoadBalancer.

Intermediate Questions

  1. Deploy a Deployment with 2 replicas of httpd and expose it via ClusterIP Service.
  2. Scale the Deployment to 5 replicas and verify Service still balances traffic.
  3. Deploy a Deployment with 3 replicas of nginx and expose it via NodePort Service.
  4. Access the NodePort Service from your local machine using Minikube service command.
  5. Deploy a LoadBalancer Service for nginx and get the external IP (use minikube tunnel).
  6. Create a multi-port Service exposing both HTTP (80) and HTTPS (443).
  7. Use labels and selectors to connect a Service only to specific Pods.
  8. Deploy two Services (frontend-svc, backend-svc) and test inter-service communication.
  9. Verify DNS resolution between Pods across namespaces using FQDN.
  10. Install an Ingress Controller (e.g., Nginx Ingress Controller) in Minikube.
  11. Create a simple Ingress resource that routes /app1 to nginx Deployment.
  12. Create another Ingress rule that routes /app2 to httpd Deployment.
  13. Access both apps through the same Ingress external IP.
  14. Add TLS to your Ingress resource using a self-signed certificate.
  15. Inspect Ingress logs to verify routing behavior.
  16. Deploy a default backend for the Ingress Controller and test with an unmatched path.
  17. Create a namespace ingress-demo and deploy an app with Ingress there.
  18. Annotate an Ingress resource with custom rewrite rules.
  19. Use kubectl describe ingress to check host/path mappings.
  20. Document the role of CoreDNS in Kubernetes networking.

Advanced Questions

  1. Deploy a multi-service app (frontend, backend, database) and expose only frontend externally using NodePort.
  2. Convert the NodePort Service to a LoadBalancer Service and test access.
  3. Configure Ingress to route /frontend to the frontend Service and /backend to the backend Service.
  4. Add TLS termination to the Ingress resource.
  5. Deploy two different apps (app1, app2) and configure Ingress with host-based routing (app1.local, app2.local).
  6. Configure DNS resolution for app1.local and app2.local in Minikube.
  7. Add resource limits to CoreDNS and monitor its Pod status.
  8. Test service discovery using dig inside a Pod for multiple services.
  9. Perform a rolling update of the frontend Deployment and verify Ingress routes traffic without downtime.
  10. Deliver a final hands-on project:
    • Start Minikube → Deploy nginx and httpd apps → Expose with NodePort and LoadBalancer → Install Ingress Controller → Configure path-based + host-based routing with TLS → Test full routing and DNS resolution.