Skip to content

Commit 7421ae0

Browse files
authored
Merge pull request #57 from thalassa-cloud/kubernetes-security-groups
Kubernetes security groups
2 parents bb0d5aa + 21cc63c commit 7421ae0

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

kubernetes/types.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ type KubernetesVersion struct {
3939
Annotations map[string]string `json:"annotations"`
4040
// Whether this version is available for use
4141
Enabled bool `json:"enabled"`
42+
// Supported indicates if this version is currently supported / stable. This flag is used for auto upgrade policies and indicates stable versions.
43+
// After new versions are released, the old versions are marked as unsupported and cannot be used for auto upgrade policies.
44+
// You can still use them for manual upgrades should they be enabled, however it is recommend to upgrade to the next available supported version.
45+
Supported bool `json:"supported"`
4246

4347
// Core Kubernetes version
4448
KubernetesVersion string `json:"kubernetesVersion"`
@@ -91,6 +95,9 @@ type KubernetesCluster struct {
9195
AutoUpgradePolicy KubernetesClusterAutoUpgradePolicy `json:"autoUpgradePolicy"` // AutoUpgradePolicy is the auto upgrade policy for the cluster
9296
MaintenanceDay *uint `json:"maintenanceDay,omitempty"` // MaintenanceDay is the day of the week when the cluster will be upgraded. Optional.
9397
MaintenanceStartAt *uint `json:"maintenanceStartAt,omitempty"` // MaintenanceStartAt is the time of day when the cluster will be upgraded. Optional.
98+
99+
// SecurityGroups is a list of security groups that are attached to the Control Plane.
100+
SecurityGroups []iaas.SecurityGroup `json:"securityGroups,omitempty"`
94101
}
95102

96103
// CreateKubernetesCluster represents the configuration for creating a new Kubernetes cluster.
@@ -112,6 +119,9 @@ type CreateKubernetesCluster struct {
112119
AutoUpgradePolicy KubernetesClusterAutoUpgradePolicy `json:"autoUpgradePolicy"` // AutoUpgradePolicy is the auto upgrade policy for the cluster
113120
MaintenanceDay *uint `json:"maintenanceDay,omitempty"` // MaintenanceDay is the day of the week when the cluster will be upgraded. Optional.
114121
MaintenanceStartAt *uint `json:"maintenanceStartAt,omitempty"` // MaintenanceStartAt is the time of day when the cluster will be upgraded. Optional.
122+
123+
// SecurityGroupAttachments is a list of security group identities that will be attached to the Control Plane.
124+
SecurityGroupAttachments []string `json:"securityGroupAttachments,omitempty"`
115125
}
116126

117127
type KubernetesApiServerACLs struct {
@@ -151,6 +161,9 @@ type UpdateKubernetesCluster struct {
151161
AutoUpgradePolicy KubernetesClusterAutoUpgradePolicy `json:"autoUpgradePolicy"` // AutoUpgradePolicy is the auto upgrade policy for the cluster
152162
MaintenanceDay *uint `json:"maintenanceDay,omitempty"` // MaintenanceDay is the day of the week when the cluster will be upgraded. Optional.
153163
MaintenanceStartAt *uint `json:"maintenanceStartAt,omitempty"` // MaintenanceStartAt is the time of day when the cluster will be upgraded. Optional.
164+
165+
// SecurityGroupAttachments is a list of security group identities that will be attached to the Control Plane.
166+
SecurityGroupAttachments []string `json:"securityGroupAttachments,omitempty"`
154167
}
155168

156169
// KubernetesClusterNetworking represents the network configuration for a Kubernetes cluster.
@@ -228,6 +241,9 @@ type KubernetesNodePool struct {
228241
NodeSettings KubernetesNodeSettings `json:"nodeSettings"` // Node-specific settings
229242
KubernetesVersion *KubernetesVersion `json:"kubernetesVersion"` // Kubernetes version for node pool
230243
UpgradeStrategy KubernetesNodePoolUpgradeStrategy `json:"upgradeStrategy"` // Upgrade strategy for node pool
244+
245+
// SecurityGroups is a list of security groups that are attached to the nodes / vmi in the node pool.
246+
SecurityGroups []iaas.SecurityGroup `json:"securityGroups,omitempty"`
231247
}
232248

233249
// CreateKubernetesNodePool represents the configuration for creating a new node pool.
@@ -249,6 +265,9 @@ type CreateKubernetesNodePool struct {
249265
EnableAutoscaling bool `json:"enableAutoscaling"` // Whether to enable autoscaling
250266
EnableAutoHealing bool `json:"enableAutoHealing"` // Whether auto-healing is enabled
251267
NodeSettings KubernetesNodeSettings `json:"nodeSettings"` // Node-specific settings
268+
269+
// SecurityGroupAttachments is a list of security group identities that will be attached to the nodes / vmi in the node pool.
270+
SecurityGroupAttachments []string `json:"securityGroupAttachments,omitempty"`
252271
}
253272

254273
// UpdateKubernetesNodePool represents the configuration for updating an existing node pool.
@@ -269,6 +288,9 @@ type UpdateKubernetesNodePool struct {
269288
EnableAutoscaling *bool `json:"enableAutoscaling"` // Updated autoscaling setting
270289

271290
NodeSettings *KubernetesNodeSettings `json:"nodeSettings"` // Updated node settings
291+
292+
// SecurityGroupAttachments is a list of security group identities that will be attached to the nodes / vmi in the node pool.
293+
SecurityGroupAttachments []string `json:"securityGroupAttachments,omitempty"`
272294
}
273295

274296
// KubernetesNodeSettings represents the configuration settings for nodes in a node pool.

0 commit comments

Comments
 (0)