mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-27 13:38:07 +00:00
moving steps from craig's 'downloading kubeconfig file' to task on using kubectl
This commit is contained in:
@@ -3,34 +3,22 @@ title: Using kubectl to Access a Cluster
|
|||||||
weight: 3450
|
weight: 3450
|
||||||
draft: true
|
draft: true
|
||||||
---
|
---
|
||||||
You can access and manage your Kubernetes clusters using the kubectl shell.
|
You can access and manage your Kubernetes clusters using the kubectl shell, all within the Rancher GUI.
|
||||||
|
|
||||||
## Using kubectl Shell
|
1. From the **Global** view, open the cluster that you want to access with kubectl.
|
||||||
|
|
||||||
|
2. Copy the cluster's kubeconfig file to your workstation.
|
||||||
|
|
||||||
2. Click **Launch kubectl**.
|
|
||||||
|
|
||||||
|
|
||||||
1. From the **Global** view, open the cluster that you want to access with kubectl.
|
|
||||||
2. Copy the cluster's kubeconfig file to your workstation.
|
|
||||||
1. Click **Kubeconfig File**.
|
1. Click **Kubeconfig File**.
|
||||||
2. Copy the contents of the generated file to your clipboard.
|
2. Copy the contents displayed to your clipboard.
|
||||||
3. Paste the contents into a new file on your local computer. Move the file to `~/.kube/config`.
|
3. Paste the contents into a new file on your local computer. Move the file to `~/.kube/config`.
|
||||||
|
|
||||||
> **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:
|
> **Note:** The default location that kubectl uses for the kubeconfig file is `~/.kube/config`, but you can use any directory and specify it using the `--kubeconfig` flag, as in the sample that follows:
|
||||||
>
|
>
|
||||||
> ```
|
> ```
|
||||||
kubectl --kubeconfig /custom/path/kube.config get pods
|
kubectl --kubeconfig /custom/path/kube.config get pods
|
||||||
```
|
```
|
||||||
|
|
||||||
|
3. Click **Launch kubectl**. Use the window that opens to interact with your Kubernetes cluster.
|
||||||
|
|
||||||
|
For more information on using kubectl, see [Kubernetes Documentation: Overview of kubectl](https://kubernetes.io/docs/reference/kubectl/overview/).
|
||||||
## Configuring My `kubectl`
|
|
||||||
|
|
||||||
After you open kubectl, direct it toward a kubeconfig file to access and manage one of your Kubernetes clusters. To specify a kubeconfig file, click **Kubeconfig File**, copy the contents to an empty file, and then save it to `~/.kube/config`.
|
|
||||||
|
|
||||||
For more information, see:
|
|
||||||
|
|
||||||
- [Kubeconfig Files]({{< baseurl >}}/rancher/v2.x/en/concepts/clusters/kubeconfig-files).
|
|
||||||
- [Kubernetes Documentation: Organizing Cluster Access Using kubeconfig Files](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user