Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLT-1246] [GKE] Soportar CMEK para los discos root de los workers #32

Merged
merged 5 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.6.1-0.2.1 (upcoming)

* [PLT-1246] CMEK Support

## 1.6.1-0.2.0 (2024-10-24)

* [PLT-965] Disable managed Monitoring and Logging
Expand Down
7 changes: 7 additions & 0 deletions cloud/scope/managedmachinepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func ConvertToSdkNodePool(nodePool infrav1exp.GCPManagedMachinePool, machinePool
ResourceLabels: NodePoolResourceLabels(nodePool.Spec.AdditionalLabels, clusterName),
},
}

if nodePool.Spec.MachineType != nil {
sdkNodePool.Config.MachineType = *nodePool.Spec.MachineType
}
Expand All @@ -218,6 +219,9 @@ func ConvertToSdkNodePool(nodePool infrav1exp.GCPManagedMachinePool, machinePool
if nodePool.Spec.LinuxNodeConfig != nil {
sdkNodePool.Config.LinuxNodeConfig = infrav1exp.ConvertToSdkLinuxNodeConfig(nodePool.Spec.LinuxNodeConfig)
}
if nodePool.Spec.BootDiskKmsKey != "" {
sdkNodePool.Config.BootDiskKmsKey = nodePool.Spec.BootDiskKmsKey
}
if nodePool.Spec.Management != nil {
sdkNodePool.Management = &containerpb.NodeManagement{
AutoRepair: nodePool.Spec.Management.AutoRepair,
Expand All @@ -241,6 +245,9 @@ func ConvertToSdkNodePool(nodePool infrav1exp.GCPManagedMachinePool, machinePool
if nodePool.Spec.DiskSizeGB != nil {
sdkNodePool.Config.DiskSizeGb = int32(*nodePool.Spec.DiskSizeGB)
}
if nodePool.Spec.BootDiskKmsKey != "" {
sdkNodePool.Config.BootDiskKmsKey = nodePool.Spec.BootDiskKmsKey
}
if len(nodePool.Spec.NodeNetwork.Tags) != 0 {
sdkNodePool.Config.Tags = nodePool.Spec.NodeNetwork.Tags
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ spec:
AdditionalLabels is an optional set of tags to add to GCP resources managed by the GCP provider, in addition to the
ones added by default.
type: object
bootDiskKmsKey:
description: BootDiskKmsKey is the name of the key used to encrypt
the boot disk.
type: string
diskSizeGB:
description: |-
DiskSizeGB is size of the disk attached to each node,
Expand Down
2 changes: 2 additions & 0 deletions exp/api/v1beta1/gcpmanagedmachinepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ type GCPManagedMachinePoolSpec struct {
// machine pool
// +optional
ProviderIDList []string `json:"providerIDList,omitempty"`
// BootDiskKmsKey is the name of the key used to encrypt the boot disk.
BootDiskKmsKey string `json:"bootDiskKmsKey,omitempty"`
}

// NodeNetworkConfig encapsulates node network configurations.
Expand Down