Skip to content

Commit 8923ac0

Browse files
committed
docs: document usage of KUBECONFIG env variable
1 parent 17c8a60 commit 8923ac0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/stackit_ske_kubeconfig_create.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Creates or update a kubeconfig for an SKE cluster
77
Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster, if the config exits in the kubeconfig file the information will be updated.
88

99
By default, the kubeconfig information of the SKE cluster is merged into the default kubeconfig file of the current user. If the kubeconfig file doesn't exist, a new one will be created.
10-
You can override this behavior by specifying a custom filepath with the --filepath flag.
10+
You can override this behavior by specifying a custom filepath using the --filepath flag or by setting the KUBECONFIG env variable (fallback).
1111

1212
An expiration time can be set for the kubeconfig. The expiration time is set in seconds(s), minutes(m), hours(h), days(d) or months(M). Default is 1h.
1313

@@ -47,7 +47,7 @@ stackit ske kubeconfig create CLUSTER_NAME [flags]
4747
```
4848
--disable-writing Disable the writing of kubeconfig. Set the output format to json or yaml using the --output-format flag to display the kubeconfig.
4949
-e, --expiration string Expiration time for the kubeconfig in seconds(s), minutes(m), hours(h), days(d) or months(M). Example: 30d. By default, expiration time is 1h
50-
--filepath string Path to create the kubeconfig file. By default, the kubeconfig is created as 'config' in the .kube folder, in the user's home directory.
50+
--filepath string Path to create the kubeconfig file. Will fall back to KUBECONFIG env variable if not set. In case both aren't set, the kubeconfig is created as file named 'config' in the .kube folder in the user's home directory.
5151
-h, --help Help for "stackit ske kubeconfig create"
5252
-l, --login Create a login kubeconfig that obtains valid credentials via the STACKIT CLI. This flag is mutually exclusive with the expiration flag.
5353
--overwrite Overwrite the kubeconfig file.

internal/cmd/ske/kubeconfig/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
4848
Long: fmt.Sprintf("%s\n\n%s\n%s\n%s\n%s",
4949
"Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster, if the config exits in the kubeconfig file the information will be updated.",
5050
"By default, the kubeconfig information of the SKE cluster is merged into the default kubeconfig file of the current user. If the kubeconfig file doesn't exist, a new one will be created.",
51-
"You can override this behavior by specifying a custom filepath with the --filepath flag.\n",
51+
"You can override this behavior by specifying a custom filepath using the --filepath flag or by setting the KUBECONFIG env variable (fallback).\n",
5252
"An expiration time can be set for the kubeconfig. The expiration time is set in seconds(s), minutes(m), hours(h), days(d) or months(M). Default is 1h.\n",
5353
"Note that the format is <value><unit>, e.g. 30d for 30 days and you can't combine units."),
5454
Args: args.SingleArg(clusterNameArg, nil),
@@ -170,7 +170,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command {
170170
func configureFlags(cmd *cobra.Command) {
171171
cmd.Flags().Bool(disableWritingFlag, false, fmt.Sprintf("Disable the writing of kubeconfig. Set the output format to json or yaml using the --%s flag to display the kubeconfig.", globalflags.OutputFormatFlag))
172172
cmd.Flags().BoolP(loginFlag, "l", false, "Create a login kubeconfig that obtains valid credentials via the STACKIT CLI. This flag is mutually exclusive with the expiration flag.")
173-
cmd.Flags().String(filepathFlag, "", "Path to create the kubeconfig file. By default, the kubeconfig is created as 'config' in the .kube folder, in the user's home directory.")
173+
cmd.Flags().String(filepathFlag, "", "Path to create the kubeconfig file. Will fall back to KUBECONFIG env variable if not set. In case both aren't set, the kubeconfig is created as file named 'config' in the .kube folder in the user's home directory.")
174174
cmd.Flags().StringP(expirationFlag, "e", "", "Expiration time for the kubeconfig in seconds(s), minutes(m), hours(h), days(d) or months(M). Example: 30d. By default, expiration time is 1h")
175175
cmd.Flags().Bool(overwriteFlag, false, "Overwrite the kubeconfig file.")
176176
cmd.MarkFlagsMutuallyExclusive(loginFlag, expirationFlag)

0 commit comments

Comments
 (0)