Skip to content

Commit

Permalink
✨ Manage Security Groups using OpenStackClusterTemplate (#138)
Browse files Browse the repository at this point in the history
* Add security rules for Cilium

Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud>

* Remove the patch for allowAllInClusterTraffic when security groups are used

Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud>

---------

Signed-off-by: michal.gubricky <michal.gubricky@dnation.cloud>
  • Loading branch information
michal-gubricky authored Jul 19, 2024
1 parent 5553546 commit a516c90
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,6 @@ cre ate group names like oidc:engineering and oidc:infra."
path: "/spec/template/spec/securityGroups"
valueFrom:
template: {{ `"[ {{ range .openstack_security_groups }} { filter: { name: {{ . }}}}, {{ end }} ]"` }}
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: OpenStackClusterTemplate
matchResources:
infrastructureCluster: true
jsonPatches:
- op: replace
path: "/spec/template/spec/managedSecurityGroups/allowAllInClusterTraffic"
value: false
- name: cloud_name
description: "Sets the name of the cloud to use from the clouds secret."
enabledIf: {{ `'{{ ne .cloud_name "" }}'` }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,37 @@ spec:
allowedCIDRs: {{ .Values.restrict_kubeapi }}
{{- end }}
managedSecurityGroups:
allowAllInClusterTraffic: true
allNodesSecurityGroupRules:
- remoteManagedGroups:
- controlplane
- worker
direction: ingress
etherType: IPv4
name: VXLAN (Cilium)
portRangeMin: 8472
portRangeMax: 8472
protocol: udp
description: "Allow VXLAN traffic for Cilium"
- remoteManagedGroups:
- controlplane
- worker
direction: ingress
etherType: IPv4
name: HealthCheck (Cilium)
portRangeMin: 4240
portRangeMax: 4240
protocol: tcp
description: "Allow HealthCheck traffic for Cilium"
- remoteManagedGroups:
- controlplane
- worker
direction: ingress
etherType: IPv4
name: Hubble (Cilium)
portRangeMin: 4244
portRangeMax: 4244
protocol: tcp
description: "Allow Hubble traffic for Cilium"
managedSubnets:
- cidr: {{ .Values.node_cidr }}
dnsNameservers:
Expand Down

0 comments on commit a516c90

Please sign in to comment.