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

Remove projected service account volume for workload identity #4682

Conversation

JRBANCEL
Copy link

@JRBANCEL JRBANCEL commented Mar 28, 2024

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:
See #4681.

Currently, in the manager spec, the projected volume for the service account token is manually specified.

The Workload Identity webhook takes care of this (and more) as seen here.

It is better to rely on the webhook because it is more future proof and removes YAML lines. Not only this, but as explained in #4681, not relying on the webhook makes it impossible to use cluster-api-provider-azure inside a vCluster on AKS with Workload Identity.

With this change, the resulting Pod spec in a vanilla case (i.e. not inside vCluster) is completely identical (webhook sets the volume), and it also works in vCluster because the Workload Identity webhook (on the host cluster) will do what is needed.

Which issue(s) this PR fixes:
Fixes #4681

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign timothysc for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

Welcome @JRBANCEL!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-azure 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-azure has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @JRBANCEL. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dtzar
Copy link
Contributor

dtzar commented Mar 28, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 28, 2024
@nojnhuh
Copy link
Contributor

nojnhuh commented Mar 28, 2024

Since we don't currently install the webhooks in our e2e tests, I'd expect the existing Workload Identity test to fail:

/test pull-cluster-api-provider-azure-e2e-optional

Introducing a requirement to install the webhooks would be a breaking change. Is there a way we could instead annotate the CAPZ pod so that the webhook ignores it? That kind of change I'd feel okay about backporting now and would at least buy us some time to solicit feedback on requiring the WorkloadIdentity webhooks and planning a transition if we find that's a better long-term solution.

@JRBANCEL
Copy link
Author

JRBANCEL commented Mar 28, 2024

Introducing a requirement to install the webhooks would be a breaking change.

Is using Workload Identity on AKS without the WI webhook even supported?
Official documentation requires to specify --enable-workload-identity which installs the WI webhook, no?

Is there a way we could instead annotate the CAPZ pod so that the webhook ignores it?

For #4681, no. Because we need the WI magic to be done on the host cluster (via webhook) and not at the source (inside vCluster).

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.73%. Comparing base (d0f78e0) to head (51f03e4).
Report is 561 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4682      +/-   ##
==========================================
+ Coverage   62.71%   62.73%   +0.01%     
==========================================
  Files         192      192              
  Lines       15641    15641              
==========================================
+ Hits         9810     9812       +2     
+ Misses       5148     5146       -2     
  Partials      683      683              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mjnovice
Copy link
Contributor

@sonasingh46 do share your thoughts 🙏

@jackfrancis
Copy link
Contributor

@JRBANCEL @mjnovice This change may work for vcluster scenarios, but it will break existing WI use cases in non-vcluster scenarios.

What are you doing right now to make this work? Are you manually updating the capz-controller-manager Deployment resource after you bootstrap your mgmt cluster on your vcluster?

@mjnovice
Copy link
Contributor

@jackfrancis we are currently using kyverno to do tylhe patching on the host cluster.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages 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 PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 10, 2024
@k8s-ci-robot
Copy link
Contributor

@JRBANCEL: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-azure-e2e-optional 51f03e4 link false /test pull-cluster-api-provider-azure-e2e-optional
pull-cluster-api-provider-azure-e2e-aks 51f03e4 link true /test pull-cluster-api-provider-azure-e2e-aks
pull-cluster-api-provider-azure-ci-entrypoint 51f03e4 link true /test pull-cluster-api-provider-azure-ci-entrypoint

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages 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 PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 30, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages 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 PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages 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 PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

CAPZ isn't compatible within a vcluster, with workload identity enabled on AKS.
7 participants