Skip to content

Commit

Permalink
fix(base-cluster): add missing ciliumNetworkPolicy for cinder-csi-plugin
Browse files Browse the repository at this point in the history
otherwise it can't talk to the openstack api 🤣
  • Loading branch information
cwrau committed Aug 19, 2024
1 parent 29d5834 commit 40201ec
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if eq (include "t8s-cluster.cni" .) "cilium" -}}
{{- include "t8s-cluster.helm.resourceIntoCluster" (dict "name" "openstack-cinder-csi" "resource" (include "t8s-cluster.networkPolicy.cinder-csi" (dict)) "context" $ "additionalLabels" (dict "app.kubernetes.io/component" "cinder-csi")) | nindent 0 }}
{{- end }}

{{- define "t8s-cluster.networkPolicy.cinder-csi" -}}
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: openstack-cinder-csi
namespace: kube-system
labels: {{- include "common.helm.labels" (dict) | nindent 4 }}
spec:
endpointSelector:
matchLabels:
app: openstack-cinder-csi
ingress:
- fromEntities:
- health
toPorts:
- ports:
- port: "9808"
protocol: TCP
egress:
- toEndpoints:
- matchLabels:
io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
rules:
dns:
- matchPattern: "*"
- toEntities:
- world # this is the placeholder for the openstack api, as we don't want to pin specific DNS names
- toEntities:
- kube-apiserver
toPorts:
- ports:
- port: "6443"
protocol: TCP
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ printf "%s-csi" .Release.Name }}
namespace: {{ .Release.Namespace}}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: cinder-csi
spec:
chart:
spec:
Expand Down

0 comments on commit 40201ec

Please sign in to comment.