cleaning up kubeconfig files

This commit is contained in:
Mark Bishop
2018-06-14 17:03:00 -07:00
committed by Mark Bishop
parent 3939e48948
commit 8a0283ab70
3 changed files with 39 additions and 17 deletions
@@ -26,20 +26,3 @@ The control plane nodes are used to run the Kubernetes API server, scheduler, an
#### Worker Nodes
Worker nodes are used to run the kubelet and the workload. It also runs the storage and networking drivers and ingress controllers when required. You create as many worker nodes as needed for your workload needs.
### Kubeconfig File
A kubeconfig file is used to configure access to kubernetes when using the kubectl commandline tool and other clients. For more details on how kubeconfig and kubectl work together, see the [Kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/).
Rancher handles the creation of kubeconfig files for you. You can
1. Navigate to the cluster dashboard page for the desired cluster cluster
1. Click the Kubeconfig File button
1. Copy the contents of the generated file using the Copy to Clipboard link
1. Paste the contents into a file on your local computer.
> **Note:** The default location that kubectl uses for the kubeconfig file is ~/.kube/config, but you can use any condition and specify it using the --kubeconfig flag like this:
> `kubectl --kubeconfig /custom/path/kube.config get pods`
This kubeconfig file will be specific to the cluster you were on when you copied the kubeconfig file contents. You will need a separate kubeconfig file for each cluster that you have access to in Rancher.
@@ -0,0 +1,21 @@
---
title: Kubeconfig Files
weight: 2100
---
A _kubeconfig file_ is a file used to configure access to Kubernetes when used in conjunction with the kubectl commandline tool (or other clients).
For more details on how kubeconfig and kubectl work together, see the [Kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/).
When you create a cluster using the Rancher GUI, Rancher automatically creates a kubeconfig for your cluster.
This kubeconfig file and its contents are specific to the cluster you are viewing. You will need a separate kubeconfig file for each cluster that you have access to in Rancher.
For more information, see [Downloading a Kubeconfig File]({{< baseurl >}}/rancher/v2.x/en/tasks/clusters/downloading-a-kubeconfig-file).
>**Note:** By default, kubectl checks `~/.kube/config` for kubeconfig files, but you can use any directory you want using the `--kubeconfig` flag. For example:
>```
kubectl --kubeconfig /custom/path/kube.config get pods
```
@@ -0,0 +1,18 @@
---
title: Downloading a Kubeconfig File
weight: 3600
draft: true
---
When you create a new cluster using Rancher, Rancher automatically creates a Kubeconfig file for the cluster. This file can then be used for authenticating with your clusters using Rancher CLI. Download
1. From the **Global** view, open the cluster that you want to download a Kubeconfig file for.
2. Click **Kubeconfig File**.
3. Copy the contents of the generated file to your clipboard.
4. Paste the contents into a new file on your local computer.
> **Note:** The default location that kubectl uses for the kubeconfig file is `~/.kube/config`, but you can use any condition and specify it using the `--kubeconfig` flag, as in the sample that follows:
>
> ```
kubectl --kubeconfig /custom/path/kube.config get pods
```