Optimized for: Gemini / ChatGPT / Claude
Advanced AI Prompt for Zero-Trust Kubernetes NetworkPolicies
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[NAMESPACE] - ✦
[APP_LABEL] - ✦
[ALLOWED_CIDR] - ✦
[DB_PORT]
k8s-zero-trust-network-policy-generator.txt
Act as a DevSecOps specialist. Design a set of Kubernetes NetworkPolicies for the '[NAMESPACE]' namespace. First, implement a default-deny-all ingress and egress policy. Second, create a specific policy for pods labeled 'app=[APP_LABEL]' to allow egress only to a specific CIDR '[ALLOWED_CIDR]' and ingress only from the 'frontend' tier on port '[DB_PORT]'. Use labels strictly to define microservice boundaries.
Example Output
"The AI will provide two NetworkPolicy YAMLs: one to lock down the namespace and another to allow specific, granular traffic based on your microservice labels."