mirror of
https://github.com/rancher/k3k.git
synced 2026-08-21 13:26:29 +00:00
feat: update kubeconfig generate command (#1158)
* feat: update kubeconfig generate command * improve messages and docs
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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,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
@@ -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
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user