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

controller-manager does not respect config.server.https #4605

Closed
Tracked by #4251
timebertt opened this issue Sep 3, 2021 · 5 comments · Fixed by #6333
Closed
Tracked by #4251

controller-manager does not respect config.server.https #4605

timebertt opened this issue Sep 3, 2021 · 5 comments · Fixed by #6333
Labels

Comments

@timebertt
Copy link
Member

How to categorize this issue?

/kind bug

What happened:

When configuring ControllerManagerConfiguration.server.https (

// HTTPS is the configuration for the HTTPS server.
HTTPS HTTPSServer `json:"https"`
), it is simply ignored by gardener-controller-manager

go server.
NewBuilder().
WithBindAddress(g.Config.Server.HTTP.BindAddress).
WithPort(g.Config.Server.HTTP.Port).
WithHandler("/metrics", promhttp.Handler()).
WithHandlerFunc("/healthz", healthz.HandlerFunc(healthManager)).
Build().
Start(ctx)

and no HTTPS handler is started using the provided configuration.

What you expected to happen:

controller-manager to respect the configuration options just like gardenlet:

// Start HTTPS server.
if g.Config.Server.HTTPS.TLS == nil {
g.Logger.Info("No TLS server certificates provided... self-generating them now...")
_, _, tempDir, err := secrets.SelfGenerateTLSServerCertificate("gardenlet", []string{
"gardenlet",
fmt.Sprintf("gardenlet.%s", v1beta1constants.GardenNamespace),
fmt.Sprintf("gardenlet.%s.svc", v1beta1constants.GardenNamespace),
}, nil)
if err != nil {
return err
}
g.Config.Server.HTTPS.TLS = &config.TLSServer{
ServerCertPath: filepath.Join(tempDir, secrets.DataKeyCertificate),
ServerKeyPath: filepath.Join(tempDir, secrets.DataKeyPrivateKey),
}
g.Logger.Info("TLS server certificates successfully self-generated.")
}
go server.
NewBuilder().
WithBindAddress(g.Config.Server.HTTPS.BindAddress).
WithPort(g.Config.Server.HTTPS.Port).
WithTLS(g.Config.Server.HTTPS.TLS.ServerCertPath, g.Config.Server.HTTPS.TLS.ServerKeyPath).
WithHandler("/metrics", promhttp.Handler()).
WithHandlerFunc("/healthz", healthz.HandlerFunc(g.HealthManager)).
Build().
Start(ctx)

@timebertt
Copy link
Member Author

depends on the decision in #2829

@gardener-ci-robot
Copy link
Contributor

The Gardener project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed
    You can:
  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close

/lifecycle stale

@gardener-prow gardener-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 30, 2022
@rfranzke
Copy link
Member

/remove-lifecycle rotten

@rfranzke rfranzke removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 30, 2022
@gardener-ci-robot
Copy link
Contributor

The Gardener project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close

/lifecycle stale

@gardener-prow gardener-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 28, 2022
@timebertt
Copy link
Member Author

/remove-lifecycle stale

@gardener-prow gardener-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 29, 2022
timebertt added a commit to timebertt/gardener that referenced this issue Jul 14, 2022
https was never working, ref gardener#4605
The config structure is similar to admission-controller now and fits to
the manager.Options structure as well.
timebertt added a commit to timebertt/gardener that referenced this issue Jul 14, 2022
https was never working, ref gardener#4605
The config structure is similar to admission-controller now and fits to
the manager.Options structure as well.
timebertt added a commit to timebertt/gardener that referenced this issue Jul 14, 2022
https was never working, ref gardener#4605
The config structure is similar to admission-controller now and fits to
the manager.Options structure as well.

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>
timebertt added a commit to timebertt/gardener that referenced this issue Jul 15, 2022
https was never working, ref gardener#4605
The config structure is similar to admission-controller now and fits to
the manager.Options structure as well.

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>
timebertt added a commit to timebertt/gardener that referenced this issue Jul 15, 2022
https was never working, ref gardener#4605
The config structure is similar to admission-controller now and fits to
the manager.Options structure as well.

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>
timebertt added a commit to timebertt/gardener that referenced this issue Jul 15, 2022
https was never working, ref gardener#4605
The config structure is similar to admission-controller now and fits to
the manager.Options structure as well.

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>
gardener-prow bot pushed a commit that referenced this issue Jul 15, 2022
… `CloudProfile` controller (#6333)

* Drop broken `kubernetesLogLevel` setting

The configuration option wasn't effective, drop it instead of fixing it.

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>

* Rework entrypoint package and introduce c-r manager

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>

* Rework ControllerManagerConfiguration server settings

https was never working, ref #4605
The config structure is similar to admission-controller now and fits to
the manager.Options structure as well.

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>

* Transform garden cluster bootstrapping into runnable

* Add `test.FakeManager`

* Transform factory for legacy controllers into runnable

Co-Authored-By: Rafael Franzke <rafael.franzke@sap.com>

* Get clients from manager instead of clientmap

* Allow creating PlantClientMap with plain c-r reader

This will be used to create a standalone PlantClientMap for the plant controller
with the client from the c-r manager.

* Create standalone clientmap in plant controller

* Disable cached client for plants

* Refactor cloudprofile controller to controller-runtime

* Set `RecoverPanic` for new controller

* Adapt PlantClientMap test

* Nits

* Use controller name for event recorders

* Comment about disabled cache for plants

Co-authored-by: Rafael Franzke <rafael.franzke@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants