Installation

Architecture

Coder Enterprise has the following components:

  • Manager - Serves as the central authority, providing authentication, the dashboard, and an API to create and interact with environments.
  • Envproxy - Serves as a websocket proxy to an environment's editor and terminals.
  • PostgreSQL - Stores general data, such as session tokens, environment info, etc.

In the basic deployment, every management component runs within their own pod.

The control pod uses the in cluster Kubernetes credentials to manage environments.

Kubernetes Node Requirements

Coder Enterprise runs on any Kubernetes cluster that supports the following requirements.

We require that you run at least Kubernetes version 1.13.7 with the following extensions enabled:

  • apps/v1
  • rbac.authorization.k8s.io/v1
  • metrics.k8s.io
  • storage.k8s.io/v1
  • networking.k8s.io/v1
  • extensions/v1beta1

We recommend at least 2 cores and 4GB of RAM for the basic control services. A disk as small as 20GB will suffice.

The following throughput is recommended:

  • read: 3000 IOPS at 50MB/s
  • write: 3000 IOPS at 50MB/s

Furthermore, for each active developer we require 1 core, 1 GB of RAM, and 10 GB of storage.

We’re happy to look into support for different versions and configurations.

Kubernetes NGINX Ingress

By default, Coder Enterprise deploys an NGINX Kubernetes ingress controller to allocate and route requests to the appropriate service. This can be disabled in the helm chart values if you would like to bring your own ingress or gateway.


Deploying Kubernetes

If you already have a kubernetes cluster running with the requirements mentioned above, you can skip down to Installing Coder onto Kubernetes.

Deployment Guides

Amazon Elastic Kubernetes Engine

The following steps will guide you through setting up an EKS cluster that Coder can deploy onto.

This deployment requires that the eksctl command line utility is installed on your machine.

The following will spin up a kubernetes cluster using the eksctl command, replace the parameters and environment variables with the values that you see fit.

CLUSTER_NAME="MY_CLUSTER_NAME" SSH_KEY_PATH="~/.ssh/my-public-key.pub" REGION="us-east-2" \
    eksctl create cluster \
    --name "$CLUSTER_NAME" \
    --version 1.14 \
    --region "$REGION" \
    --nodegroup-name standard-workers \
    --node-type t3.medium \
    --nodes 2
    --nodes-min 2 \
    --nodes-max 8 \
    --ssh-access \
    --ssh-public-key "$SSH_KEY_PATH" \
    --managed

Once the cluster is created, you'll need to adjust the kubernetes storage class that is created as the default with EKS to support immediate volume binding.

First delete the default gp2 storage class:

kubectl delete sc gp2

Now recreate the default gp2 storage class with the volumeBindingMode set to Immediate:

cat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
  name: gp2
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
  fsType: ext4
volumeBindingMode: Immediate
EOF

Once these steps are done, your EKS cluster will be properly setup. You can now proceed to post deployment to finish setting up your local environment to deploy Coder.

Google Kubernetes Engine

The following steps will guide you through setting up a GKE cluster that Coder can deploy onto.

There are options to create it through the cloud console or through the gcloud command.

Through the cloud console

  1. Navigate to the Kubernetes Engine page in the google cloud console
  2. Click "CREATE CLUSTER"
  3. Adjust the name, number of nodes, zonal or regional fields to your desired values
  4. For the Master version, Coder has been tested to work with versions greater than "1.14.6"
  5. Select a "Machine configuration" that will work appropriately for your expected workloads as long as it's greater than the resource requirements mentioned above
  6. At the bottom of the page, select the "Availability, networking, security, and additional features" dropdown
  7. Scroll to the "Load balancing" section and select "Enable HTTP load balancing" to disable the GCE ingress controller
  8. Scroll to the "Network security" section and select "Enable network policy" to enable the networking.k8s.io/v1 kubernetes extension
  9. Click "Create" to create your cluster

You can now proceed to post deployment to finish setting up your local environment to deploy Coder.

Through the command line

This deployment option requires that the gcloud CLI is installed on your machine.

The following will spin up a kubernetes cluster using the gcloud command, replace the parameters and environment variables with the values that you see fit.

PROJECT_ID="MY_PROJECT_ID" CLUSTER_NAME="MY_CLUSTER_NAME" \
    gcloud beta container --project "$PROJECT_ID" \
    clusters create "$CLUSTER_NAME" \
    --zone "us-central1-a" \
    --no-enable-basic-auth \
    --cluster-version "1.14.7-gke.14" \
    --machine-type "n1-standard-4" \
    --image-type "COS" \
    --disk-type "pd-standard" \
    --disk-size "100" \
    --metadata disable-legacy-endpoints=true \
    --scopes "https://www.googleapis.com/auth/cloud-platform" \
    --num-nodes "2" \
    --enable-stackdriver-kubernetes \
    --enable-ip-alias \
    --network "projects/${PROJECT_ID}/global/networks/default" \
    --subnetwork "projects/${PROJECT_ID}/regions/us-central1/subnetworks/default" \
    --default-max-pods-per-node "110" \
    --addons HorizontalPodAutoscaling,HttpLoadBalancing \
    --enable-autoupgrade \
    --enable-autorepair \
    --enable-network-policy \
    --enable-autoscaling --min-nodes "2" --max-nodes "8"

You can now proceed to post deployment to finish setting up your local environment to deploy Coder.

Post Deployment

After deploying you will need to configure kubectl to point to your cluster.

  1. Ensure the gcloud CLI is installed.

  2. Ensure kubectl is installed through the gcloud command:

   gcloud components install kubectl
  1. Initialize kubectl with the cluster credentials:
   gcloud container clusters get-credentials [CLUSTER_NAME]
  1. It is recommended to run Coder in a separate namespace
   kubectl create namespace coder
  1. (Optional) Change the kubectl context to point to your newly created namespace
   kubectl config set-context --current --namespace=coder

You should now be setup and ready to deploy Coder onto your cluster.

Installing Coder onto Kubernetes

Dependency installation instructions:


  1. Add the Coder helm repo
   helm repo add coder https://helm.coder.com
  1. Install the helm chart into the cluster
   helm install --namespace coder coder coder/coder --version 1.4.2
  1. After the pod is created, start tailing the logs to find the randomly generated password for the admin user
   kubectl logs services/cemanager cemanager -f

When the manager is finished setting up, you will see something like this:

   ----------------------
   User:     admin
   Password: kvhvm43nq8k3
   ----------------------

These are the credentials you will use to setup the platform on the Web UI.

  1. Run the following to find the IP address used to access the Web UI by listing the running Kubernetes services
   kubectl --namespace coder get services
   NAME            TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                       AGE
   ingress-nginx   LoadBalancer   10.181.8.228    35.239.169.212   80:32534/TCP,443:31916/TCP    3h55m

The ingress-nginx service should provide an EXTERNAL-IP that routes the requests to the cemanager and envproxy services.

  1. In your browser, navigate to the external IP of ingress-nginx and use the credentials to login to the platform
  2. After logging in, you will be required to create a new password for the system admin user

Configuration

After setting a permanent password, you will be brought to the configuration dashboard where you can specify the authentication method, license, and additional settings. The default values should be fine for an evaluation deployment. Once the configuration is completed, you will be brought to the main dashboard where you can create new users, images, and environments.

After going through the configuration process, it's recommended that you create an admin user for yourself to create additional users and resources. The system admin should only be used for the initial configuration.

Table of Contents