feat: update kubeconfig generate command (#1158)

* feat: update kubeconfig generate command

* improve messages and docs
This commit is contained in:
Enrico Candino
2026-08-19 13:08:53 +02:00
committed by GitHub
parent 8fec5a4079
commit af7fd3918a
9 changed files with 169 additions and 14 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ Add `my-cluster.example.com` to `spec.tlsSANs` so the API server certificate cov
the kubeconfig with the matching endpoint:
```bash
k3kcli kubeconfig generate --namespace my-namespace --name my-virtual-cluster \
k3kcli kubeconfig generate my-namespace/my-virtual-cluster \
--kubeconfig-server https://my-cluster.example.com
```
+6 -1
View File
@@ -194,6 +194,12 @@ Generate kubeconfig for clusters.
k3kcli kubeconfig generate [flags]
----
=== Examples
----
k3kcli kubeconfig generate [command options] NAME
----
=== Options
----
@@ -203,7 +209,6 @@ k3kcli kubeconfig generate [flags]
--expiration-days int Expiration date of the certificates used for the kubeconfig (default 365)
-h, --help help for generate
--kubeconfig-server string override the kubeconfig server host
--name string cluster name
-n, --namespace string namespace of the k3k cluster
--org strings Organization name (ORG) of the generated certificates for the kubeconfig
----
+6 -1
View File
@@ -6,6 +6,12 @@ Generate kubeconfig for clusters.
k3kcli kubeconfig generate [flags]
```
### Examples
```
k3kcli kubeconfig generate [command options] NAME
```
### Options
```
@@ -15,7 +21,6 @@ k3kcli kubeconfig generate [flags]
--expiration-days int Expiration date of the certificates used for the kubeconfig (default 365)
-h, --help help for generate
--kubeconfig-server string override the kubeconfig server host
--name string cluster name
-n, --namespace string namespace of the k3k cluster
--org strings Organization name (ORG) of the generated certificates for the kubeconfig
```
+1 -1
View File
@@ -177,7 +177,7 @@ kubectl get po -n k3k-mycluster
Last thing to do is to get the kubeconfig to connect to the virtual cluster we've just created:
```bash
k3kcli kubeconfig generate --name mycluster --namespace k3k-mycluster --kubeconfig-server localhost:30001
k3kcli kubeconfig generate mycluster --kubeconfig-server localhost:30001
```
+2 -2
View File
@@ -294,8 +294,8 @@ Once the virtual cluster is running, you can connect to it using the CLI:
### CLI Method
```sh
k3kcli kubeconfig generate --namespace k3k-mycluster --name mycluster
export KUBECONFIG=$PWD/mycluster-kubeconfig.yaml
k3kcli kubeconfig generate mycluster
export KUBECONFIG=$PWD/k3k-mycluster-mycluster-kubeconfig.yaml
kubectl get nodes
```