mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-05 04:06:22 -03:00
feat(common): Add simplified networkPolicy alternative for use in SCALE GUI
This commit is contained in:
25
charts/common/templates/SCALE/_allowedcon.tpl
Normal file
25
charts/common/templates/SCALE/_allowedcon.tpl
Normal file
@@ -0,0 +1,25 @@
|
||||
{{- define "tc.common.scale.allowedcon" -}}
|
||||
---
|
||||
kind: NetworkPolicy
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: allowedCon
|
||||
{{- with (include "tc.common.labels" $ | fromYaml) }}
|
||||
labels: {{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with (include "tc.common.annotations" $ | fromYaml) }}
|
||||
annotations:
|
||||
{{- tpl ( toYaml . ) $ | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
policyTypes: ["Ingress"]
|
||||
{{- if .Values.allowedCon }}
|
||||
ingress:
|
||||
- from:
|
||||
{{- range .Values.allowedCon }}
|
||||
- namespaceSelector:
|
||||
matchLabels:
|
||||
kubernetes.io/metadata.name: {{ . }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@@ -49,6 +49,8 @@ Secondary entrypoint and primary loader for the common chart
|
||||
|
||||
{{ include "tc.common.scale.portal" . | nindent 0 }}
|
||||
|
||||
{{ include "tc.common.scale.allowedcon" . | nindent 0 }}
|
||||
|
||||
{{ include "tc.common.spawner.networkpolicy" . | nindent 0 }}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
@@ -1124,6 +1124,9 @@ addons:
|
||||
pathType: Prefix
|
||||
tls: []
|
||||
|
||||
# -- A list of Apps/Namespace names allowed to communicate with this App/Chart
|
||||
allowedCon: []
|
||||
|
||||
##
|
||||
# This section contains some-preconfig for frequently used dependencies
|
||||
##
|
||||
|
||||
Reference in New Issue
Block a user