mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
docs: add new doc on how to deploy Coder on Rancher (#16534)
[preview](https://coder.com/docs/@deploy-on-rancher/install/rancher) --------- Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>
This commit is contained in:
5
docs/images/icons/rancher.svg
Normal file
5
docs/images/icons/rancher.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="201" height="94" viewBox="0 0 201 94" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M200.7 20.6L198.5 7.6C197.8 3.4 196.2 0 194.9 0C193.6 0 192.5 3.5 192.5 7.7V11.1C192.5 15.3 189 18.8 184.8 18.8H181.4C181.2 18.8 180.9 18.8 180.7 18.8V28.2C180.9 28.2 181.2 28.2 181.4 28.2H194.2C198.5 28.2 201.4 24.8 200.7 20.6Z" fill="white"/>
|
||||
<path d="M170 9.6H149.2C149 9.6 148.9 9.6 148.7 9.6H127.4C127.1 9.6 126.9 9.6 126.7 9.7V7.7C126.7 3.5 125.6 0 124.3 0C123 0 121.4 3.4 120.7 7.6L118.5 20.6C117.8 24.8 120.7 28.2 124.9 28.2H137.7C139 28.2 140.3 28 141.3 27.6C140.9 29.8 139 31.4 136.7 31.4H118.7C115.8 31.4 113.6 28.8 114.1 25.9L115.9 15C116.4 12.1 114.2 9.5 111.3 9.5H22.1C20.2 9.5 18.6 10.6 17.8 12.3L1.00001 38C0.700007 38.4 0.700007 39 1.10001 39.4L4.40001 43.3C4.80001 43.8 5.50001 43.9 6.00001 43.5L17.4 34.5V89.3C17.4 91.9 19.5 94 22.1 94H47.5C50.1 94 52.2 91.9 52.2 89.3V70.3C52.2 67.7 54.3 65.6 56.9 65.6H120.2C122.8 65.6 124.9 67.7 124.9 70.3V89.3C124.9 91.9 127 94 129.6 94H155C157.6 94 159.7 91.9 159.7 89.3V68.6H146.2C142 68.6 138.5 65.1 138.5 60.9V47.8C138.5 45.3 139.7 43.1 141.6 41.7V57.4C141.6 61.6 145.1 65.1 149.3 65.1H170C174.2 65.1 177.7 61.6 177.7 57.4V17.4C177.7 13.1 174.2 9.6 170 9.6Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
BIN
docs/images/install/coder-rancher.png
Normal file
BIN
docs/images/install/coder-rancher.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
161
docs/install/rancher.md
Normal file
161
docs/install/rancher.md
Normal file
@ -0,0 +1,161 @@
|
||||
# Deploy Coder on Rancher
|
||||
|
||||
You can deploy Coder on Rancher as a
|
||||
[Workload](https://ranchermanager.docs.rancher.com/getting-started/quick-start-guides/deploy-workloads/workload-ingress).
|
||||
|
||||
## Requirements
|
||||
|
||||
- [SUSE Rancher Manager](https://ranchermanager.docs.rancher.com/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster) running Kubernetes (K8s) 1.19+ with [SUSE Rancher Prime distribution](https://documentation.suse.com/cloudnative/rancher-manager/latest/en/integrations/kubernetes-distributions.html) (Rancher Manager 2.10+)
|
||||
- Helm 3.5+ installed
|
||||
- Workload Kubernetes cluster for Coder
|
||||
|
||||
## Overview
|
||||
|
||||
Installing Coder on Rancher involves four key steps:
|
||||
|
||||
1. Create a namespace for Coder
|
||||
1. Set up PostgreSQL
|
||||
1. Create a database connection secret
|
||||
1. Install the Coder application via Rancher UI
|
||||
|
||||
## Create a namespace
|
||||
|
||||
Create a namespace for the Coder control plane. In this tutorial, we call it `coder`:
|
||||
|
||||
```shell
|
||||
kubectl create namespace coder
|
||||
```
|
||||
|
||||
## Set up PostgreSQL
|
||||
|
||||
Coder requires a PostgreSQL database to store deployment data.
|
||||
We recommend that you use a managed PostgreSQL service, but you can use an in-cluster PostgreSQL service for non-production deployments:
|
||||
|
||||
<div class="tabs">
|
||||
|
||||
### Managed PostgreSQL (Recommended)
|
||||
|
||||
For production deployments, we recommend using a managed PostgreSQL service:
|
||||
|
||||
- [Google Cloud SQL](https://cloud.google.com/sql/docs/postgres/)
|
||||
- [AWS RDS for PostgreSQL](https://aws.amazon.com/rds/postgresql/)
|
||||
- [Azure Database for PostgreSQL](https://docs.microsoft.com/en-us/azure/postgresql/)
|
||||
- [DigitalOcean Managed PostgreSQL](https://www.digitalocean.com/products/managed-databases-postgresql)
|
||||
|
||||
Ensure that your PostgreSQL service:
|
||||
|
||||
- Is running and accessible from your cluster
|
||||
- Is in the same network/project as your cluster
|
||||
- Has proper credentials and a database created for Coder
|
||||
|
||||
### In-Cluster PostgreSQL (Development/PoC)
|
||||
|
||||
For proof-of-concept deployments, you can use Bitnami Helm chart to install PostgreSQL in your Kubernetes cluster:
|
||||
|
||||
```console
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm install coder-db bitnami/postgresql \
|
||||
--namespace coder \
|
||||
--set auth.username=coder \
|
||||
--set auth.password=coder \
|
||||
--set auth.database=coder \
|
||||
--set persistence.size=10Gi
|
||||
```
|
||||
|
||||
After installation, the cluster-internal database URL will be:
|
||||
|
||||
```text
|
||||
postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable
|
||||
```
|
||||
|
||||
For more advanced PostgreSQL management, consider using the
|
||||
[Postgres operator](https://github.com/zalando/postgres-operator).
|
||||
|
||||
</div>
|
||||
|
||||
## Create the database connection secret
|
||||
|
||||
Create a Kubernetes secret with your PostgreSQL connection URL:
|
||||
|
||||
```shell
|
||||
kubectl create secret generic coder-db-url -n coder \
|
||||
--from-literal=url="postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable"
|
||||
```
|
||||
|
||||
> [!Important]
|
||||
> If you're using a managed PostgreSQL service, replace the connection URL with your specific database credentials.
|
||||
|
||||
## Install Coder through the Rancher UI
|
||||
|
||||

|
||||
|
||||
1. In the Rancher Manager console, select your target Kubernetes cluster for Coder.
|
||||
|
||||
1. Navigate to **Apps** > **Charts**
|
||||
|
||||
1. From the dropdown menu, select **Partners** and search for `Coder`
|
||||
|
||||
1. Select **Coder**, then **Install**
|
||||
|
||||
1. Select the `coder` namespace you created earlier and check **Customize Helm options before install**.
|
||||
|
||||
Select **Next**
|
||||
|
||||
1. On the configuration screen, select **Edit YAML** and enter your Coder configuration settings:
|
||||
|
||||
<details>
|
||||
<summary>Example values.yaml configuration</summary>
|
||||
|
||||
```yaml
|
||||
coder:
|
||||
# Environment variables for Coder
|
||||
env:
|
||||
- name: CODER_PG_CONNECTION_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: coder-db-url
|
||||
key: url
|
||||
|
||||
# For production, uncomment and set your access URL
|
||||
# - name: CODER_ACCESS_URL
|
||||
# value: "https://coder.example.com"
|
||||
|
||||
# For TLS configuration (uncomment if needed)
|
||||
#tls:
|
||||
# secretNames:
|
||||
# - my-tls-secret-name
|
||||
```
|
||||
|
||||
For available configuration options, refer to the [Helm chart documentation](https://github.com/coder/coder/blob/main/helm#readme)
|
||||
or [values.yaml file](https://github.com/coder/coder/blob/main/helm/coder/values.yaml).
|
||||
|
||||
</details>
|
||||
|
||||
1. Select a Coder version:
|
||||
|
||||
- **Mainline**: `2.20.x`
|
||||
- **Stable**: `2.19.x`
|
||||
|
||||
Learn more about release channels in the [Releases documentation](./releases.md).
|
||||
|
||||
1. Select **Next** when your configuration is complete.
|
||||
|
||||
1. On the **Supply additional deployment options** screen:
|
||||
|
||||
1. Accept the default settings
|
||||
1. Select **Install**
|
||||
|
||||
1. A Helm install output shell will be displayed and indicates the installation status.
|
||||
|
||||
## Manage your Rancher Coder deployment
|
||||
|
||||
To update or manage your Coder deployment later:
|
||||
|
||||
1. Navigate to **Apps** > **Installed Apps** in the Rancher UI.
|
||||
1. Find and select Coder.
|
||||
1. Use the options in the **⋮** menu for upgrade, rollback, or other operations.
|
||||
|
||||
## Next steps
|
||||
|
||||
- [Create your first template](../tutorials/template-from-scratch.md)
|
||||
- [Control plane configuration](../admin/setup/index.md)
|
@ -48,6 +48,12 @@
|
||||
"path": "./install/kubernetes.md",
|
||||
"icon_path": "./images/icons/kubernetes.svg"
|
||||
},
|
||||
{
|
||||
"title": "Rancher",
|
||||
"description": "Deploy Coder on Rancher",
|
||||
"path": "./install/rancher.md",
|
||||
"icon_path": "./images/icons/rancher.svg"
|
||||
},
|
||||
{
|
||||
"title": "OpenShift",
|
||||
"description": "Install Coder on OpenShift",
|
||||
|
Reference in New Issue
Block a user