bcgov/document-generation-showcase

View on GitHub
charts/dgrsc/templates/networkpolicy.yaml

Summary

Maintainability
Test Coverage
{{- if .Values.networkPolicy.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-openshift-ingress-to-{{ include "dgrsc.fullname" . }}-app
  labels:
    {{- include "dgrsc.labels" . | nindent 4 }}
spec:
  ingress:
    - from:
        - namespaceSelector:
            matchLabels:
              network.openshift.io/policy-group: ingress
      ports:
        - port: {{ default "8080" .Values.config.configMap.SERVER_PORT | atoi }}
          protocol: TCP
  podSelector:
    matchLabels: {{- include "dgrsc.selectorLabels" . | nindent 6 }}
{{- end }}