You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/stackit_ske_kubeconfig_create.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,16 @@
1
1
## stackit ske kubeconfig create
2
2
3
-
Creates a kubeconfig for an SKE cluster
3
+
Creates or update a kubeconfig for an SKE cluster
4
4
5
5
### Synopsis
6
6
7
-
Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster.
7
+
Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster, if the config exits in the kubeconfig file the information will be updated.
8
8
9
-
By default the kubeconfig is created in the .kube folder, in the user's home directory. The kubeconfig file will be overwritten if it already exists.
9
+
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
10
You can override this behavior by specifying a custom filepath with the --filepath flag.
11
+
11
12
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.
13
+
12
14
Note that the format is <value><unit>, e.g. 30d for 30 days and you can't combine units.
Create a kubeconfig for the SKE cluster with name "my-cluster"
23
+
Create a kubeconfig for the SKE cluster with name "my-cluster. If the config exits in the kubeconfig file the information will be updated."
22
24
$ stackit ske kubeconfig create my-cluster
23
25
24
26
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.
Create a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 30 days
29
+
Create o kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 30 days. If the config exits in the kubeconfig file the information will be updated.
Create a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 2 months
32
+
Create or update a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 2 months. If the config exits in the kubeconfig file the information will be updated.
Create a kubeconfig for the SKE cluster with name "my-cluster" in a custom filepath
35
+
Create or update a kubeconfig for the SKE cluster with name "my-cluster" in a custom filepath. If the config exits in the kubeconfig file the information will be updated.
--disable-writing Disable writing to the kubeconfig file.
45
+
--disable-writing Disable the writing of kubeconfig. Set the output format to json or yaml using the --output-format flag to display the kubeconfig.
44
46
-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
45
47
--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.
46
48
-h, --help Help for "stackit ske kubeconfig create"
Copy file name to clipboardExpand all lines: internal/cmd/ske/kubeconfig/create/create.go
+13-12Lines changed: 13 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -40,30 +40,30 @@ type inputModel struct {
40
40
funcNewCmd(p*print.Printer) *cobra.Command {
41
41
cmd:=&cobra.Command{
42
42
Use: fmt.Sprintf("create %s", clusterNameArg),
43
-
Short: "Creates a kubeconfig for an SKE cluster",
43
+
Short: "Creates or update a kubeconfig for an SKE cluster",
44
44
Long: fmt.Sprintf("%s\n\n%s\n%s\n%s\n%s",
45
-
"Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster.",
46
-
"By default the kubeconfig is created in the .kube folder, in the user's home directory. The kubeconfig file will be overwritten if it already exists.",
47
-
"You can override this behavior by specifying a custom filepath with the --filepath flag.",
48
-
"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.",
45
+
"Creates a kubeconfig for a STACKIT Kubernetes Engine (SKE) cluster, if the config exits in the kubeconfig file the information will be updated.",
46
+
"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.",
47
+
"You can override this behavior by specifying a custom filepath with the --filepath flag.\n",
48
+
"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",
49
49
"Note that the format is <value><unit>, e.g. 30d for 30 days and you can't combine units."),
50
50
Args: args.SingleArg(clusterNameArg, nil),
51
51
Example: examples.Build(
52
52
examples.NewExample(
53
-
`Create a kubeconfig for the SKE cluster with name "my-cluster"`,
53
+
`Create a kubeconfig for the SKE cluster with name "my-cluster. If the config exits in the kubeconfig file the information will be updated."`,
54
54
"$ stackit ske kubeconfig create my-cluster"),
55
55
examples.NewExample(
56
56
`Get a login kubeconfig for the SKE cluster with name "my-cluster". `+
57
57
"This kubeconfig does not contain any credentials and instead obtains valid credentials via the `stackit ske kubeconfig login` command.",
`Create a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 30 days`,
60
+
`Create o kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 30 days. If the config exits in the kubeconfig file the information will be updated.`,
`Create a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 2 months`,
63
+
`Create or update a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 2 months. If the config exits in the kubeconfig file the information will be updated.`,
`Create a kubeconfig for the SKE cluster with name "my-cluster" in a custom filepath`,
66
+
`Create or update a kubeconfig for the SKE cluster with name "my-cluster" in a custom filepath. If the config exits in the kubeconfig file the information will be updated.`,
prompt:=fmt.Sprintf("Are you sure you want to create a kubeconfig for SKE cluster %q? This will OVERWRITE your current kubeconfig file, if it exists.", model.ClusterName)
86
+
prompt:=fmt.Sprintf("Are you sure you want to update your kubeconfig for SKE cluster %q? This will update your kubeconfig file. \n If it the kubeconfig file doesn´t exists, it will create a new one.", model.ClusterName)
0 commit comments