loki icon indicating copy to clipboard operation
loki copied to clipboard

fix: toEndpoints in CiliumNetworkPolicy for DNS egress

Open Pionerd opened this issue 10 months ago • 1 comments

What this PR does / why we need it: The current CiliumNetworkPolicy for DNS egress traffic is not valid

Currently:

spec:
  egress:
  - toEndpoints:
    - namespaceSelector: {}

The correct way to specify all namespaces is as below (according to https://docs.cilium.io/en/latest/security/policy/language/#egress-allow-all-endpoints) but unfortunately that is also not working somehow.

spec:
  egress:
  - toEndpoints:
    - {}

However, the recommended way to target DNS is using the below config from https://editor.networkpolicy.io

  egress:
    - toEndpoints:
        - matchLabels:
            io.kubernetes.pod.namespace: kube-system
            k8s-app: kube-dns
      toPorts:
        - ports:
            - port: "53"
              protocol: UDP
          rules:
            dns:
              - matchPattern: "*"

Which issue(s) this PR fixes: N/A

Special notes for your reviewer:

Checklist

  • [x] Reviewed the CONTRIBUTING.md guide (required)
  • [x] Documentation added
  • [x] Tests updated
  • [x] Title matches the required conventional commits format, see here
  • [x] Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • [x] For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • [x] If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

Pionerd avatar Apr 22 '24 15:04 Pionerd

@Pionerd Please update the other files listed in the checklist. For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR

JStickler avatar Apr 22 '24 15:04 JStickler

@JStickler done

Pionerd avatar May 01 '24 13:05 Pionerd

Any way to get some traction on this PR?

The Argo CD OutOfSync status is killing me and it would be silly to ignore changes to the policy 🚀

wolffberg avatar Sep 06 '24 07:09 wolffberg