-
Notifications
You must be signed in to change notification settings - Fork 85
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
[GEP-26] Workload Identity support #855
base: master
Are you sure you want to change the base?
[GEP-26] Workload Identity support #855
Conversation
@dimityrmirchev Label ipcei/workload-identity does not exist. |
@dimityrmirchev Label ipcei/workload-identity does not exist. |
@dimityrmirchev Label ipcei/workload-identity does not exist. |
@dimityrmirchev You need rebase this pull request with latest master branch. Please check. |
b58c085
to
f9ae6d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some preliminary findings, I will need to take a second look (do not know if the change can be split into several PRs to ease the review).
pkg/admission/validator/webhook.go
Outdated
}, | ||
Target: extensionswebhook.TargetSeed, | ||
ObjectSelector: &metav1.LabelSelector{ | ||
MatchLabels: map[string]string{"provider.shoot.gardener.cloud/gcp": "true"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think the label is set on Workloadidentities, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but that is valid only for workload identities referenced by credentials binding, otherwise it is not labeled, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed with @vpnachev and will replace the LabelSelector
. Please see #855 (comment)
} | ||
} | ||
|
||
// Validate checks whether the given new secret contains a valid GCP service account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Validate checks whether the given new secret contains a valid GCP service account. | |
// Validate checks whether the given new workloadidentity contains a valid GCP configuration. |
return fmt.Errorf("wrong object type %T for old object", oldObj) | ||
} | ||
|
||
if workloadIdentity.Spec.TargetSystem.ProviderConfig == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if workloadIdentity.Spec.TargetSystem.ProviderConfig == nil { | |
if oldWorkloadIdentity.Spec.TargetSystem.ProviderConfig == nil { |
But is this check necessary? If it was allowed providerConfig=nil
, then there must be a migration path which seems to be forbidden here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. We can skip the check
"k8s.io/apimachinery/pkg/runtime" | ||
) | ||
|
||
// +genclient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// +genclient |
This is not a real API resource, hence a client is not needed.
On a second look, apart from the comments above, looks good to me. |
Once #866 is merged this PR can be moved to "Ready" state. |
This PR will also need #869 merged so we can use the |
f9ae6d3
to
efc874d
Compare
18701fa
to
fff5380
Compare
I tested this PR after rebasing over the latest changes. The PR is ready for final review. ping @kon-angelo |
After an offline talk with @vpnachev we decided to explore the possibility of using SubjectTokenSupplier which might replace the internal http server. |
I updated the implementation to not rely on a local http server to retrieve the credentials. |
How to categorize this PR?
/area security ipcei
/kind enhancement
/platform gcp
/label ipcei/workload-identity
What this PR does / why we need it:
This PR adds support for workload identity. A few of the main points of this PR:
Which issue(s) this PR fixes:
Part of gardener/gardener#9586
Special notes for your reviewer:
/cc @vpnachev
In order to develop/review this PR one would need a running Gardener Discovery Server + established trust from GCP account to Gardener's workload identity. This can be achieved using the proposed changes in the following PR: gardener/gardener#10520
The PR also depends on gardener/machine-controller-manager-provider-gcp#130 being reviewed and released.
I will keep this as draft until MCM PR is merged and documentation is added to the PR, but feel free to review/test.
Release note: