Public Information

This commit is contained in:
2026-03-10 07:33:55 +01:00
commit 4c9519166e
499 changed files with 125937 additions and 0 deletions

View File

@@ -0,0 +1,115 @@
{{- include "nplus.init" $ -}}
{{- if ((.this.security).cni).createNetworkPolicy }}
{{- if ((.this.security).cni).defaultIngressPolicy }}
{{- if eq ((.this.security).cni).defaultIngressPolicy "deny" }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ .component.prefix }}default-deny-ingress
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
nplus/group: {{ .instance.group }}
policyTypes:
- Ingress
{{- end }}{{/* if eq ((.this.security).cni).defaultIngressPolicy "deny" */}}
---
{{- if eq ((.this.security).cni).defaultIngressPolicy "allow" }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ .component.prefix }}default-allow-ingress
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
nplus/group: {{ .instance.group }}
policyTypes:
- Ingress
ingress:
- {}
{{- end }}{{/* if eq ((.this.security).cni).defaultIngressPolicy "allow" */}}
{{- end }}{{/* if ((.this.security).cni).defaultIngressPolicy */}}
---
{{- if ((.this.security).cni).defaultEgressPolicy }}
{{- if eq ((.this.security).cni).defaultEgressPolicy "deny" }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ .component.prefix }}default-deny-egress
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
nplus/group: {{ .instance.group }}
policyTypes:
- Egress
{{- end }}{{/* if eq ((.this.security).cni).defaultEgressPolicy "deny" */}}
---
{{- if eq ((.this.security).cni).defaultEgressPolicy "allow" }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ .component.prefix }}default-allow-egress
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "nplus.instanceLabels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
nplus/group: {{ .instance.group }}
policyTypes:
- Egress
ingress:
- {}
{{- end }}{{/* if eq ((.this.security).cni).defaultEgressPolicy "allow" */}}
{{- end }}{{/* if ((.this.security).cni).defaultEgressPolicy */}}
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: {{ .component.prefix }}allow-dns
{{- if .this.utils.includeNamespace }}
namespace: {{ .Release.Namespace }}
{{- end }}
spec:
podSelector:
matchLabels:
nplus/group: {{ .instance.group }}
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
{{- end }}{{/* if ((.this.security).cni).createNetworkPolicy */}}