refactor: move cilium policies to kyverno
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
{{- if and (.Values.kyverno.enabled) (.Values.clusterConfig.cilium.enabled) }}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:generate-cilium-networkpolicies
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- cilium.io
|
||||||
|
resources:
|
||||||
|
- ciliumnetworkpolicies
|
||||||
|
verbs:
|
||||||
|
- "*"
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kyverno:generate-cilium-networkpolicies
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:generate-cilium-networkpolicies
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno
|
||||||
|
namespace: kyverno
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-background-controller
|
||||||
|
namespace: kyverno
|
||||||
|
{{- end }}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{- if .Values.clusterConfig.cilium.enabled }}
|
||||||
apiVersion: cilium.io/v2
|
apiVersion: cilium.io/v2
|
||||||
kind: CiliumNetworkPolicy
|
kind: CiliumNetworkPolicy
|
||||||
metadata:
|
metadata:
|
||||||
@@ -13,3 +14,4 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
endpointSelector:
|
endpointSelector:
|
||||||
matchLabels: {}
|
matchLabels: {}
|
||||||
|
{{- end }}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
{{- if .Values.clusterConfig.cilium.enabled }}
|
||||||
apiVersion: cilium.io/v2
|
apiVersion: cilium.io/v2
|
||||||
kind: CiliumNetworkPolicy
|
kind: CiliumNetworkPolicy
|
||||||
metadata:
|
metadata:
|
||||||
@@ -15,3 +16,4 @@ spec:
|
|||||||
- ports:
|
- ports:
|
||||||
- port: "8000"
|
- port: "8000"
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
|
|||||||
+2
@@ -1,3 +1,4 @@
|
|||||||
|
{{- if .Values.clusterConfig.cilium.enabled }}
|
||||||
apiVersion: cilium.io/v2
|
apiVersion: cilium.io/v2
|
||||||
kind: CiliumNetworkPolicy
|
kind: CiliumNetworkPolicy
|
||||||
metadata:
|
metadata:
|
||||||
@@ -10,3 +11,4 @@ spec:
|
|||||||
ingress:
|
ingress:
|
||||||
- fromEntities:
|
- fromEntities:
|
||||||
- remote-node
|
- remote-node
|
||||||
|
{{- end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user