From d1dff0aefbb1469de2bc8563a87e94f5eed96921 Mon Sep 17 00:00:00 2001 From: Gunjan Vyas Date: Thu, 12 Aug 2021 22:34:35 +0530 Subject: [PATCH] Ways to connect to cluster using kn (#4095) * Updating client connection doc * Edited the config text format * Update docs/client/README.md Co-authored-by: Samia Nneji * Updating kn client doc for more ways of connection to the cluster * Only keeping kubeconfig info for kn CLI * Update docs/client/README.md Co-authored-by: Samia Nneji * Update docs/client/README.md Co-authored-by: Samia Nneji * Update docs/client/README.md Co-authored-by: Samia Nneji Co-authored-by: Samia Nneji --- docs/client/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/client/README.md b/docs/client/README.md index a171e6ab4..f1fffcca7 100755 --- a/docs/client/README.md +++ b/docs/client/README.md @@ -28,9 +28,15 @@ See [Installing `kn`](install-kn/). ## Connecting CLI tools to your cluster -After you have installed `kubectl` or `kn`, these tools will search for the `kubeconfig` file of your cluster in the default location of `$HOME/.kube/config`, and will use this file to connect to the cluster. +After you have installed `kubectl` or `kn`, these tools will search for the `kubeconfig` file of your cluster in the default location of `$HOME/.kube/config`, and will use this file to connect to the cluster. A `kubeconfig` file is usually automatically created when you create a Kubernetes cluster. + +You can also set the environment variable `$KUBECONFIG`, and point it to the kubeconfig file. + +Using the `kn` CLI, you can specify the following options to connect to the cluster: + +- `--kubeconfig`: use this option to point to the `kubeconfig` file. This is equivalent to setting the `$KUBECONFIG` environment variable. +- `--context`: use this option to specify the name of a context from the existing `kubeconfig` file. Use one of the contexts from the output of `kubectl config get-contexts`. -A `kubeconfig` file is usually automatically created when you create a Kubernetes cluster. You can also specify a config file in the following ways: