Compare languages | The network-policy-engine module: examples

Examples of network policies

Примеры network policies

Deny external traffic to Pods in the namespace, but allow traffic to external resources from within the namespace

Запретить обращаться снаружи к подам внутри namespace, но разрешить им обращаться внутри namespace и к внешним ресурсам

yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: delete spec: podSelector: {} egress:

  • {} ingress:
  • from:
  • podSelector: {} policyTypes:
  • Ingress
  • Egress

yaml apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: delete spec: podSelector: {} egress:

  • {} ingress:
  • from:
  • podSelector: {} policyTypes:
  • Ingress
  • Egress

More examples are available in this repository.

Больше примеров можно посмотреть в этом репозитории.