From 0aadebe1bfe49e8279218ee83f74b11d77de49b1 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 28 Jul 2022 17:22:11 +0000 Subject: [PATCH 1/5] feat: add helm README, install guide, linters --- .github/workflows/coder.yaml | 53 +++++++++++++++++--- docs/install.md | 95 +++++++++++++++++++++++++++++++++++- helm/.helmignore | 2 + helm/Makefile | 26 ++++++++++ helm/README.md | 36 ++++++++++++++ helm/README.md.gotmpl | 23 +++++++++ helm/values.yaml | 1 - 7 files changed, 227 insertions(+), 9 deletions(-) create mode 100644 helm/Makefile create mode 100644 helm/README.md create mode 100644 helm/README.md.gotmpl diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 9bce6a892d276..3eb717f5329cb 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -36,6 +36,7 @@ jobs: docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }} go: ${{ steps.filter.outputs.go }} sh: ${{ steps.filter.outputs.sh }} + k8s: ${{ steps.filter.outputs.k8s }} steps: - uses: actions/checkout@v3 # For pull requests it's not necessary to checkout the code @@ -55,6 +56,10 @@ jobs: - "**.sum" sh: - "**.sh" + k8s: + - 'helm/**' + - Dockerfile + - scripts/helm.sh - id: debug run: | echo "${{ toJSON(steps.filter )}}" @@ -147,6 +152,26 @@ jobs: run: yarn lint working-directory: site + style-lint-k8s: + name: "style/lint/k8s" + timeout-minutes: 5 + needs: changes + if: needs.changes.outputs.k8s == 'true' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install helm + uses: azure/setup-helm@v3 + with: + version: v3.9.2 + + - name: cd helm && make lint + run: | + cd helm + make lint + gen: name: "style/gen" timeout-minutes: 8 @@ -196,14 +221,27 @@ jobs: path: ${{ steps.go-cache-paths.outputs.go-mod }} key: ${{ github.job }}-go-mod-${{ hashFiles('**/go.sum') }} - - run: | + - name: Install sqlc + run: | curl -sSL https://github.com/kyleconroy/sqlc/releases/download/v1.13.0/sqlc_1.13.0_linux_amd64.tar.gz | sudo tar -C /usr/bin -xz sqlc + - name: Install protoc-gen-go + run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 + - name: Install protoc-gen-go-drpc + run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 + - name: Install goimports + run: go install golang.org/x/tools/cmd/goimports@latest + - name: Install helm-docs + run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0 + + - name: make gen + run: "make --output-sync -j -B gen" + - name: cd helm && make gen + run: | + cd helm + make --output-sync -j -B gen - - run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 - - run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 - - run: go install golang.org/x/tools/cmd/goimports@latest - - run: "make --output-sync -j -B gen" - - run: ./scripts/check_unstaged.sh + - name: Check for unstaged files + run: ./scripts/check_unstaged.sh style-fmt: name: "style/fmt" @@ -235,7 +273,8 @@ jobs: - name: Install shfmt run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.5.0 - - run: | + - name: make fmt + run: | export PATH=${PATH}:$(go env GOPATH)/bin make --output-sync -j -B fmt diff --git a/docs/install.md b/docs/install.md index 64669f1d7f419..69b671d707d6b 100644 --- a/docs/install.md +++ b/docs/install.md @@ -46,7 +46,7 @@ journalctl -u coder.service -b Before proceeding, please ensure that you have both Docker and the [latest version of Coder](https://github.com/coder/coder/releases) installed. -> See our [docker-compose](https://github.com/coder/coder/blob/93b78755a6d48191cc53c82654e249f25fc00ce9/docker-compose.yaml) file +> See our [docker-compose](https://github.com/coder/coder/blob/main/docker-compose.yaml) file > for additional information. 1. Clone the `coder` repository: @@ -105,6 +105,99 @@ grep /etc/group -e "docker" sudo systemctl restart coder.service ``` +## Kubernetes via Helm + +Before proceeding, please ensure that you have both Helm and the [latest version +of Coder](https://github.com/coder/coder/releases) installed. + +> See our [Helm README](https://github.com/coder/coder/blob/main/helm#readme) +> file for additional information. + +> ⚠️ **Warning**: Helm support is new and not yet complete. There may be changes +> to the Helm chart between releases which require manual values updates. Please +> file an issue if you run into any issues. +> +> Additionally, the Helm chart does not currently automatically configure a +> Service Account and workspace template for use in Coder. See +> [#3265](https://github.com/coder/coder/issues/3265). + + +1. Create a PostgreSQL deployment. Coder does not manage a database server for + you. + + - If you're in a public cloud such as + [Google Cloud](https://cloud.google.com/sql/docs/postgres/), + [AWS](https://aws.amazon.com/rds/postgresql/), + [Azure](https://docs.microsoft.com/en-us/azure/postgresql/), or + [DigitalOcean](https://www.digitalocean.com/products/managed-databases-postgresql), + you can use the managed PostgreSQL offerings they provide. Make sure that + the PostgreSQL service is running and accessible from your cluster. It + should be in the same network, same project, etc. + - You can install Postgres manually on your cluster using the + [Bitnami PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#readme). + There are some + [helpful guides](https://phoenixnap.com/kb/postgresql-kubernetes) on the + internet that explain sensible configurations for this chart. + - You can use + [Postgres operator](https://github.com/zalando/postgres-operator) to + manage PostgreSQL deployments on your Kubernetes cluster. + +1. Download the latest `coder_helm` package from + [GitHub releases](https://github.com/coder/coder/releases). + +1. Create a `values.yaml` with the configuration settings you'd like for your deployment. + + ```yaml + coder: + # You can specify any environment variables you'd like to pass to Coder + # here. Coder consumes environment variables listed in + # `coder server --help`, and these environment variables are also passed + # to the workspace provisioner (so you can consume them in your Terraform + # templates for auth keys etc.). + # + # Please keep in mind that you should not set `CODER_ADDRESS`, + # `CODER_TLS_ENABLE`, `CODER_TLS_CERT_FILE` or `CODER_TLS_KEY_FILE` as + # they are already set by the Helm chart and will cause conflicts. + env: + - name: CODER_ACCESS_URL + value: "https://coder.mydomain.com" + - name: CODER_PG_CONNECTION_URL + value: "postgres://coder:password@postgres:5432/coder" + + tls: + secretName: my-tls-secret-name + ``` + + > You can view our + > [Helm README](https://github.com/coder/coder/blob/main/helm#readme) for + > details on the values that are available, or you can view the + > [values.yaml](https://github.com/coder/coder/blob/main/helm/values.yaml) + > file directly. + +1. Run the following commands to install the chart in your cluster. + + ```console + $ kubectl create namespace coder + $ helm install coder ./coder_helm_x.y.z.tgz \ + --namespace coder \ + -f values.yaml + ``` + +You can watch Coder start up by running `kubectl get pods`. Once Coder has +started, the `coder-*` pods should enter the `Running` state. + +You can view Coder's logs by getting the pod name from `kubectl get pods` and +then running `kubectl logs `. You can also view these logs in your +Cloud's log management system if you are using managed Kubernetes. + +To upgrade Coder in the future, you can run the following command with a new `coder_helm_x.y.z.tgz` file from GitHub releases: + +```console +$ helm upgrade coder ./coder_helm_x.y.z.tgz \ + --namespace coder \ + -f values.yaml +``` + ## Manual We publish self-contained .zip and .tar.gz archives in [GitHub releases](https://github.com/coder/coder/releases). The archives bundle `coder` binary. diff --git a/helm/.helmignore b/helm/.helmignore index 0e8a0eb36f4ca..4744499dafc42 100644 --- a/helm/.helmignore +++ b/helm/.helmignore @@ -21,3 +21,5 @@ .idea/ *.tmproj .vscode/ +Makefile +README.md.gotmpl diff --git a/helm/Makefile b/helm/Makefile new file mode 100644 index 0000000000000..d59d4a3d3f21d --- /dev/null +++ b/helm/Makefile @@ -0,0 +1,26 @@ +# Use a single bash shell for each job, and immediately exit on failure +SHELL := bash +.SHELLFLAGS = -ceu +.ONESHELL: + +# This doesn't work on directories. +# See https://stackoverflow.com/questions/25752543/make-delete-on-error-for-directory-targets +.DELETE_ON_ERROR: + +all: lint gen +.PHONY: all + +lint: lint/helm +.PHONY: lint + +lint/helm: + helm lint --strict . +.PHONY: lint/helm + +gen: README.md +.PHONY: gen + +README.md: README.md.gotmpl values.yaml + helm-docs --template-files=$< + @printf "\n\n%s\n" "$$(cat README.md)" > README.md +.PHONY: README.md diff --git a/helm/README.md b/helm/README.md new file mode 100644 index 0000000000000..27fe1db52b9f6 --- /dev/null +++ b/helm/README.md @@ -0,0 +1,36 @@ + + +# Coder Helm Chart + +This directory contains the Helm chart used to deploy Coder onto a Kubernetes +cluster. It contains the minimum required components to run Coder on Kubernetes, +and notably (compared to Coder Classic) does not include a database server. + +## Getting Started + +> ⚠️ **Warning**: The main branch in this repository does not represent the +> latest release of Coder. Please reference our installation docs for +> instructions on a tagged release. + +View +[our docs](https://coder.com/docs/coder-oss/latest/install#kubernetes-via-helm) +for detailed installation instructions. + +## Values + +| Key | Type | Description | Default | +| ------------------- | ---- | ----------- | ------------------------------- | +| coder | object | Primary configuration for `coder server`. | `{"env":[{"name":"CODER_ACCESS_URL","value":"https://coder.example.com"}],"image":{"pullPolicy":"IfNotPresent","repo":"ghcr.io/coder/coder","tag":""},"resources":{},"service":{"enable":true,"externalTrafficPolicy":"Cluster","loadBalancerIP":"","type":"LoadBalancer"},"tls":{"secretName":""}}` | +| coder.env | list | The environment variables to set for Coder. These can be used to configure all aspects of `coder server`. Please see `coder server --help` for information about what environment variables can be set. Note: The following environment variables are set by default and cannot be overridden: - CODER_ADDRESS: set to 0.0.0.0:80 and cannot be changed. - CODER_TLS_ENABLE: set if tls.secretName is not empty. - CODER_TLS_CERT_FILE: set if tls.secretName is not empty. - CODER_TLS_KEY_FILE: set if tls.secretName is not empty. | `[{"name":"CODER_ACCESS_URL","value":"https://coder.example.com"}]` | +| coder.image | object | The image to use for Coder. | `{"pullPolicy":"IfNotPresent","repo":"ghcr.io/coder/coder","tag":""}` | +| coder.image.pullPolicy | string | The pull policy to use for the image. See: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy | `"IfNotPresent"` | +| coder.image.repo | string | The repository of the image. | `"ghcr.io/coder/coder"` | +| coder.image.tag | string | The tag of the image, defaults to {{.Chart.AppVersion}} if not set. | `""` | +| coder.resources | object | The resources to request for Coder. These are optional and are not set by default. | `{}` | +| coder.service | object | The Service object to expose for Coder. | `{"enable":true,"externalTrafficPolicy":"Cluster","loadBalancerIP":"","type":"LoadBalancer"}` | +| coder.service.enable | bool | Whether to create the Service object. | `true` | +| coder.service.externalTrafficPolicy | string | The external traffic policy to use. You may need to change this to "Local" to preserve the source IP address in some situations. https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip | `"Cluster"` | +| coder.service.loadBalancerIP | string | The IP address of the LoadBalancer. If not specified, a new IP will be generated each time the load balancer is recreated. It is recommended to manually create a static IP address in your cloud and specify it here in production to avoid accidental IP address changes. | `""` | +| coder.service.type | string | The type of service to expose. See: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types | `"LoadBalancer"` | +| coder.tls | object | The TLS configuration for Coder. | `{"secretName":""}` | +| coder.tls.secretName | string | The name of the secret containing the TLS certificate. The secret should exist in the same namespace as the Helm deployment and should be of type "kubernetes.io/tls". The secret will be automatically mounted into the pod if specified, and the correct "CODER_TLS_*" environment variables will be set for you. | `""` | diff --git a/helm/README.md.gotmpl b/helm/README.md.gotmpl new file mode 100644 index 0000000000000..5014844d37d86 --- /dev/null +++ b/helm/README.md.gotmpl @@ -0,0 +1,23 @@ +# Coder Helm Chart + +This directory contains the Helm chart used to deploy Coder onto a Kubernetes +cluster. It contains the minimum required components to run Coder on Kubernetes, +and notably (compared to Coder Classic) does not include a database server. + +## Getting Started + +> ⚠️ **Warning**: The main branch in this repository does not represent the +> latest release of Coder. Please reference our installation docs for +> instructions on a tagged release. + +View +[our docs](https://coder.com/docs/coder-oss/latest/install#kubernetes-via-helm) +for detailed installation instructions. + +## Values + +| Key | Type | Description | Default | +| ------------------- | ---- | ----------- | ------------------------------- | +{{- range .Values }} +| {{ .Key }} | {{ .Type }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | +{{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 2090296dc467d..41b8fb39670d9 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -19,7 +19,6 @@ coder: # coder.env -- The environment variables to set for Coder. These can be used # to configure all aspects of `coder server`. Please see `coder server --help` # for information about what environment variables can be set. - # # Note: The following environment variables are set by default and cannot be # overridden: # - CODER_ADDRESS: set to 0.0.0.0:80 and cannot be changed. From 64eee00a84bb73e6816a602e48bff232ae1e841d Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 28 Jul 2022 17:26:44 +0000 Subject: [PATCH 2/5] Add Helm and k8s version requirements to helm install guide --- docs/install.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/install.md b/docs/install.md index 69b671d707d6b..b010c8e785660 100644 --- a/docs/install.md +++ b/docs/install.md @@ -107,8 +107,9 @@ sudo systemctl restart coder.service ## Kubernetes via Helm -Before proceeding, please ensure that you have both Helm and the [latest version -of Coder](https://github.com/coder/coder/releases) installed. +Before proceeding, please ensure that you have both Helm 3.5+ and the +[latest version of Coder](https://github.com/coder/coder/releases) installed. +You will also need to have a Kubernetes cluster running K8s 1.19+. > See our [Helm README](https://github.com/coder/coder/blob/main/helm#readme) > file for additional information. From 0285c7a27e6d44771070a0b4ca6423f45d1cdaaa Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 18 Aug 2022 16:03:04 +0000 Subject: [PATCH 3/5] Add commands for installing bitnami postgres --- docs/install.md | 49 +++++++++++++++++++++++++++++++++++-------- helm/Makefile | 10 +-------- helm/README.md | 49 +++++++++++++++++++++++++++---------------- helm/README.md.gotmpl | 23 -------------------- helm/values.yaml | 6 +----- 5 files changed, 73 insertions(+), 64 deletions(-) delete mode 100644 helm/README.md.gotmpl diff --git a/docs/install.md b/docs/install.md index b010c8e785660..f37c2153ee3c8 100644 --- a/docs/install.md +++ b/docs/install.md @@ -112,7 +112,9 @@ Before proceeding, please ensure that you have both Helm 3.5+ and the You will also need to have a Kubernetes cluster running K8s 1.19+. > See our [Helm README](https://github.com/coder/coder/blob/main/helm#readme) -> file for additional information. +> file for additional information. Check the +> [values.yaml](https://github.com/coder/coder/blob/main/helm/values.yaml) file +> for a list of supported Helm values and their defaults. > ⚠️ **Warning**: Helm support is new and not yet complete. There may be changes > to the Helm chart between releases which require manual values updates. Please @@ -122,6 +124,11 @@ You will also need to have a Kubernetes cluster running K8s 1.19+. > Service Account and workspace template for use in Coder. See > [#3265](https://github.com/coder/coder/issues/3265). +1. Create a namespace for Coder, such as `coder`: + + ```console + $ kubectl create namespace coder + ``` 1. Create a PostgreSQL deployment. Coder does not manage a database server for you. @@ -134,11 +141,29 @@ You will also need to have a Kubernetes cluster running K8s 1.19+. you can use the managed PostgreSQL offerings they provide. Make sure that the PostgreSQL service is running and accessible from your cluster. It should be in the same network, same project, etc. + - You can install Postgres manually on your cluster using the - [Bitnami PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#readme). - There are some + [Bitnami PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#readme). There are some [helpful guides](https://phoenixnap.com/kb/postgresql-kubernetes) on the - internet that explain sensible configurations for this chart. + internet that explain sensible configurations for this chart. Example: + + ```console + $ helm repo add bitnami https://charts.bitnami.com/bitnami + $ helm install postgres bitnami/postgresql \ + --namespace coder \ + --set auth.username=coder \ + --set auth.password=coder \ + --set auth.database=coder \ + --set persistence.size=10Gi + ``` + + The cluster-internal DB URL for the above database is: + ``` + postgres://coder:coder@postgres-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable + ``` + + > Ensure you set up periodic backups so you don't lose data. + - You can use [Postgres operator](https://github.com/zalando/postgres-operator) to manage PostgreSQL deployments on your Kubernetes cluster. @@ -146,7 +171,8 @@ You will also need to have a Kubernetes cluster running K8s 1.19+. 1. Download the latest `coder_helm` package from [GitHub releases](https://github.com/coder/coder/releases). -1. Create a `values.yaml` with the configuration settings you'd like for your deployment. +1. Create a `values.yaml` with the configuration settings you'd like for your + deployment. For example: ```yaml coder: @@ -161,9 +187,15 @@ You will also need to have a Kubernetes cluster running K8s 1.19+. # they are already set by the Helm chart and will cause conflicts. env: - name: CODER_ACCESS_URL - value: "https://coder.mydomain.com" + value: "https://coder.example.com" - name: CODER_PG_CONNECTION_URL - value: "postgres://coder:password@postgres:5432/coder" + valueFrom: + secretKeyRef: + # You'll need to create a secret called coder-db-url with your + # Postgres connection URL like: + # postgres://coder:password@postgres:5432/coder?sslmode=disable + name: coder-db-url + key: url tls: secretName: my-tls-secret-name @@ -178,10 +210,9 @@ You will also need to have a Kubernetes cluster running K8s 1.19+. 1. Run the following commands to install the chart in your cluster. ```console - $ kubectl create namespace coder $ helm install coder ./coder_helm_x.y.z.tgz \ --namespace coder \ - -f values.yaml + --values values.yaml ``` You can watch Coder start up by running `kubectl get pods`. Once Coder has diff --git a/helm/Makefile b/helm/Makefile index d59d4a3d3f21d..2d88f4ff09b43 100644 --- a/helm/Makefile +++ b/helm/Makefile @@ -7,7 +7,7 @@ SHELL := bash # See https://stackoverflow.com/questions/25752543/make-delete-on-error-for-directory-targets .DELETE_ON_ERROR: -all: lint gen +all: lint .PHONY: all lint: lint/helm @@ -16,11 +16,3 @@ lint: lint/helm lint/helm: helm lint --strict . .PHONY: lint/helm - -gen: README.md -.PHONY: gen - -README.md: README.md.gotmpl values.yaml - helm-docs --template-files=$< - @printf "\n\n%s\n" "$$(cat README.md)" > README.md -.PHONY: README.md diff --git a/helm/README.md b/helm/README.md index 27fe1db52b9f6..41732b5c67363 100644 --- a/helm/README.md +++ b/helm/README.md @@ -1,5 +1,3 @@ - - # Coder Helm Chart This directory contains the Helm chart used to deploy Coder onto a Kubernetes @@ -18,19 +16,34 @@ for detailed installation instructions. ## Values -| Key | Type | Description | Default | -| ------------------- | ---- | ----------- | ------------------------------- | -| coder | object | Primary configuration for `coder server`. | `{"env":[{"name":"CODER_ACCESS_URL","value":"https://coder.example.com"}],"image":{"pullPolicy":"IfNotPresent","repo":"ghcr.io/coder/coder","tag":""},"resources":{},"service":{"enable":true,"externalTrafficPolicy":"Cluster","loadBalancerIP":"","type":"LoadBalancer"},"tls":{"secretName":""}}` | -| coder.env | list | The environment variables to set for Coder. These can be used to configure all aspects of `coder server`. Please see `coder server --help` for information about what environment variables can be set. Note: The following environment variables are set by default and cannot be overridden: - CODER_ADDRESS: set to 0.0.0.0:80 and cannot be changed. - CODER_TLS_ENABLE: set if tls.secretName is not empty. - CODER_TLS_CERT_FILE: set if tls.secretName is not empty. - CODER_TLS_KEY_FILE: set if tls.secretName is not empty. | `[{"name":"CODER_ACCESS_URL","value":"https://coder.example.com"}]` | -| coder.image | object | The image to use for Coder. | `{"pullPolicy":"IfNotPresent","repo":"ghcr.io/coder/coder","tag":""}` | -| coder.image.pullPolicy | string | The pull policy to use for the image. See: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy | `"IfNotPresent"` | -| coder.image.repo | string | The repository of the image. | `"ghcr.io/coder/coder"` | -| coder.image.tag | string | The tag of the image, defaults to {{.Chart.AppVersion}} if not set. | `""` | -| coder.resources | object | The resources to request for Coder. These are optional and are not set by default. | `{}` | -| coder.service | object | The Service object to expose for Coder. | `{"enable":true,"externalTrafficPolicy":"Cluster","loadBalancerIP":"","type":"LoadBalancer"}` | -| coder.service.enable | bool | Whether to create the Service object. | `true` | -| coder.service.externalTrafficPolicy | string | The external traffic policy to use. You may need to change this to "Local" to preserve the source IP address in some situations. https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip | `"Cluster"` | -| coder.service.loadBalancerIP | string | The IP address of the LoadBalancer. If not specified, a new IP will be generated each time the load balancer is recreated. It is recommended to manually create a static IP address in your cloud and specify it here in production to avoid accidental IP address changes. | `""` | -| coder.service.type | string | The type of service to expose. See: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types | `"LoadBalancer"` | -| coder.tls | object | The TLS configuration for Coder. | `{"secretName":""}` | -| coder.tls.secretName | string | The name of the secret containing the TLS certificate. The secret should exist in the same namespace as the Helm deployment and should be of type "kubernetes.io/tls". The secret will be automatically mounted into the pod if specified, and the correct "CODER_TLS_*" environment variables will be set for you. | `""` | +Please refer to [values.yaml](values.yaml) for available Helm values and their +defaults. + +A good starting point for your values file is: + +```yaml +coder: + # You can specify any environment variables you'd like to pass to Coder + # here. Coder consumes environment variables listed in + # `coder server --help`, and these environment variables are also passed + # to the workspace provisioner (so you can consume them in your Terraform + # templates for auth keys etc.). + # + # Please keep in mind that you should not set `CODER_ADDRESS`, + # `CODER_TLS_ENABLE`, `CODER_TLS_CERT_FILE` or `CODER_TLS_KEY_FILE` as + # they are already set by the Helm chart and will cause conflicts. + env: + - name: CODER_ACCESS_URL + value: "https://coder.example.com" + - name: CODER_PG_CONNECTION_URL + valueFrom: + secretKeyRef: + # You'll need to create a secret called coder-db-url with your + # Postgres connection URL like: + # postgres://coder:password@postgres:5432/coder?sslmode=disable + name: coder-db-url + key: url + + tls: + secretName: my-tls-secret-name +``` diff --git a/helm/README.md.gotmpl b/helm/README.md.gotmpl deleted file mode 100644 index 5014844d37d86..0000000000000 --- a/helm/README.md.gotmpl +++ /dev/null @@ -1,23 +0,0 @@ -# Coder Helm Chart - -This directory contains the Helm chart used to deploy Coder onto a Kubernetes -cluster. It contains the minimum required components to run Coder on Kubernetes, -and notably (compared to Coder Classic) does not include a database server. - -## Getting Started - -> ⚠️ **Warning**: The main branch in this repository does not represent the -> latest release of Coder. Please reference our installation docs for -> instructions on a tagged release. - -View -[our docs](https://coder.com/docs/coder-oss/latest/install#kubernetes-via-helm) -for detailed installation instructions. - -## Values - -| Key | Type | Description | Default | -| ------------------- | ---- | ----------- | ------------------------------- | -{{- range .Values }} -| {{ .Key }} | {{ .Type }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | -{{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 41b8fb39670d9..b0a3468570e14 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -25,11 +25,7 @@ coder: # - CODER_TLS_ENABLE: set if tls.secretName is not empty. # - CODER_TLS_CERT_FILE: set if tls.secretName is not empty. # - CODER_TLS_KEY_FILE: set if tls.secretName is not empty. - env: - - name: CODER_ACCESS_URL - value: "https://coder.example.com" - #- name: CODER_PG_CONNECTION_URL - # value: "postgres://coder:password@postgres:5432/coder?sslmode=disable" + env: [] # coder.tls -- The TLS configuration for Coder. tls: From 8a9522f9bb3d7baf49a247eff93ae217980642eb Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 18 Aug 2022 16:05:14 +0000 Subject: [PATCH 4/5] fixup! Merge branch 'main' into helm-docs --- .github/workflows/coder.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/coder.yaml b/.github/workflows/coder.yaml index 8e1e1bc2cb193..56fac61ca018d 100644 --- a/.github/workflows/coder.yaml +++ b/.github/workflows/coder.yaml @@ -219,15 +219,9 @@ jobs: run: go install storj.io/drpc/cmd/protoc-gen-go-drpc@v0.0.26 - name: Install goimports run: go install golang.org/x/tools/cmd/goimports@latest - - name: Install helm-docs - run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.11.0 - name: make gen run: "make --output-sync -j -B gen" - - name: cd helm && make gen - run: | - cd helm - make --output-sync -j -B gen - name: Check for unstaged files run: ./scripts/check_unstaged.sh From 532f42f4284074aaa4bdcd6f22428e29e3b94286 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 18 Aug 2022 16:06:58 +0000 Subject: [PATCH 5/5] fixup! Merge branch 'main' into helm-docs --- helm/.helmignore | 1 - 1 file changed, 1 deletion(-) diff --git a/helm/.helmignore b/helm/.helmignore index 4744499dafc42..c976b3b4672e6 100644 --- a/helm/.helmignore +++ b/helm/.helmignore @@ -22,4 +22,3 @@ *.tmproj .vscode/ Makefile -README.md.gotmpl pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy