2022-10-31 15:52:45 +00:00
{{- if and .Values.applicationSet.enabled .Values.global.networkPolicy.create (or .Values.applicationSet.metrics.enabled .Values.applicationSet.webhook.ingress.enabled) }}
apiVersion : networking.k8s.io/v1
kind : NetworkPolicy
metadata :
name : {{ template "argo-cd.applicationSet.fullname" . }}
2023-04-18 16:35:01 +00:00
namespace : {{ .Release.Namespace | quote }}
2022-10-31 15:52:45 +00:00
labels :
{{- include "argo-cd.labels" (dict "context" . "component" .Values.applicationSet.name "name" .Values.applicationSet.name) | nindent 4 }}
spec :
ingress :
{{- if .Values.applicationSet.webhook.ingress.enabled }}
- ports :
- port : webhook
{{- end }}
{{- if .Values.applicationSet.metrics.enabled }}
- from :
- namespaceSelector : {}
ports :
- port : metrics
{{- end }}
podSelector :
matchLabels :
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.applicationSet.name) | nindent 6 }}
policyTypes :
- Ingress
{{- end }}