27 lines
559 B
YAML
27 lines
559 B
YAML
---
|
|
kind: CiliumNetworkPolicy
|
|
apiVersion: cilium.io/v2
|
|
metadata:
|
|
name: {{.app.Name}}
|
|
namespace: {{.app.Namespace.Name}}
|
|
labels: {{ .labels | toYaml | nindent 4 }}
|
|
spec:
|
|
endpointSelector: {{ .app.MatchLabels | toYaml | nindent 4 }}
|
|
{{- if .ingress }}
|
|
ingress:
|
|
- fromEntities:
|
|
- kube-apiserver
|
|
# See https://github.com/cilium/cilium/issues/35401
|
|
- remote-node
|
|
{{- end }}
|
|
{{- if .egress }}
|
|
egress:
|
|
- toEntities:
|
|
- kube-apiserver
|
|
- toPorts:
|
|
- ports:
|
|
- port: "6443"
|
|
protocol: TCP
|
|
{{- end }}
|
|
|