diff --git a/docs/Researcher/cli-reference/new-cli/guides/set-kubeconfig-with-oidc-parameters.md b/docs/Researcher/cli-reference/new-cli/guides/set-kubeconfig-with-oidc-parameters.md new file mode 100644 index 0000000000..6554df251d --- /dev/null +++ b/docs/Researcher/cli-reference/new-cli/guides/set-kubeconfig-with-oidc-parameters.md @@ -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-issuer-url=url=https:///auth/realms/ + - --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: +contexts: +- context: + cluster: + user: + name: +clusters: +- cluster: + server: + certificate-authority-data: + name: +users: +- name: +``` + diff --git a/docs/Researcher/cli-reference/new-cli/runai.md b/docs/Researcher/cli-reference/new-cli/runai.md index dedb9096b6..aabb423d7c 100644 --- a/docs/Researcher/cli-reference/new-cli/runai.md +++ b/docs/Researcher/cli-reference/new-cli/runai.md @@ -31,6 +31,7 @@ runai [flags] * [runai attach](runai_attach.md) - [Deprecated] attach * [runai cluster](runai_cluster.md) - cluster management * [runai config](runai_config.md) - configuration management +* [runai kubeconfig](runai_kubeconfig.md) - kubeconfig management * [runai describe](runai_describe.md) - [Deprecated] Display detailed information about resources * [runai exec](runai_exec.md) - [Deprecated] exec * [runai list](runai_list.md) - [Deprecated] display resource list. By default displays the job list diff --git a/docs/Researcher/cli-reference/new-cli/runai_kubeconfig.md b/docs/Researcher/cli-reference/new-cli/runai_kubeconfig.md new file mode 100644 index 0000000000..5abf415fda --- /dev/null +++ b/docs/Researcher/cli-reference/new-cli/runai_kubeconfig.md @@ -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 diff --git a/docs/Researcher/cli-reference/new-cli/runai_kubeconfig_set.md b/docs/Researcher/cli-reference/new-cli/runai_kubeconfig_set.md new file mode 100644 index 0000000000..2f49bfc1f7 --- /dev/null +++ b/docs/Researcher/cli-reference/new-cli/runai_kubeconfig_set.md @@ -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 diff --git a/mkdocs.yml b/mkdocs.yml index e0ed14256e..d743b7fceb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -373,6 +373,9 @@ nav: - 'Overview': 'Researcher/cli-reference/new-cli/overview.md' - 'CLI Reference': 'Researcher/cli-reference/new-cli/runai.md' - 'CLI Examples': 'Researcher/cli-reference/new-cli/cli-examples.md' + - 'CLI Guides' : + - 'Set cluster authorization': 'Researcher/cli-reference/new-cli/guides/set-kubeconfig-with-oidc-parameters.md' + - 'CLI V1': - 'Introduction' : 'Researcher/cli-reference/Introduction.md' - 'runai attach' : 'Researcher/cli-reference/runai-attach.md'