
Testing Connectivity in the QA Namespace
Start by verifying that permitted connections in the “qa-test” namespace work correctly. First, list all services across namespaces:Investigating and Refining QA Namespace Policies
Examine the network policies in the “qa-test” namespace:Controlling API-to-Frontend Traffic
The “frontend-api-np” network policy is designed to permit only frontend pods to connect to API pods. Below is its YAML configuration:Troubleshooting the Staging Namespace
In the staging namespace, both frontend and API pods are unable to connect as required. Additionally, pods from the QA namespace are mistakenly able to access the staging database if they use the unqualified service name (e.g., “db-svc” resolves within the QA namespace). To avoid this, the fully qualified domain name (FQDN) must be used. First, list the network policies in the staging namespace:Recap
Key takeaways from this troubleshooting exercise include:
!!! note “Reminder”
Always test your network policies after applying changes by simulating both allowed and disallowed traffic. This ensures that the intended security boundaries are effectively enforced.
