Skip to content

Consume and install kube-seconday-dns network-policy #2342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions data/kube-secondary-dns/secondarydns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,19 @@ spec:
nodeSelector: {{ toYaml .Placement.NodeSelector | nindent 8 }}
affinity: {{ toYaml .Placement.Affinity | nindent 8 }}
tolerations: {{ toYaml .Placement.Tolerations | nindent 8 }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-ingress-to-secondary-dns
namespace: '{{ .Namespace }}'
spec:
podSelector:
matchLabels:
k8s-app: secondary-dns
policyTypes:
- Ingress
ingress:
- ports:
- protocol: UDP
port: dns
7 changes: 6 additions & 1 deletion hack/components/bump-kube-secondary-dns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function __parametize_by_object() {
yaml-utils::update_param ${f} metadata.namespace '{{ .Namespace }}'
yaml-utils::remove_single_quotes_from_yaml ${f}
;;
./NetworkPolicy_allow-ingress-to-secondary-dns.yaml)
yaml-utils::update_param ${f} metadata.namespace '{{ .Namespace }}'
;;
esac
done
}
Expand Down Expand Up @@ -79,7 +82,9 @@ echo 'Adjust kube-secondary-dns to CNAO'
ClusterRole_secondary.yaml \
ClusterRoleBinding_secondary.yaml \
ServiceAccount_secondary.yaml \
Deployment_secondary-dns.yaml > secondarydns.yaml
Deployment_secondary-dns.yaml \
NetworkPolicy_allow-ingress-to-secondary-dns.yaml \
> secondarydns.yaml
)

echo 'copy manifests'
Expand Down