Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBurger authored and Gardener CI/CD committed Oct 24, 2024
1 parent 6f90ebf commit c7f1c09
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ spec:
- --leader-election-namespace=kube-system
- --handle-volume-inuse-error=false
{{- if ((.Values.csiResizer).featureGates) }}
- -feature-gates={{ range $feature, $enabled := .Values.csiResizer.featureGates }}{{ $feature }}={{ $enabled }},{{ end }}
- --feature-gates={{ range $feature, $enabled := .Values.csiResizer.featureGates }}{{ $feature }}={{ $enabled }},{{ end }}
{{- end }}
- --v=5
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ csiSnapshotController:
cpu: 11m
memory: 32Mi

csiProvisioner:
featureGates:
Topology: true

csiSnapshotValidationWebhook:
replica: 1
podAnnotations: {}
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ Every GCP shoot cluster will be deployed with the GCP PD CSI driver.
It is compatible with the legacy in-tree volume provisioner that was deprecated by the Kubernetes community and will be removed in future versions of Kubernetes.
End-users might want to update their custom `StorageClass`es to the new `pd.csi.storage.gke.io` provisioner.

## Support for VolumeAttributeClasses (Beta in k8s 1.31)
## Support for VolumeAttributesClasses (Beta in k8s 1.31)

To have the CSI-Driver configured to support the necessary features for [VolumeAttributeClasses](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/) on GCP for shoots with a k8s-version greater than 1.31, use the `gcp.provider.extensions.gardener.cloud/enable-volume-attributes-class` annotation on the shoot. Keep in mind to also enable the required feature flags and runtime-config on the common kubernetes controllers (as outlined in the link above) in the shoot-spec.
To have the CSI-driver configured to support the necessary features for [VolumeAttributesClasses](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/) on GCP for shoots with a k8s-version greater than 1.31, use the `gcp.provider.extensions.gardener.cloud/enable-volume-attributes-class` annotation on the shoot. Keep in mind to also enable the required feature flags and runtime-config on the common kubernetes controllers (as outlined in the link above) in the shoot-spec.

## Kubernetes Versions per Worker Pool

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
go.uber.org/atomic v1.11.0
go.uber.org/mock v0.4.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/mod v0.21.0
golang.org/x/oauth2 v0.22.0
golang.org/x/tools v0.25.0
google.golang.org/api v0.187.0
Expand Down Expand Up @@ -134,7 +135,6 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.27.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.25.0 // indirect
Expand Down
38 changes: 19 additions & 19 deletions pkg/controller/controlplane/valuesprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
secretutils "github.com/gardener/gardener/pkg/utils/secrets"
secretsmanager "github.com/gardener/gardener/pkg/utils/secrets/manager"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"golang.org/x/mod/semver"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -476,27 +477,26 @@ func getCSIControllerChartValues(
},
}

csiProvisionerFeatureGates := map[string]string{
"Topology": "true",
}

if _, ok := cluster.Shoot.Annotations[gcp.AnnotationEnableModifyVolume]; ok {
csiProvisionerFeatureGates["VolumeAttributesClass"] = "true"
values["csiDriver"] = map[string]interface{}{
"storage": map[string]interface{}{
"supportsDynamicIopsProvisioning": []string{"hyperdisk-balanced", "hyperdisk-extreme"},
"supportsDynamicThroughputProvisioning": []string{"hyperdisk-balanced", "hyperdisk-throughput", "hyperdisk-ml"},
},
}
values["csiResizer"] = map[string]interface{}{
"featureGates": map[string]string{
"VolumeAttributesClass": "true",
},
if semver.Compare(cluster.Shoot.Spec.Kubernetes.Version, "1.30.0") > 0 {
if _, ok := cluster.Shoot.Annotations[gcp.AnnotationEnableVolumeAttributesClass]; ok {
values["csiDriver"] = map[string]interface{}{
"storage": map[string]interface{}{
"supportsDynamicIopsProvisioning": []string{"hyperdisk-balanced", "hyperdisk-extreme"},
"supportsDynamicThroughputProvisioning": []string{"hyperdisk-balanced", "hyperdisk-throughput", "hyperdisk-ml"},
},
}
values["csiResizer"] = map[string]interface{}{
"featureGates": map[string]string{
"VolumeAttributesClass": "true",
},
}
values["csiProvisioner"] = map[string]interface{}{
"featureGates": map[string]string{
"VolumeAttributesClass": "true",
},
}
}
}

values["csiProvisioner"] = map[string]interface{}{
"featureGates": csiProvisionerFeatureGates,
}

return values, nil
Expand Down
5 changes: 0 additions & 5 deletions pkg/controller/controlplane/valuesprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,6 @@ var _ = Describe("ValuesProvider", func() {
},
"topologyAwareRoutingEnabled": false,
},
"csiProvisioner": map[string]interface{}{
"featureGates": map[string]string{
"Topology": "true",
},
},
}),
}))
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/gcp/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const (
SeedAnnotationKeyUseFlow = AnnotationKeyUseFlow
// SeedAnnotationUseFlowValueNew is the value to restrict flow reconciliation to new shoot clusters
SeedAnnotationUseFlowValueNew = "new"
// AnnotationEnableModifyVolume is the annotation to use when enabling the modify-volume feature (VolumeAttributesClass)
AnnotationEnableModifyVolume = "gcp.provider.extensions.gardener.cloud/enable-volume-attributes-class"
// AnnotationEnableVolumeAttributesClass is the annotation to use on shoots to enable VolumeAttributesClasses
AnnotationEnableVolumeAttributesClass = "gcp.provider.extensions.gardener.cloud/enable-volume-attributes-class"
)

var (
Expand Down

0 comments on commit c7f1c09

Please sign in to comment.