4.2 KiB
title, description, weight
| title | description | weight |
|---|---|---|
| Usage | Run a Virtual Kubelet either on or external to a Kubernetes cluster | 2 |
You can Virtual Kubelet either on or external to a Kubernetes cluster using the virtual-kubelet command-line tool. If you run Virtual Kubelet on a Kubernetes cluster, you can also deploy it using Helm.
For
virtual-kubeletinstallation instructions, see the Setup guide.
External to a Kubernetes cluster
To run Virtual Kubelet external to a Kubernetes cluster (not on the Kubernetes cluster you are connecting it to), run the virtual-kubelet binary with your chosen provider. Here's an example:
virtual-kubelet --provider aws
Once 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 flag).
{{< cli >}}
On a Kubernetes cluster
It's possible to run the Virtual Kubelet as a Kubernetes Pod in a Minikube or Docker for Desktop Kubernetes cluster.
At this time, automation of this deployment is supported only for the
mockprovider.
In order to deploy the Virtual Kubelet, you need to install Skaffold, a Kubernetes development tool. You also need to make sure that your current kubectl context is either minikube or docker-for-desktop (depending on which Kubernetes platform you're using).
First, clone the Virtual Kubelet repository:
git clone https://github.com/virtual-kubelet/virtual-kubelet
cd virtual-kubelet
Then:
make skaffold
By default, this will run Skaffold in development mode, which will make Skaffold watch 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:
make skaffold MODE=run
This will build and deploy the Virtual Kubelet and return.
Helm
{{< info >}} Helm is a package manager that enables you to easily deploy complex systems on Kubernetes using configuration bundles called Charts. {{< /info >}}
You can use the Virtual Kubelet Helm chart to deploy Virtual Kubelet on Kubernetes.
First, add the Chart repository (the Chart is currently hosted on GitHub):
helm repo add virtual-kubelet \
https://raw.githubusercontent.com/virtual-kubelet/virtual-kubelet/master/charts
{{< success >}}
You can check to make sure that the repo is listed amongst your current repos using helm repo list.
{{< /success >}}
Now you can install Virtual Kubelet using helm install. Here's an example command:
helm install virtual-kubelet/virtual-kubelet \
--name virtual-kubelet-azure \
--namespace virtual-kubelet \
--set provider=azure
This would install the Azure Container Instances Virtual Kubelet in the virtual-kubelet namespace.
To verify that Virtual Kubelet has been installed, run this command, which will list the available nodes and watch for changes:
kubectl get nodes \
--namespace virtual-kubelet \
--watch