apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
  name: {{.basename}}
spec:
  endpointSelector:
    matchLabels:
      app: fortio
      role: load
  egress:
    - toEndpoints:
      - matchLabels:
          "k8s:io.kubernetes.pod.namespace": kube-system
          "k8s:k8s-app": kube-dns
      toPorts:
        - ports:
           - port: "53"
             protocol: ANY
          rules:
            dns:
              - matchPattern: "*"
    - toFQDNs:
      - matchPattern: "*"
    - toEndpoints:
      - matchLabels:
          app: fortio
          role: server
