Support viewer
to target Shoot
cluster by fetching cluster CA via ConfigMap
#380
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR enables users with the
Project
viewer
role to target the Shoot cluster by fetching the cluster CA via the<shoot-name>.ca-cluster
ConfigMap
.To build the
gardenlogin
kubeconfig when targeting aShoot
cluster,gardenctl
needs to read the cluster CA. In earlier versions, this was obtained from a.ca-cluster
Secret
. However, starting from Gardenerv1.89
, the cluster CA is also reconciled as aConfigMap
. This update allows users with theviewer
role to read theConfigMap
, thereby facilitating the generation of thegardenlogin
kubeconfig.Side note:
gardenlogin
v0.5
or higher is designed to fetch credentials from two subresources:shoots/adminkubeconfig
andshoots/viewerkubeconfig
. By default, it retrieves credentials from theshoots/adminkubeconfig
subresource, providing full administrative access. Alternatively, it can fetch credentials from theshoots/viewerkubeconfig
subresource for read-only access.The plugin automatically adjusts the level of access for the fetched credentials. It first attempts to fetch admin-level credentials and, if unsuccessful, falls back to viewer-level credentials. This feature makes the
gardenlogin
kubeconfig versatile, as it can be used by both project admins and viewers without the need to specify the access level.Which issue(s) this PR fixes:
Fixes #381
Special notes for your reviewer:
ref gardener/gardener#9091
Release note: