← Policy catalog
</> NetworkPolicy · Apache-2.0

Allow Egress to Specific External IP

networkpolicy-allow-traffic-to-specific-external-ip

productKubernetes

Allow egress traffic to the external IP 203.0.113.10/32.

What this is

A reference manifest to copy and adapt, not a rule cenroq enforces for you. It carries no severity, belongs to no bundle, and nothing on your cluster changes until you apply it yourself.

Manifest

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-traffic-to-specific-external-ip
  annotations:
    cenroq.io/displayName: "Allow Egress to Specific External IP"
    cenroq.io/description: "Allow egress traffic to the external IP 203.0.113.10/32."
spec:
  podSelector: {}
  policyTypes:
  - Egress
  egress:
  - to:
    - ipBlock:
        cidr: 203.0.113.10/32

Save it as networkpolicy-allow-traffic-to-specific-external-ip.yaml — the commands below assume that name.

Apply it

This is a manifest, not an admission policy, so there is nothing for kubeapt validate to check it against. Adapt the selectors and namespace first, then:

$ kubectl apply -f ./networkpolicy-allow-traffic-to-specific-external-ip.yaml