Skip to content

Commit

Permalink
fix(base-cluster): add missing ciliumNetworkPolicy for cinder-csi-plu…
Browse files Browse the repository at this point in the history
…gin otherwise it can't talk to the openstack api 🤣 (#1114)
  • Loading branch information
cwrau authored Aug 21, 2024
1 parent 301a5da commit f33e5ad
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{{- 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
{{- 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 f33e5ad

Please sign in to comment.