Skip to content

Commit

Permalink
Merge pull request #2353 from stackhpc/feat/node-specific-secgroup-rules
Browse files Browse the repository at this point in the history
🌱 Support for additional controlplane and worker secgroup rules
  • Loading branch information
k8s-ci-robot authored Jan 9, 2025
2 parents 880a5f6 + ce85e03 commit 16baa32
Show file tree
Hide file tree
Showing 13 changed files with 534 additions and 19 deletions.
2 changes: 2 additions & 0 deletions api/v1alpha6/openstackcluster_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func restorev1beta1ClusterSpec(previous *infrav1.OpenStackClusterSpec, dst *infr

if previous.ManagedSecurityGroups != nil && dst.ManagedSecurityGroups != nil {
dst.ManagedSecurityGroups.AllNodesSecurityGroupRules = previous.ManagedSecurityGroups.AllNodesSecurityGroupRules
dst.ManagedSecurityGroups.ControlPlaneNodesSecurityGroupRules = previous.ManagedSecurityGroups.ControlPlaneNodesSecurityGroupRules
dst.ManagedSecurityGroups.WorkerNodesSecurityGroupRules = previous.ManagedSecurityGroups.WorkerNodesSecurityGroupRules
}

if dst.APIServerLoadBalancer != nil && previous.APIServerLoadBalancer != nil {
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha7/openstackcluster_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ func restorev1beta1ClusterSpec(previous *infrav1.OpenStackClusterSpec, dst *infr

if previous.ManagedSecurityGroups != nil && dst.ManagedSecurityGroups != nil {
dst.ManagedSecurityGroups.AllNodesSecurityGroupRules = previous.ManagedSecurityGroups.AllNodesSecurityGroupRules
dst.ManagedSecurityGroups.ControlPlaneNodesSecurityGroupRules = previous.ManagedSecurityGroups.ControlPlaneNodesSecurityGroupRules
dst.ManagedSecurityGroups.WorkerNodesSecurityGroupRules = previous.ManagedSecurityGroups.WorkerNodesSecurityGroupRules
}

if dst.APIServerLoadBalancer != nil && previous.APIServerLoadBalancer != nil {
Expand Down
16 changes: 16 additions & 0 deletions api/v1beta1/openstackcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,22 @@ type ManagedSecurityGroups struct {
// +optional
AllNodesSecurityGroupRules []SecurityGroupRuleSpec `json:"allNodesSecurityGroupRules,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

// controlPlaneNodesSecurityGroupRules defines the rules that should be applied to control plane nodes.
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
// +optional
ControlPlaneNodesSecurityGroupRules []SecurityGroupRuleSpec `json:"controlPlaneNodesSecurityGroupRules,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

// workerNodesSecurityGroupRules defines the rules that should be applied to worker nodes.
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
// +optional
WorkerNodesSecurityGroupRules []SecurityGroupRuleSpec `json:"workerNodesSecurityGroupRules,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

// AllowAllInClusterTraffic allows all ingress and egress traffic between cluster nodes when set to true.
// +kubebuilder:default=false
// +kubebuilder:validation:Required
Expand Down
14 changes: 14 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions cmd/models-schema/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 16baa32

Please sign in to comment.