Skip to content

Commit

Permalink
Add Firewall Rules to Cluster Nodes
Browse files Browse the repository at this point in the history
At present you cannot add ephemeral rules to security groups for debug
as that will ultimately get reverted and drive you insane, so allow the
client to set some up e.g. SSH access for debugging.
  • Loading branch information
spjmurray committed Sep 2, 2024
1 parent 7080a20 commit 9e859e2
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/cluster-api-cluster-openstack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: cluster-api-cluster-openstack
description: A Helm chart to deploy a Kubernetes Cluster
type: application
version: v0.5.4
version: v0.5.5
icon: https://raw.githubusercontent.com/unikorn-cloud/helm-cluster-api/main/icons/default.png
4 changes: 4 additions & 0 deletions charts/cluster-api-cluster-openstack/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ spec:
{{- end }}
managedSecurityGroups:
allowAllInClusterTraffic: true
{{- if .Values.network.securityGroupRules }}
allNodesSecurityGroupRules:
{{- toYaml .Values.network.securityGroupRules | nindent 4 }}
{{- end }}
{{- if .Values.network.provider }}
network:
id: {{ .Values.network.provider.networkID }}
Expand Down
41 changes: 41 additions & 0 deletions charts/cluster-api-cluster-openstack/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,47 @@
"type": "string"
}
}
},
"securityGroupRules": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"direction"
],
"properties": {
"name": {
"type": "string"
},
"direction": {
"type": "string",
"enum": [
"ingress",
"egress"
]
},
"etherType": {
"type": "string",
"enum": [
"IPv4",
"IPv6"
]
},
"protocol": {
"type": "string",
"enum": [
"TCP"
]
},
"portRangeMin": {
"type": "integer"
},
"portRangeMax": {
"type": "integer"
}
}
}
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions charts/cluster-api-cluster-openstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,12 @@ network:
# provider:
# networkID: 8f526b54-fab3-435d-b4b3-f65fd8474b8a
# subnetID: e3b15dd0-17e4-47c0-bc6c-1b8ea1f1018f

# If specified these security group rules are added to all nodes.
# securityGroupRules:
# - name: ssh-ingress
# direction: ingress
# etherType: IPv4
# protocol: TCP
# portRangeMin: 22
# portRangeMax: 22

0 comments on commit 9e859e2

Please sign in to comment.