Skip to content

Commit 328daba

Browse files
committed
WIP
1 parent f4efb31 commit 328daba

File tree

7 files changed

+30
-24
lines changed

7 files changed

+30
-24
lines changed

cmd/gardener-extension-provider-stackit/app/app.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,9 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command {
184184
configFileOpts.Completed().ApplyETCDStorage(&stackitseedprovider.DefaultAddOptions.ETCDStorage)
185185
configFileOpts.Completed().ApplyHealthCheckConfig(&healthcheck.DefaultAddOptions.HealthCheckConfig)
186186
configFileOpts.Completed().ApplyRegistryCaches(&stackitwebhookcontrolplane.DefaultAddOptions.RegistryCaches)
187-
configFileOpts.Completed().ApplyDeployALBIngressController(&stackitcontrolplane.DeployALBIngressController)
188187
configFileOpts.Completed().ApplyCustomLabelDomain(&stackitworker.DefaultAddOptions.CustomLabelDomain)
189188
configFileOpts.Completed().ApplyCustomLabelDomain(&stackitcontrolplane.DefaultAddOptions.CustomLabelDomain)
190189
configFileOpts.Completed().ApplyCustomLabelDomain(&stackitinfrastructure.DefaultAddOptions.CustomLabelDomain)
191-
log.Info("DeployALBIngressController?", "deploy", configFileOpts.Completed().Config.DeployALBIngressController)
192190

193191
bastionCtrlOpts.Completed().Apply(&stackitbastion.DefaultAddOptions.Controller)
194192
configFileOpts.Completed().ApplyCustomLabelDomain(&stackitbastion.DefaultAddOptions.CustomLabelDomain)

imagevector/images.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ images:
133133
tag: "v2.18.0"
134134

135135
- name: stackit-alb-controller-manager
136-
repository: reg3.infra.ske.eu01.stackit.cloud/temp/alb-controller-manager
137-
tag: "1245"
136+
repository: ghcr.io/stackitcloud/cloud-provider-stackit/application-load-balancer-controller-manager-dev
137+
tag: "v1.34.0-132-g612f42f"

pkg/apis/config/types.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ type ControllerConfiguration struct {
3131
// Deprecated: will be removed in a future version
3232
RegistryCaches []RegistryCacheConfiguration
3333

34-
// DeployALBIngressController
35-
DeployALBIngressController bool
36-
3734
// CustomLabelDomain is the domain prefix for custom labels applied to STACKIT infrastructure resources.
3835
// For example, cluster labels will use "<domain>/cluster" (default: "kubernetes.io").
3936
// NOTE: Only change this if you know what you are doing!!

pkg/cmd/config.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ func (c *Config) ApplyRegistryCaches(regCaches *[]config.RegistryCacheConfigurat
7575
*regCaches = c.Config.RegistryCaches
7676
}
7777

78-
func (c *Config) ApplyDeployALBIngressController(deployALBIngressController *bool) {
79-
*deployALBIngressController = c.Config.DeployALBIngressController
80-
}
81-
8278
// ApplyCustomLabelDomain sets the custom label domain configuration for infrastructure resources.
8379
func (c *Config) ApplyCustomLabelDomain(customLabelDomain *string) {
8480
*customLabelDomain = c.Config.CustomLabelDomain

pkg/controller/controlplane/add.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import (
2222
var (
2323
// DefaultAddOptions are the default AddOptions for AddToManager.
2424
DefaultAddOptions = AddOptions{}
25-
26-
DeployALBIngressController bool
2725
)
2826

2927
// AddOptions are options to apply when adding the OpenStack controlplane controller to the manager.
@@ -46,7 +44,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO
4644
genericActuator, err := genericactuator.NewActuator(mgr, stackit.Name,
4745
secretConfigsFunc, shootAccessSecretsFunc,
4846
configChart, controlPlaneChart, controlPlaneShootChart, controlPlaneShootCRDsChart, storageClassChart,
49-
NewValuesProvider(mgr, DeployALBIngressController, opts.CustomLabelDomain), extensionscontroller.ChartRendererFactoryFunc(util.NewChartRendererForShoot),
47+
NewValuesProvider(mgr, opts.CustomLabelDomain), extensionscontroller.ChartRendererFactoryFunc(util.NewChartRendererForShoot),
5048
imagevector.ImageVector(), "", nil, opts.WebhookServerNamespace)
5149
if err != nil {
5250
return err

pkg/controller/controlplane/valuesprovider.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,22 +333,20 @@ var (
333333
)
334334

335335
// NewValuesProvider creates a new ValuesProvider for the generic actuator.
336-
func NewValuesProvider(mgr manager.Manager, deployALBIngressController bool, customLabelDomain string) genericactuator.ValuesProvider {
336+
func NewValuesProvider(mgr manager.Manager, customLabelDomain string) genericactuator.ValuesProvider {
337337
return &valuesProvider{
338-
client: mgr.GetClient(),
339-
decoder: serializer.NewCodecFactory(mgr.GetScheme(), serializer.EnableStrict).UniversalDecoder(),
340-
deployALBIngressController: deployALBIngressController,
341-
customLabelDomain: customLabelDomain,
338+
client: mgr.GetClient(),
339+
decoder: serializer.NewCodecFactory(mgr.GetScheme(), serializer.EnableStrict).UniversalDecoder(),
340+
customLabelDomain: customLabelDomain,
342341
}
343342
}
344343

345344
// valuesProvider is a ValuesProvider that provides OpenStack-specific values for the 2 charts applied by the generic actuator.
346345
type valuesProvider struct {
347346
genericactuator.NoopValuesProvider
348-
client k8sclient.Client
349-
decoder runtime.Decoder
350-
deployALBIngressController bool
351-
customLabelDomain string
347+
client k8sclient.Client
348+
decoder runtime.Decoder
349+
customLabelDomain string
352350
}
353351

354352
// GetConfigChartValues returns the values for the config chart applied by the generic actuator.
@@ -732,7 +730,8 @@ func (vp *valuesProvider) getControlPlaneChartValues(ctx context.Context, cpConf
732730
openstack.STACKITCloudControllerManagerName: stackitccm,
733731
})
734732

735-
if vp.deployALBIngressController {
733+
if feature.StackitALBControllerManager(cluster) {
734+
// TODO(geberl) add a field in the shoot control plane provider option to enable the alb controller
736735
fmt.Println("deploying ALB Ingress Controller")
737736
albcm, err := getSTACKITALBCMChartValues(cpConfig, cluster, infra, stackitCredentialsConfig, apiEndpoints, scaledDown, stackitRegion)
738737
if err != nil {

pkg/feature/feature.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ const (
2222
UseSTACKITAPIInfrastructureController featuregate.Feature = "UseSTACKITAPIInfrastructureController"
2323
// UseSTACKITMachineControllerManager Uses the STACKIT machine controller Manager to manage nodes.
2424
UseSTACKITMachineControllerManager featuregate.Feature = "UseSTACKITMachineControllerManager"
25+
// STACKITALBControllerManager Enables the STACKIT ALP controller manager.
26+
STACKITALBControllerManager featuregate.Feature = "STACKITALBControllerManager"
2527
// ShootUseSTACKITMachineControllerManager Uses the STACKIT machine controller Manager to manage nodes for a specific Shoot.
2628
ShootUseSTACKITMachineControllerManager = "shoot.gardener.cloud/use-stackit-machine-controller-manager"
2729
// ShootUseSTACKITAPIInfrastructureController Uses the STACKIT API to create the shoot resources instead of OpenStack for a specific Shoot.
2830
ShootUseSTACKITAPIInfrastructureController = "shoot.gardener.cloud/use-stackit-api-infrastructure-controller"
31+
// ShootSTACKITALBControllerManager Enables the STACKIT ALP controller manager for a specific Shoot.
32+
ShootSTACKITALBControllerManager = "shoot.gardener.cloud/stackit-alb-controller-manager"
2933
)
3034

3135
var (
@@ -46,6 +50,7 @@ var (
4650
EnsureSTACKITLBDeletion: {Default: true, PreRelease: featuregate.Alpha},
4751
UseSTACKITAPIInfrastructureController: {Default: true, PreRelease: featuregate.Alpha},
4852
UseSTACKITMachineControllerManager: {Default: true, PreRelease: featuregate.Alpha},
53+
STACKITALBControllerManager: {Default: false, PreRelease: featuregate.Alpha},
4954
}
5055
)
5156

@@ -78,3 +83,16 @@ func UseStackitAPIInfrastructureController(cluster *extensionscontroller.Cluster
7883
}
7984
return Gate.Enabled(UseSTACKITAPIInfrastructureController)
8085
}
86+
87+
func StackitALBControllerManager(cluster *extensionscontroller.Cluster) bool {
88+
if cluster != nil && cluster.Shoot != nil {
89+
annotation, ok := cluster.Shoot.Annotations[ShootSTACKITALBControllerManager]
90+
if ok {
91+
enabledByAnnotation, err := strconv.ParseBool(annotation)
92+
if err == nil {
93+
return enabledByAnnotation
94+
}
95+
}
96+
}
97+
return Gate.Enabled(STACKITALBControllerManager)
98+
}

0 commit comments

Comments
 (0)