Skip to content

Commit 6fd50c0

Browse files
authored
data,components: Consume kube-seconday-dns network-policy (#2342)
Extend the bump-kube-secondary-dns to consume the project network-policy manifests. This change include 'make gen-manifest' changes. With this change KSD network-policy is added to KSD template, and CNAO will install KSD network-policy. Signed-off-by: Or Mergi <[email protected]>
1 parent ae5934c commit 6fd50c0

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

data/kube-secondary-dns/secondarydns.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,19 @@ spec:
186186
nodeSelector: {{ toYaml .Placement.NodeSelector | nindent 8 }}
187187
affinity: {{ toYaml .Placement.Affinity | nindent 8 }}
188188
tolerations: {{ toYaml .Placement.Tolerations | nindent 8 }}
189+
---
190+
apiVersion: networking.k8s.io/v1
191+
kind: NetworkPolicy
192+
metadata:
193+
name: allow-ingress-to-secondary-dns
194+
namespace: '{{ .Namespace }}'
195+
spec:
196+
podSelector:
197+
matchLabels:
198+
k8s-app: secondary-dns
199+
policyTypes:
200+
- Ingress
201+
ingress:
202+
- ports:
203+
- protocol: UDP
204+
port: dns

hack/components/bump-kube-secondary-dns.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ function __parametize_by_object() {
4141
yaml-utils::update_param ${f} metadata.namespace '{{ .Namespace }}'
4242
yaml-utils::remove_single_quotes_from_yaml ${f}
4343
;;
44+
./NetworkPolicy_allow-ingress-to-secondary-dns.yaml)
45+
yaml-utils::update_param ${f} metadata.namespace '{{ .Namespace }}'
46+
;;
4447
esac
4548
done
4649
}
@@ -79,7 +82,9 @@ echo 'Adjust kube-secondary-dns to CNAO'
7982
ClusterRole_secondary.yaml \
8083
ClusterRoleBinding_secondary.yaml \
8184
ServiceAccount_secondary.yaml \
82-
Deployment_secondary-dns.yaml > secondarydns.yaml
85+
Deployment_secondary-dns.yaml \
86+
NetworkPolicy_allow-ingress-to-secondary-dns.yaml \
87+
> secondarydns.yaml
8388
)
8489

8590
echo 'copy manifests'

0 commit comments

Comments
 (0)