Usage docs (#501)
* Add setup and usage docs Signed-off-by: lucperkins <lucperkins@gmail.com> * Finish initial version of setup doc * Add YAML config file for CLI docs * Finish CLI shortcode Signed-off-by: lucperkins <lucperkins@gmail.com> * Fix scrolling on mobile Signed-off-by: lucperkins <lucperkins@gmail.com> * Finish first version of usage doc Signed-off-by: lucperkins <lucperkins@gmail.com> * Remove go install section, modify CSS for CLI docs, and fix typo Signed-off-by: lucperkins <lucperkins@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Providers
|
||||
description: Extend the Virtual Kubelet interface
|
||||
weight: 2
|
||||
weight: 4
|
||||
---
|
||||
|
||||
The Virtual Kubelet provides a pluggable **provider interface** that developers can implement to define the actions of a typical kubelet.
|
||||
|
||||
24
website/content/docs/setup.md
Normal file
24
website/content/docs/setup.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: Setup
|
||||
description: Install Virtual Kubelet using one of several methods
|
||||
weight: 1
|
||||
---
|
||||
|
||||
You can install Virtual Kubelet by building it [from source](#source). First, make sure that you have a [`GOPATH`](https://github.com/golang/go/wiki/GOPATH) set. Then clone the Virtual Kubelet repository and run `make build`:
|
||||
|
||||
```bash
|
||||
mkdir -p ${GOPATH}/src/github.com/virtual-kubelet
|
||||
cd ${GOPATH}/src/github.com/virtual-kubelet
|
||||
git clone https://github.com/virtual-kubelet/virtual-kubelet
|
||||
make build
|
||||
```
|
||||
|
||||
This method adds a `virtual-kubelet` executable to the `bin` folder. To run it:
|
||||
|
||||
```bash
|
||||
bin/virtual-kubelet
|
||||
```
|
||||
|
||||
## Using Virtual Kubelet
|
||||
|
||||
Once you have Virtual Kubelet installed, you can move on to the [Usage](../usage) documentation.
|
||||
55
website/content/docs/usage.md
Normal file
55
website/content/docs/usage.md
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
title: Usage
|
||||
description: Run a Virtual Kubelet inside or outside of your Kubernetes cluster
|
||||
weight: 2
|
||||
---
|
||||
|
||||
Virtual Kubelet is run via the `virtual-kubelet` command-line tool (documented [below](#virtual-kubelet-cli)). You can run Virtual Kubelet either [outside](#outside-k8s) or [inside](#inside-k8s) of a Kubernetes cluster.
|
||||
|
||||
## Outside of a Kubernetes cluster {#outside-k8s}
|
||||
|
||||
> Before you go through this section, make sure to [install Virtual Kubelet](../setup) first.
|
||||
|
||||
To run Virtual Kubelet outside of a Kubernetes cluster, run the [`virtual-kubelet`](#virtual-kubelet-cli) binary with your chosen [provider](../providers). Here's an example:
|
||||
|
||||
```bash
|
||||
virtual-kubelet --provider aws
|
||||
```
|
||||
|
||||
Once the Virtual Kubelet is deployed, run `kubectl get nodes` and you should see a `virtual-kubelet` node (unless you've named it something else using the [`--nodename`](#virtual-kubelet-cli) flag).
|
||||
|
||||
<!-- The CLI docs are generated using the shortcode in layouts/shortcodes/cli.html
|
||||
and the YAML config in data/cli.yaml
|
||||
-->
|
||||
{{< cli >}}
|
||||
|
||||
## Inside a Kubernetes cluster {#inside-k8s}
|
||||
|
||||
It's possible to run the Virtual Kubelet as a Kubernetes Pod inside a [Minikube](https://kubernetes.io/docs/setup/minikube/) or [Docker for Desktop](https://docs.docker.com/docker-for-windows/kubernetes/) Kubernetes cluster.
|
||||
|
||||
> At this time, automation of this deployment is supported only for the [`mock`](https://github.com/virtual-kubelet/virtual-kubelet/tree/master/providers/mock) provider.
|
||||
|
||||
In order to deploy the Virtual Kubelet, you need to install [Skaffold](https://skaffold.dev/), a Kubernetes development tool. You also need to make sure that your current [kubectl context](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) is either `minikube` or `docker-for-desktop` (depending on which Kubernetes platform you're using).
|
||||
|
||||
First, clone the Virtual Kubelet repository:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/virtual-kubelet/virtual-kubelet
|
||||
cd virtual-kubelet
|
||||
```
|
||||
|
||||
Then:
|
||||
|
||||
```bash
|
||||
make skaffold
|
||||
```
|
||||
|
||||
By default, this will run Skaffold in [development mode](https://github.com/GoogleContainerTools/skaffold#skaffold-dev), which will make Skaffold watch [`hack/skaffold/virtual-kubelet/Dockerfile`](https://github.com/virtual-kubelet/virtual-kubelet/blob/master/hack/skaffold/virtual-kubelet/Dockerfile) and its dependencies for changes and re-deploy the Virtual Kubelet when changes happen. It will also make Skaffold stream logs from the Virtual Kubelet Pod.
|
||||
|
||||
Alternative, you can run Skaffold outside of development mode—if you aren't concerned about continuous deployment and log streaming—by running:
|
||||
|
||||
```bash
|
||||
make skaffold MODE=run
|
||||
```
|
||||
|
||||
This will build and deploy the Virtual Kubelet and return.
|
||||
Reference in New Issue
Block a user