fix(cilium): dns netpols

This commit is contained in:
JJGadgets
2024-06-20 16:38:53 +08:00
parent b552aac069
commit fb3a8f87c2

View File

@@ -20,50 +20,17 @@ spec:
apiVersion: "cilium.io/v2"
kind: CiliumClusterwideNetworkPolicy
metadata:
name: "cluster-default-kube-dns-ingress-old"
spec:
description: "Policy for ingress allow to kube-dns from all Cilium managed endpoints in the cluster (1.13.4)"
endpointSelector:
matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
ingress:
- fromEndpoints:
- {}
toPorts:
- ports:
- port: "53"
protocol: "ANY"
---
apiVersion: "cilium.io/v2"
kind: CiliumClusterwideNetworkPolicy
metadata:
name: "cluster-default-kube-dns-egress"
name: "cluster-default-kube-dns-egress-l7"
spec:
description: "Policy for egress allow to kube-dns from all Cilium managed endpoints in the cluster"
endpointSelector: {}
endpointSelector:
matchExpressions:
- {key: dns.home.arpa/l7, operator: NotIn, values: ["false"]}
egress:
- toEndpoints:
- matchLabels:
"k8s:io.kubernetes.pod.namespace": kube-system
"k8s:k8s-app": kube-dns
toPorts:
- ports:
- port: "53"
protocol: "ANY"
rules:
dns:
- matchPattern: "*"
---
apiVersion: "cilium.io/v2"
kind: CiliumClusterwideNetworkPolicy
metadata:
name: "cluster-default-kube-dns-egress-old"
spec:
description: "Policy for egress allow to kube-dns from all Cilium managed endpoints in the cluster (1.13.4)"
endpointSelector: {}
egress:
- toEndpoints:
- matchLabels:
io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
@@ -74,5 +41,25 @@ spec:
rules:
dns:
- matchPattern: "*"
- {}
---
apiVersion: "cilium.io/v2"
kind: CiliumClusterwideNetworkPolicy
metadata:
name: "cluster-default-kube-dns-egress"
spec:
description: "Policy for egress allow to kube-dns from all Cilium managed endpoints in the cluster"
endpointSelector:
matchExpressions:
- {key: dns.home.arpa/l7, operator: In, values: ["false"]}
egress:
- toEndpoints:
- matchLabels:
"k8s:io.kubernetes.pod.namespace": kube-system
"k8s:k8s-app": kube-dns
- matchLabels:
io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: "ANY"