We use cookies to make your experience better.
Learn how to deploy a Workspace Provider with Helm and the coder CLI
This article walks you through the process of deploying a Workspace Provider onto an additional Kubernetes cluster.
Workspace Providers are logical groups of resources you can deploy workspaces onto. Like the Coder deployment, Workspace Providers are deployed via a helm chart into the kubernetes cluster you'd like to provision new workspaces into.
Install the following dependencies if you haven't already:
coder.example.com
, the Workspace Provider must match the format
*.coder.example.com
.To add a kubernetes cluster as a Workspace Provider, we first must ensure we are connected to the cluster we wish to expand into.
kubectl config current-context
Confirm your current kubectl context is the correct cluster before continuing.
We recommend running Workspace Providers in a separate namespace; to do so, run
kubectl create namespace coder
Next, change the kubectl context to point to your newly created namespace:
kubectl config set-context --current --namespace=coder
Using the Coder CLI, we will create a new Workspace Provider in a pending
state.
You must provide the following arguments:
name
: A unique name of the Workspace Providerhostname
: Hostname of the Workspace ProviderclusterAddress
: The address of the kubernetes cluster apiserver. This can
be retrieved with the command
kubectl config view -o jsonpath='{.clusters[?(@.name == "'"$(kubectl config current-context)"'")].cluster.server}{"\n"}'
coder providers create \
--name=[NAME] \
--hostname=[HOSTNAME] \
--clusterAddress=[CLUSTER_ADDRESS]
The command will generate a helm command you can use for the next steps, so make sure to save the output for the next steps.
The returned REMOTE_ENVPROXY_TOKEN
is a shared secret between the two
deployments, and is what the Workspace Provider will use to authenticate itself
when communicating with the Coder deployment.
If you haven't already, add the Coder helm repo
helm repo add coder https://helm.coder.com
Install the helm chart onto your cluster using the generated helm command from before. The helm command will follow the pattern:
helm upgrade coder-workspace-provider coder/workspace-provider \
--version=[CODER_VERSION] \
--atomic \
--install \
--force \
--set envproxy.token=[REMOTE_ENVPROXY_TOKEN] \
--set ingress.host=[HOSTNAME] \
--set envproxy.clusterAddress=[CLUSTER_ADDRESS] \
--set cemanager.AccessURL=[CEMANAGER_ACCESS_URL]
You can optionally provide additional helm values by providing a values.yaml
file and adding the argument -f my-values.yaml
to the generated command. Helm
values control attributes of the Workspace Provider such as controlling DevURLs,
kubernetes storage classes, enabling SSH, and more. See the
Workspace Provider Helm Chart Values
for more details.
ready
state on the Workspace Provider Admin page.Upgrades to all Workspace Providers should be done in lockstep with the Coder
deployment. Only the --version
flag needs to be updated if no other helm
values changes are desired, and can be done with the following command:
helm upgrade coder-workspace-provider coder/workspace-provider \
--version=[CODER_VERSION] \
--atomic \
--install \
--force
If you desire to update any of the helm chart's values you can do so by
supplying a values file (-f myvalues.yaml
) or explicitly with the --set
flag. Any existing values that were set during installation will persist unless
they are explicitly overwritten.
A Workspace Provider can only be removed if it no longer contains any workspaces, so you must remove any remaining workspaces before attempting to delete the Workspace Provider.
To remove a Workspace Provider run the following command via the Coder CLI:
coder providers rm [NAME]
Our docs are open source. See something wrong or unclear? Make an edit.