Hint: Restart CoreDNS pods after ConfigMap changes [OK]
Common Mistakes:
Deleting unrelated pods expecting DNS fix
Reinstalling cluster unnecessarily
Changing pod DNSPolicy incorrectly
5. You want to add a custom DNS entry for myapp.local inside your Kubernetes cluster using CoreDNS. Which step is required?
hard
A. Deploy a pod named myapp.local with a static IP
B. Create a new Service named myapp.local in default namespace
C. Modify the kubelet to add myapp.local to /etc/hosts on all nodes
D. Add a hosts plugin entry in the CoreDNS ConfigMap with myapp.local mapping
Solution
Step 1: Understand how to add custom DNS entries in CoreDNS
CoreDNS supports a hosts plugin where you can add static hostname-to-IP mappings in its ConfigMap.
Step 2: Evaluate other options
Creating a Service named myapp.local won't create a DNS entry for that domain; modifying kubelet hosts is manual and not scalable; pod names don't create DNS entries.
Final Answer:
Add a hosts plugin entry in the CoreDNS ConfigMap with myapp.local mapping -> Option D
Quick Check:
Custom DNS via hosts plugin in CoreDNS ConfigMap [OK]
Hint: Use hosts plugin in CoreDNS ConfigMap for custom DNS [OK]
Common Mistakes:
Thinking Service name creates arbitrary DNS names
Modifying node hosts files manually
Assuming pod names create DNS entries
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.