Skip to content

Commit e4f9591

Browse files
feat(ske): implement idp flow for kubeconfig login (#1322)
* extract kubeconfig certificate validation * simplify kubeconfig retrieval * extract kubeconfig retrieval * reorder imports * Split kubeconfig retrieval and output * replace hardcoded timeout with constant * implement kubeconfig login --idp flow * Add tests * fix test failure if KUBECONFIG environment variable is set * make retrieval of idp well known config reusable * optionally initialize IDP_TOKEN_ENDPOINT auth field for service accounts When activating a service account, clear a possibly stale old value. Add a separate method to allow commands to request the initialization of the IDP_TOKEN_ENDPOINT auth field. * refactor token exchange into auth package
1 parent 3b70f97 commit e4f9591

File tree

13 files changed

+772
-247
lines changed

13 files changed

+772
-247
lines changed

docs/stackit_ske_kubeconfig_login.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Login plugin for kubernetes clients
55
### Synopsis
66

77
Login plugin for kubernetes clients, that creates short-lived credentials to authenticate against a STACKIT Kubernetes Engine (SKE) cluster.
8-
First you need to obtain a kubeconfig for use with the login command (first example).
9-
Secondly you use the kubeconfig with your chosen Kubernetes client (second example), the client will automatically retrieve the credentials via the STACKIT CLI.
8+
First you need to obtain a kubeconfig for use with the login command (first or second example).
9+
Secondly you use the kubeconfig with your chosen Kubernetes client (third example), the client will automatically retrieve the credentials via the STACKIT CLI.
1010

1111
```
1212
stackit ske kubeconfig login [flags]
@@ -15,9 +15,12 @@ stackit ske kubeconfig login [flags]
1515
### Examples
1616

1717
```
18-
Get a login kubeconfig for the SKE cluster with name "my-cluster". This kubeconfig does not contain any credentials and instead obtains valid credentials via the `stackit ske kubeconfig login` command.
18+
Get an admin, login kubeconfig for the SKE cluster with name "my-cluster". This kubeconfig does not contain any credentials and instead obtains valid admin credentials via the `stackit ske kubeconfig login` command.
1919
$ stackit ske kubeconfig create my-cluster --login
2020
21+
Get an IDP kubeconfig for the SKE cluster with name "my-cluster". This kubeconfig does not contain any credentials and instead obtains valid credentials via the `stackit ske kubeconfig login` command.
22+
$ stackit ske kubeconfig create my-cluster --idp
23+
2124
Use the previously saved kubeconfig to authenticate to the SKE cluster, in this case with kubectl.
2225
$ kubectl cluster-info
2326
$ kubectl get pods
@@ -27,6 +30,7 @@ stackit ske kubeconfig login [flags]
2730

2831
```
2932
-h, --help Help for "stackit ske kubeconfig login"
33+
--idp Use the STACKIT IdP for authentication to the cluster.
3034
```
3135

3236
### Options inherited from parent commands

0 commit comments

Comments
 (0)