Skip to content

Commit 261f36a

Browse files
committed
feat(controlplane): hide pod identity webhook through a new feature gate EnableSTACKITWorkloadIdentity
1 parent c9b9220 commit 261f36a

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

charts/gardener-extension-provider-stackit/values.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ config:
7777
# Must be base64 encoded
7878
caBundle: ""
7979
registryCaches:
80-
# - server: reg.example.com
81-
# cache: reg-cache.example.com
82-
# caBundle: LS0tLS1C... #b64 encoded CA bundle, optional
83-
# capabilities: ["pull", "resolve"]
84-
# deployALBIngressController: true
80+
# - server: reg.example.com
81+
# cache: reg-cache.example.com
82+
# caBundle: LS0tLS1C... #b64 encoded CA bundle, optional
83+
# capabilities: ["pull", "resolve"]
84+
# deployALBIngressController: true
8585
gardener:
8686
version: ""
8787
gardenlet:
@@ -98,5 +98,5 @@ usablePorts:
9898
- 8081 # health
9999
- 10250 # webhook server
100100

101-
featureGates: {}
102-
# NoopFeature: false
101+
featureGates:
102+
EnableSTACKITWorkloadIdentity: false

charts/internal/seed-controlplane/requirements.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ dependencies:
2222
- name: stackit-pod-identity-webhook
2323
repository: http://localhost:10191
2424
version: 0.1.0
25+
condition: stackit-pod-identity-webhook.enabled

charts/internal/shoot-system-components/requirements.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ dependencies:
1818
- name: stackit-pod-identity-webhook
1919
repository: http://localhost:10191
2020
version: 0.1.0
21+
condition: stackit-pod-identity-webhook.enabled

pkg/controller/controlplane/valuesprovider.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,7 @@ func getPodIdentityWebhookChartValues(
13091309
}
13101310

13111311
return map[string]any{
1312+
"enabled": feature.Gate.Enabled(feature.EnableSTACKITWorkloadIdentity),
13121313
"replicaCount": extensionscontroller.GetControlPlaneReplicas(cluster, scaledDown, 1),
13131314
"webhook": map[string]any{
13141315
"tlsSecretName": tlsSecret.Name,
@@ -1331,6 +1332,7 @@ func (vp *valuesProvider) getPodIdentityWebhookShootChartValues(
13311332
}
13321333

13331334
return map[string]any{
1335+
"enabled": feature.Gate.Enabled(feature.EnableSTACKITWorkloadIdentity),
13341336
"webhook": map[string]any{
13351337
"caBundle": caBundle,
13361338
"url": fmt.Sprintf("https://%s.%s:443/mutate--v1-pod", stackit.PodIdentityWebhookName, controlPlaneNamespace),

pkg/controller/controlplane/valuesprovider_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ var _ = Describe("ValuesProvider", func() {
497497
})
498498

499499
stackitPodIdentityWebhookChartSeedValues := map[string]any{
500+
"enabled": false,
500501
"replicaCount": 1,
501502
"webhook": map[string]any{
502503
"tlsSecretName": stackitPodIdentityWebhookServerName,
@@ -893,6 +894,7 @@ var _ = Describe("ValuesProvider", func() {
893894

894895
Describe("#GetControlPlaneShootChartValues", func() {
895896
stackitPodIdentityWebhookChartShootValues := map[string]any{
897+
"enabled": false,
896898
"webhook": map[string]any{
897899
"caBundle": []byte("fake-ca-cert"),
898900
"url": fmt.Sprintf("https://stackit-pod-identity-webhook.%s:443/mutate--v1-pod", namespace),

pkg/feature/feature.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const (
1414
// // MyFeature enables Foo.
1515
// MyFeature featuregate.Feature = "MyFeature"
1616

17-
// MutateDisableNTP enables the mutation that disables NTP if any worker's flatcar image version is greater than or eqaul to `FlatcarImageVersion`
17+
// MutateDisableNTP enables the mutation that disables NTP if any worker's flatcar image version is greater than or equal to `FlatcarImageVersion`
1818
MutateDisableNTP featuregate.Feature = "MutateDisableNTP"
1919
// EnsureSTACKITLBDeletion enables the STACKIT LB deletion cleanup. The function checks for dangling/zombied LB's and then tries to delete them.
2020
EnsureSTACKITLBDeletion featuregate.Feature = "EnsureSTACKITLBDeletion"
@@ -26,6 +26,8 @@ const (
2626
ShootUseSTACKITMachineControllerManager = "shoot.gardener.cloud/use-stackit-machine-controller-manager"
2727
// ShootUseSTACKITAPIInfrastructureController Uses the STACKIT API to create the shoot resources instead of OpenStack for a specific Shoot.
2828
ShootUseSTACKITAPIInfrastructureController = "shoot.gardener.cloud/use-stackit-api-infrastructure-controller"
29+
// EnableSTACKITWorkloadIdentity activates the deployment of the stackit-pod-identity-webhook to enable workload identity injection into pods.
30+
EnableSTACKITWorkloadIdentity featuregate.Feature = "EnableSTACKITWorkloadIdentity"
2931
)
3032

3133
var (
@@ -46,6 +48,7 @@ var (
4648
EnsureSTACKITLBDeletion: {Default: true, PreRelease: featuregate.Alpha},
4749
UseSTACKITAPIInfrastructureController: {Default: true, PreRelease: featuregate.Alpha},
4850
UseSTACKITMachineControllerManager: {Default: true, PreRelease: featuregate.Alpha},
51+
EnableSTACKITWorkloadIdentity: {Default: false, PreRelease: featuregate.Alpha},
4952
}
5053
)
5154

0 commit comments

Comments
 (0)