-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1376 from run-ai/Add-kubeconfig
Add kubeconfig
- Loading branch information
Showing
5 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
.../Researcher/cli-reference/new-cli/guides/set-kubeconfig-with-oidc-parameters.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Add Run:ai authorization to kubeconfig | ||
|
||
The ***runai kubeconfig set*** command allows users to configure their kubeconfig file with Run:ai authorization token. This setup enables users to gain access to the Kubernetes (k8s) cluster seamlessly. | ||
|
||
|
||
!!! Note | ||
Setting kubeconfig is not required in order to use the CLI. This command is used to enable third-party workloads under Run:ai authorization. | ||
|
||
## Usage | ||
|
||
To set the token (will be fetched automatically) inside the kubeconfig file, run the following command: | ||
|
||
``` | ||
runai kubeconfig set | ||
``` | ||
|
||
|
||
## Prerequisites | ||
|
||
Before executing the command, ensure that | ||
|
||
1. Cluster authentication is configured and enabled. | ||
2. The user has a kubeconfig file configured. | ||
3. The user is logged in (use the [runai login](../runai_login.md) command). | ||
|
||
|
||
### Cluster configuration | ||
|
||
To enable cluster authentication, add the following flags to the Kubernetes server API of each cluster: | ||
|
||
``` | ||
spec: | ||
containers: | ||
- command: | ||
... | ||
- --oidc-client-id=<OIDC_CLIENT_ID> | ||
- --oidc-issuer-url=url=https://<HOST>/auth/realms/<REALM> | ||
- --oidc-username-prefix=- | ||
``` | ||
|
||
### User Kubeconfig configuration | ||
|
||
Add the following to the Kubernetes client configuration file (./kube/config). For the full command reference, see [kubeconfig set](../runai_kubeconfig_set.md). | ||
|
||
* Make sure to replace values with the actual cluster information and user credentials. | ||
* There can be multiple contexts in the kubeconfig file. The command will configure the current context. | ||
|
||
|
||
``` | ||
apiVersion: v1 | ||
kind: Config | ||
preferences: | ||
colors: true | ||
current-context: <CONTEXT_NAME> | ||
contexts: | ||
- context: | ||
cluster: <CLUSTER_NAME> | ||
user: <USER_NAME> | ||
name: <CONTEXT_NAME> | ||
clusters: | ||
- cluster: | ||
server: <CLUSTER_URL> | ||
certificate-authority-data: <CLUSTER_CERT> | ||
name: <CLUSTER_NAME> | ||
users: | ||
- name: <USER_NAME> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## runai kubeconfig | ||
|
||
kubeconfig management | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for kubeconfig | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config-file string config file name; can be set by environment variable RUNAI_CLI_CONFIG_FILE (default "config.json") | ||
--config-path string config path; can be set by environment variable RUNAI_CLI_CONFIG_PATH | ||
-d, --debug enable debug mode | ||
-q, --quiet enable quiet mode, suppress all output except error messages | ||
--verbose enable verbose mode | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [runai](runai.md) - Run:ai Command-line Interface | ||
* [runai kubeconfig set](runai_kubeconfig_set.md) - kubeconfig set login token |
27 changes: 27 additions & 0 deletions
27
docs/Researcher/cli-reference/new-cli/runai_kubeconfig_set.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## runai kubeconfig set | ||
|
||
kubeconfig set login token | ||
|
||
``` | ||
runai kubeconfig set [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for set | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config-file string config file name; can be set by environment variable RUNAI_CLI_CONFIG_FILE (default "config.json") | ||
--config-path string config path; can be set by environment variable RUNAI_CLI_CONFIG_PATH | ||
-d, --debug enable debug mode | ||
-q, --quiet enable quiet mode, suppress all output except error messages | ||
--verbose enable verbose mode | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [runai kubeconfig](runai_kubeconfig.md) - kubeconfig management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters