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

admission-gcp: Adapt Secrets webhook to rely on the provider label #396

Merged

Conversation

ialidzhikov
Copy link
Member

@ialidzhikov ialidzhikov commented Feb 22, 2022

/area robustness
/area cost
/kind enhancement
/platform gcp

This PR adapts the Secrets webhook to rely on the provider type label (that is maintained by GCM). With this the Secrets webhook:

  • no longer intercepts every Secret UPDATE request but only requests for Secrets with label provider.shoot.gardener.cloud/gcp="true"
  • no longer needs to list Shoots (hence, no longer has a cache for Shoots based on Informers) to understand whether a Secret is in-use by a Shoot from the same provider type ("gcp")

Ref gardener/gardener#4888

I think the component can be still improved to prevent get request (and cache) for SecretBindings - currently the Shoot validator on Shoot creation gets the SecretBinding -> the the Secret and validates the cloud provider Secret. This can be potentially moved to a new webhook for SecretBindings (when the SecretBindingProviderValidator feature gate is promoted to GA) and this get request (and cache) can be eliminated.

Part of #143

Special notes for your reviewer:

Release note:

This version of admission-gcp requires the SecretBinding provider controller to be enabled - enabled by default for gardener-controller-manager >= 1.42 or can be enabled via the gardener-controller-manager component config.
The Secrets webhook of admission-gcp:
- no longer intercepts every Secret UPDATE request but only requests for Secrets that are associated with a SecretBinding with `provider.type=gcp`.
- no longer needs to list Shoots (hence, no cache for Shoots)

@gardener-robot gardener-robot added area/cost Cost related area/robustness Robustness, reliability, resilience related kind/enhancement Enhancement, improvement, extension platform/gcp Google cloud platform/infrastructure needs/review Needs review size/s Size of pull request is small (see gardener-robot robot/bots/size.py) labels Feb 22, 2022
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 22, 2022
@gardener-robot-ci-2 gardener-robot-ci-2 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Feb 22, 2022
@timebertt
Copy link
Member

Nice work @ialidzhikov!

Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>
@ialidzhikov ialidzhikov force-pushed the enh/cloudprovider-secret-label branch from 85c195d to de46c53 Compare March 8, 2022 08:03
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 8, 2022
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Mar 8, 2022
@ialidzhikov ialidzhikov marked this pull request as ready for review March 8, 2022 08:31
@ialidzhikov ialidzhikov requested review from a team as code owners March 8, 2022 08:31
@kon-angelo kon-angelo added this to the v1.22 milestone Mar 16, 2022
Copy link
Contributor

@kon-angelo kon-angelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cost Cost related area/robustness Robustness, reliability, resilience related kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) platform/gcp Google cloud platform/infrastructure reviewed/lgtm Has approval for merging size/s Size of pull request is small (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants