karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.14k stars 811 forks source link

feat: add client-go oidc auth provider #4883

Closed guozheng-shen closed 1 week ago

guozheng-shen commented 2 weeks ago

What type of PR is this? /kind feature

What this PR does / why we need it: In our clusters, OIDC authentication is required for cluster operation auditing and access control. This is also a common authentication method. I believe it can be integrated into Karmada. Which issue(s) this PR fixes: NONE Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE
karmada-bot commented 2 weeks ago

Welcome @guozheng-shen! It looks like this is your first PR to karmada-io/karmada 🎉

guozheng-shen commented 2 weeks ago

@XiShanYongYe-Chang ok, it's done, pls review again, Thanks.

XiShanYongYe-Chang commented 2 weeks ago

Hi @guozheng-shen can you help describe how we can use OIDC for certification with this PR?

guozheng-shen commented 2 weeks ago

@XiShanYongYe-Chang Our kubeconfig uses oidc to access the k8s cluster. When I use karmadactl to join my member cluster, an error occurs causing the member cluster to fail to join (panic: No Auth provider found for the name "oidc", we need to import (_"k8s.io/client-go/plugin/pkg/client/auth/oidc") when karmadactl run. It will provide a newOIDCAuthProvider

codecov-commenter commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 53.13%. Comparing base (fff3699) to head (82ac4ef). Report is 22 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4883 +/- ## ========================================== + Coverage 53.07% 53.13% +0.06% ========================================== Files 251 251 Lines 20389 20417 +28 ========================================== + Hits 10821 10849 +28 + Misses 8855 8854 -1 - Partials 713 714 +1 ``` | [Flag](https://app.codecov.io/gh/karmada-io/karmada/pull/4883/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/karmada-io/karmada/pull/4883/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io) | `53.13% <ø> (+0.06%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=karmada-io#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

RainbowMango commented 1 week ago

/assign

karmada-bot commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/karmada-io/karmada/blob/master/OWNERS)~~ [RainbowMango] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment