Skip to content
Snippets Groups Projects
Commit 705cd6d1 authored by Andri Joos's avatar Andri Joos :blush:
Browse files

add calico networkpolicy template

parent 74b44d8a
No related branches found
No related tags found
No related merge requests found
Pipeline #7779 passed with stages
in 37 seconds
# https://docs.tigera.io/calico/latest/network-policy/get-started/calico-policy/calico-network-policy
{{- define "common.calico.networkpolicy" -}}
apiVersion: projectcalico.org/v3
kind: NetworkPolicy
metadata:
name: {{ .Values.name | default "network-policy" | quote }}
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "common.variables.labels" . | nindent 4 }}
spec:
{{- with .Values.selector }}
selector:
{{- toYaml . | nindent 4 }}
{{- end }}
types:
{{- .Values.types | default (list) | toYaml | nindent 4 }}
{{- with .Values.ingress }}
ingress:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.egress }}
egress:
{{- toYaml . | nindent 4 }}
{{- end }}
---
{{- end }}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment