github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/prometheus-pushgateway/templates/networkpolicy.yaml (about)

     1  {{- if .Values.networkPolicy }}
     2  apiVersion: {{ include "prometheus-pushgateway.networkPolicy.apiVersion" . }}
     3  kind: NetworkPolicy
     4  metadata:
     5    labels:
     6      {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }}
     7    {{- if .Values.networkPolicy.customSelectors }}
     8    name: ingress-allow-customselector-{{ template "prometheus-pushgateway.name" . }}
     9    {{- else if .Values.networkPolicy.allowAll }}
    10    name: ingress-allow-all-{{ template "prometheus-pushgateway.name" . }}
    11    {{- else -}}
    12    {{- fail "One of `allowAll` or `customSelectors` must be specified." }}
    13    {{- end }}
    14    namespace: {{ template "prometheus-pushgateway.namespace" . }}
    15  spec:
    16    podSelector:
    17      matchLabels:
    18        {{- include "prometheus-pushgateway.selectorLabels" . | nindent 6 }}
    19    ingress:
    20      - ports:
    21        - port: {{ .Values.service.targetPort }}
    22        {{- with .Values.networkPolicy.customSelectors }}
    23        from:
    24          {{- toYaml . | nindent 8 }}
    25        {{- end }}
    26  {{- end }}