Files
nplus/charts/rms/templates/networkpolicy.tpl
2025-01-24 16:18:47 +01:00

42 lines
1.0 KiB
Smarty

{{- include "nplus.init" $ -}}
{{- if ((.this.security).cni).createNetworkPolicy }}
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ .component.fullName }}
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
annotations:
{{- include "nplus.argoWave" . | nindent 4 }}
{{- include "nplus.annotations" . | nindent 4 }}
{{- include "nplus.securityAnnotations" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "nplus.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
- Egress
ingress:
- from:
# Access from out of Cluster (Admin Desktop)
- ipBlock:
cidr: {{ ((.this.security).cni).adminIpRange | quote }}
egress:
- to:
# All Pods in Instance
- podSelector:
matchLabels:
nplus/group: {{ .instance.group }}
# Allow API Access
- ports:
- protocol: TCP
port: 16443
- protocol: TCP
port: 443
{{- end }}