Kubernetes Assignment– 2
Networking & Services
Basic Questions
- Explain in your own words the Kubernetes flat networking model.
- List the installed CNI plugin in your cluster using kubectl get pods -n kube-system.
- Deploy a Pod running nginx and check if it can be pinged from another Pod.
- Create a Service of type ClusterIP for the nginx Pod.
- Verify that the Service ClusterIP is accessible from another Pod.
- Create a Service of type NodePort for the nginx Deployment.
- Access the NodePort Service using the Minikube or cluster node IP.
- Create a Service of type LoadBalancer (on Minikube with minikube tunnel).
- Verify the external IP of the LoadBalancer Service.
- Create a Service of type ExternalName pointing to example.com.
- Run kubectl exec into a Pod and test DNS resolution for example.com.
- Inspect CoreDNS pods in the kube-system namespace.
- Check the CoreDNS ConfigMap with kubectl get cm coredns -n kube-system -o yaml.
- Deploy two different Services (frontend and backend) and test DNS-based access.
- Use nslookup inside a Pod to resolve a Service DNS name.
- Run a Pod and test access to another Pod via Service name instead of IP.
- Create a namespace networking and deploy a Service in it.
- Verify that Service DNS names include namespace (e.g., service-name.networking.svc.cluster.local).
- Expose an app using kubectl expose with –port and –type=NodePort.
- Document the difference between ClusterIP, NodePort, and LoadBalancer.
Intermediate Questions
- Deploy a Deployment with 2 replicas of httpd and expose it via ClusterIP Service.
- Scale the Deployment to 5 replicas and verify Service still balances traffic.
- Deploy a Deployment with 3 replicas of nginx and expose it via NodePort Service.
- Access the NodePort Service from your local machine using Minikube service command.
- Deploy a LoadBalancer Service for nginx and get the external IP (use minikube tunnel).
- Create a multi-port Service exposing both HTTP (80) and HTTPS (443).
- Use labels and selectors to connect a Service only to specific Pods.
- Deploy two Services (frontend-svc, backend-svc) and test inter-service communication.
- Verify DNS resolution between Pods across namespaces using FQDN.
- Install an Ingress Controller (e.g., Nginx Ingress Controller) in Minikube.
- Create a simple Ingress resource that routes /app1 to nginx Deployment.
- Create another Ingress rule that routes /app2 to httpd Deployment.
- Access both apps through the same Ingress external IP.
- Add TLS to your Ingress resource using a self-signed certificate.
- Inspect Ingress logs to verify routing behavior.
- Deploy a default backend for the Ingress Controller and test with an unmatched path.
- Create a namespace ingress-demo and deploy an app with Ingress there.
- Annotate an Ingress resource with custom rewrite rules.
- Use kubectl describe ingress to check host/path mappings.
- Document the role of CoreDNS in Kubernetes networking.
Advanced Questions
- Deploy a multi-service app (frontend, backend, database) and expose only frontend externally using NodePort.
- Convert the NodePort Service to a LoadBalancer Service and test access.
- Configure Ingress to route /frontend to the frontend Service and /backend to the backend Service.
- Add TLS termination to the Ingress resource.
- Deploy two different apps (app1, app2) and configure Ingress with host-based routing (app1.local, app2.local).
- Configure DNS resolution for app1.local and app2.local in Minikube.
- Add resource limits to CoreDNS and monitor its Pod status.
- Test service discovery using dig inside a Pod for multiple services.
- Perform a rolling update of the frontend Deployment and verify Ingress routes traffic without downtime.
- 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.