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

Add endpoint for OIDC kubeconfig secret for WEB terminal #10102

Merged

Conversation

zreigz
Copy link
Contributor

@zreigz zreigz commented Jun 15, 2022

What does this PR do / Why do we need it: add an endpoint for OIDC kubeconfig secret for the WEB terminal.

Does this PR close any issues?:
Fixes #

Special notes for your reviewer:
In order to test this locally:

  1. Alter our dex configuration (kubermaticIssuer client) to whitelist the redirectURI: http://localhost:8080/api/v2/kubeconfig/secret and https://kubermatic.io/api/v2/kubeconfig/secret
  • kubectl -n oauth edit configmap dex
  • kubectl -n oauth rollout restart deployment dex
    image
  1. Create and wait for any cluster to start (using our dev env).
  2. Run the API locally, i.e. make clean && FEATURE_GATES=OIDCKubeCfgEndpoint=true KUBERMATIC_EDITION=ee KUBERMATIC_DEBUG=false ./hack/run-api.sh

Open WEB browser and enter: http://localhost:8080/api/v2/kubeconfig/secret?cluster_id=<clusterID>&project_id=<projectID>&user_id=<userID>. Make sure to replace clusterID, userID and projectID with the values of the created cluster. The userID is the ID for the user object in the KKP.

  1. Get user cluster kubeconfig and check if the secret was created in the kube-system namespace. The secret name is your email encoded to md5 hash. You can check the name here https://www.md5hashgenerator.com/. For example for user lukasz.zajaczkowski@kubermatic.com we will get 40ce6d00769edaab4eb1d8cacfea5cb1
Add an endpoint for OIDC kubeconfig secret for the WEB terminal

@kubermatic-bot kubermatic-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. sig/api Denotes a PR or issue as being assigned to SIG API. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 15, 2022
@zreigz zreigz force-pushed the create-oidc-kubeconfig-secret branch from 4b5cffd to e8c728f Compare June 15, 2022 10:03
@kubermatic-bot kubermatic-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 15, 2022
@zreigz zreigz force-pushed the create-oidc-kubeconfig-secret branch 3 times, most recently from d186648 to ef9775f Compare June 15, 2022 11:14
@zreigz zreigz requested a review from imharshita June 15, 2022 11:26
@zreigz zreigz changed the title [WIP] add endpoint for OIDC kubeconfig secret for WEB terminal add endpoint for OIDC kubeconfig secret for WEB terminal Jun 15, 2022
@kubermatic-bot kubermatic-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 15, 2022
@zreigz zreigz force-pushed the create-oidc-kubeconfig-secret branch from ef9775f to 116d090 Compare June 15, 2022 12:09
@zreigz
Copy link
Contributor Author

zreigz commented Jun 15, 2022

/retest

3 similar comments
@zreigz
Copy link
Contributor Author

zreigz commented Jun 15, 2022

/retest

@zreigz
Copy link
Contributor Author

zreigz commented Jun 15, 2022

/retest

@zreigz
Copy link
Contributor Author

zreigz commented Jun 15, 2022

/retest

@zreigz zreigz force-pushed the create-oidc-kubeconfig-secret branch from 116d090 to 488a1e8 Compare June 20, 2022 07:32
@zreigz
Copy link
Contributor Author

zreigz commented Jun 20, 2022

/retest

@zreigz
Copy link
Contributor Author

zreigz commented Jun 20, 2022

@ahmedwaleedmalik @imharshita PTAL

Copy link
Member

@ahmedwaleedmalik ahmedwaleedmalik left a comment

Choose a reason for hiding this comment

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

/approve ⚡

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 20, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c89090fbbd4ad11df705984ebf90d41b9ea2d55a

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmedwaleedmalik, zreigz

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:

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

@imharshita
Copy link
Contributor

/lgtm

@kubermatic-bot kubermatic-bot merged commit 728045c into kubermatic:master Jun 20, 2022
@KhizerRehan KhizerRehan changed the title add endpoint for OIDC kubeconfig secret for WEB terminal Add endpoint for OIDC kubeconfig secret for WEB terminal Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api Denotes a PR or issue as being assigned to SIG API. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants