mirror of https://github.com/k3s-io/k3s
100 lines
3.9 KiB
Markdown
100 lines
3.9 KiB
Markdown
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
|
||
|
||
<!-- BEGIN STRIP_FOR_RELEASE -->
|
||
|
||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||
width="25" height="25">
|
||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||
width="25" height="25">
|
||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||
width="25" height="25">
|
||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||
width="25" height="25">
|
||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||
width="25" height="25">
|
||
|
||
<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
|
||
|
||
If you are using a released version of Kubernetes, you should
|
||
refer to the docs that go with that version.
|
||
|
||
<strong>
|
||
The latest 1.0.x release of this document can be found
|
||
[here](http://releases.k8s.io/release-1.0/docs/user-guide/prereqs.md).
|
||
|
||
Documentation for other releases can be found at
|
||
[releases.k8s.io](http://releases.k8s.io).
|
||
</strong>
|
||
--
|
||
|
||
<!-- END STRIP_FOR_RELEASE -->
|
||
|
||
<!-- END MUNGE: UNVERSIONED_WARNING -->
|
||
|
||
# Kubernetes User Guide: Managing Applications: Prerequisites
|
||
|
||
To deploy and manage applications on Kubernetes, you’ll use the Kubernetes command-line tool, [kubectl](kubectl/kubectl.md). It lets you inspect your cluster resources, create, delete, and update components, and much more. You will use it to look at your new cluster and bring up example apps.
|
||
|
||
## Install kubectl
|
||
|
||
You can find it in the [release](https://github.com/GoogleCloudPlatform/kubernetes/releases) tar bundle, under platforms/<os>/<arch>;
|
||
or if you build from source, kubectl should be either under _output/local/bin/<os>/<arch> or _output/dockerized/bin/<os>/<arch>.
|
||
|
||
Next, make sure the kubectl tool is in your path, assuming you download a release:
|
||
|
||
```bash
|
||
# OS X
|
||
export PATH=<path/to/kubernetes-directory>/platforms/darwin/amd64:$PATH
|
||
|
||
# Linux
|
||
export PATH=<path/to/kubernetes-directory>/platforms/linux/amd64:$PATH
|
||
```
|
||
|
||
## Configure kubectl
|
||
|
||
In order for kubectl to find and access the Kubernetes cluster, it needs a [kubeconfig file](kubeconfig-file.md), which is created automatically when creating a cluster using kube-up.sh (see the [getting started guides](../../docs/getting-started-guides/) for more about creating clusters). If you need access to a cluster you didn’t create, see the [Sharing Cluster Access document](sharing-clusters.md).
|
||
|
||
#### Installing Kubectl
|
||
|
||
If you downloaded a pre-compiled release, kubectl should be under `platforms/<os>/<arch>`.
|
||
|
||
If you built from source, kubectl should be either under `_output/local/bin/<os>/<arch>` or `_output/dockerized/bin/<os>/<arch>`.
|
||
|
||
The kubectl binary doesn't have to be installed to be executable, but the rest of the walkthrough will assume that it's in your PATH.
|
||
|
||
The simplest way to install is to copy or move kubectl into a dir already in PATH (e.g. `/usr/local/bin`). For example:
|
||
|
||
```console
|
||
# OS X
|
||
$ sudo cp kubernetes/platforms/darwin/amd64/kubectl /usr/local/bin/kubectl
|
||
# Linux
|
||
$ sudo cp kubernetes/platforms/linux/amd64/kubectl /usr/local/bin/kubectl
|
||
```
|
||
|
||
#### Configuring Kubectl
|
||
|
||
If you used `./cluster/kube-up.sh` to deploy your Kubernetes cluster, kubectl should already be locally configured.
|
||
|
||
By default, kubectl configuration lives at `~/.kube/config`.
|
||
|
||
If your cluster was deployed by other means (e.g. a [getting started guide](../getting-started-guides/README.md)) your kubectl client will typically be configured during that process. If for some reason your kubectl client is not yet configured, check out [kubeconfig-file.md](kubeconfig-file.md).
|
||
|
||
#### Making sure you're ready
|
||
|
||
Check that kubectl is properly configured by getting the cluster state:
|
||
|
||
```console
|
||
$ kubectl cluster-info
|
||
```
|
||
|
||
If you see a url response, you are ready to go.
|
||
|
||
## What's next?
|
||
|
||
[Learn how to launch and expose your application.](quick-start.md)
|
||
|
||
|
||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/prereqs.md?pixel)]()
|
||
<!-- END MUNGE: GENERATED_ANALYTICS -->
|