Files
charts/bitnami/ejbca/templates/networkpolicy-egress.yaml
Pablo Galego 81ece48240 [bitnami/*] Add network policies - first batch (#8088)
* [bitnami/discourse] Add Network Policies

* [bitnami/discourse] Update networkPolicy.enabled comment

* [bitnami/ejbca] Add Network Policies

* [bitnami/ghost] Add Network Policies

* [bitnami/jasperreports] Add Network Policies

* [bitnami/suitecrm] Add Network Policies

* [bitnami/discourse] Add endline to networkpolicy-backend-ingress-rules.yaml

* [bitnami/*] Cosmetic changes

* [bitnami/discourse] Rename network policy files

* [bitnami/*] Fix comments' format for readme-generator
2021-11-17 16:09:17 +01:00

33 lines
1.3 KiB
YAML

{{- if and .Values.networkPolicy.enabled (or .Values.networkPolicy.egressRules.denyConnectionsToExternal .Values.networkPolicy.egressRules.customRules) }}
apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
kind: NetworkPolicy
metadata:
name: {{ printf "%s-egress" (include "common.names.fullname" .) }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
podSelector:
matchLabels:
app.kubernetes.io/instance: {{ .Release.Name }}
policyTypes:
- Egress
egress:
{{- if .Values.networkPolicy.egressRules.denyConnectionsToExternal }}
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
- to:
- namespaceSelector: {}
{{- end }}
{{- if .Values.networkPolicy.egressRules.customRules }}
{{- include "common.tplvalues.render" (dict "value" .Values.networkPolicy.egressRules.customRules "context" $) | nindent 4 }}
{{- end }}
{{- end }}