From cebcd0b2d94834a75a4a834ad00ed3a9b00134ce Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 10 Jun 2021 21:09:18 +0000 Subject: [PATCH 1/5] Avoid pulling full values file during install --- package.json | 2 +- setup/installation.md | 28 +++++++++++++--------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 4f8d0a2bb..392835991 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "format:check": "prettier --check '**/*.{css,html,js,json,jsx,ts,tsx,yaml,yml}'", "format:write": "prettier --write '**/*.{css,html,js,json,jsx,ts,tsx,yaml,yml}'", "lint": "markdownlint --config .markdownlint.jsonc --rules .markdownlint-rules '**/*.md'", - "lint:fix": "markdownlint --fix '**/*.md'" + "lint:fix": "markdownlint --config .markdownlint.jsonc --rules .markdownlint-rules --fix '**/*.md'" }, "devDependencies": { "@types/minimist": "^1.2.1", diff --git a/setup/installation.md b/setup/installation.md index f49c804fa..19221f536 100644 --- a/setup/installation.md +++ b/setup/installation.md @@ -51,34 +51,32 @@ kubectl config set-context --current --namespace=coder **Steps 3-5 are optional for non-production deployments.** -1. Get a copy of your Helm chart so that you can modify it; you'll need to - modify the Helm chart to update your PostgreSQL databases (step 4) and enable - dev URLs (step 5): +1. Get a copy of your Helm config values so that you can modify it; you'll need + to modify the Helm chart to update your PostgreSQL databases (step 4) and + enable dev URLs (step 5): - a. Get a copy of your existing Helm chart and save it as `current-values.yaml`: - `helm show values coder/coder > current-values.yaml` + a. Get a copy of your existing Helm values and save it as `values.yaml`: + `helm get values coder -n coder | tail -n +2 > values.yaml` - b. Edit the `current-values.yaml` file as needed. Be sure to remove the lines - that you are _not_ modifying, otherwise the contents of `current-values.yaml` - will override those in the default chart. + b. Edit the `values.yaml` file as needed. > View the > [configuration options available in the `values.yaml` file.](https://github.com/cdr/enterprise-helm#values) c. Upgrade/install your Coder deployment with the updated Helm chart (be sure - to replace the placeholder value with your Coder version). **This must be done - whenever you update the Helm chart:** + to replace the placeholder value with your Coder version). **This must be + done whenever you update the Helm chart:** ```console - helm upgrade coder coder/coder -n coder --version= --values current-values.yaml + helm upgrade coder coder/coder -n coder --version= --values values.yaml ``` > If you omit `--version`, you'll upgrade to the latest version, excluding > release candidates (RCs). To include RCs, provide the `--devel` flag. > > We do not provide documentation for RCs, and you should not use them unless - you've been instructed to do so by Coder. You can identify RCs by the - presence of `-rc` in the version number (e.g., `1.16.0-rc.1`). + > you've been instructed to do so by Coder. You can identify RCs by the + > presence of `-rc` in the version number (e.g., `1.16.0-rc.1`). 1. Ensure that you have superuser privileges to your PostgreSQL database. Add the following to your Helm chart so that Coder uses your external PostgreSQL @@ -96,14 +94,14 @@ kubectl config set-context --current --namespace=coder ``` To create the `passwordSecret`, run - `kubectl create secret generic --from-file=test=/dev/stdin` + `echo "UserDefinedPassword" | kubectl create secret generic --from-file=password=/dev/stdin` (be sure to replace `UserDefinedPassword` with your actual password). You can find/define these values in your [PostgreSQL server configuration file](https://www.postgresql.org/docs/current/config-setting.html). > For more information, [see our guide](../guides/deployments/postgres.md) on - setting up a PostgreSQL instance. + > setting up a PostgreSQL instance. 1. [Enable dev URL usage](../admin/devurls.md). Dev URLs allow users to access the web servers running in your workspace. To enable, provide a wildcard From a834b7f3c161edae52324ef2f79956917653c865 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Thu, 10 Jun 2021 21:21:34 +0000 Subject: [PATCH 2/5] fixup! Avoid pulling full values file during install --- setup/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/installation.md b/setup/installation.md index 19221f536..465b6e17e 100644 --- a/setup/installation.md +++ b/setup/installation.md @@ -46,7 +46,7 @@ kubectl config set-context --current --namespace=coder `helm search repo coder -l`) ```console - helm install coder coder/coder --namespace coder + helm install coder coder/coder -n coder --version= ``` **Steps 3-5 are optional for non-production deployments.** From ed41540d5da9fc854be8b99dad408fbe39e33609 Mon Sep 17 00:00:00 2001 From: Katie Horne Date: Mon, 14 Jun 2021 15:03:58 -0500 Subject: [PATCH 3/5] Edit text --- setup/installation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/installation.md b/setup/installation.md index 465b6e17e..940416005 100644 --- a/setup/installation.md +++ b/setup/installation.md @@ -46,13 +46,13 @@ kubectl config set-context --current --namespace=coder `helm search repo coder -l`) ```console - helm install coder coder/coder -n coder --version= + helm install coder coder/coder -namespace coder --version= ``` **Steps 3-5 are optional for non-production deployments.** 1. Get a copy of your Helm config values so that you can modify it; you'll need - to modify the Helm chart to update your PostgreSQL databases (step 4) and + to modify these values to update your PostgreSQL databases (step 4) and enable dev URLs (step 5): a. Get a copy of your existing Helm values and save it as `values.yaml`: @@ -60,8 +60,8 @@ kubectl config set-context --current --namespace=coder b. Edit the `values.yaml` file as needed. - > View the - > [configuration options available in the `values.yaml` file.](https://github.com/cdr/enterprise-helm#values) + > View the [configuration options available in the `values.yaml` + > file.](https://github.com/cdr/enterprise-helm#values) c. Upgrade/install your Coder deployment with the updated Helm chart (be sure to replace the placeholder value with your Coder version). **This must be From ae9e5230ee3070857363ae9aa7a97fd3ba7681d9 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Mon, 14 Jun 2021 20:38:31 +0000 Subject: [PATCH 4/5] Comments --- setup/installation.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/setup/installation.md b/setup/installation.md index 940416005..972a42b86 100644 --- a/setup/installation.md +++ b/setup/installation.md @@ -46,7 +46,7 @@ kubectl config set-context --current --namespace=coder `helm search repo coder -l`) ```console - helm install coder coder/coder -namespace coder --version= + helm install coder coder/coder --namespace coder --version= ``` **Steps 3-5 are optional for non-production deployments.** @@ -55,20 +55,20 @@ kubectl config set-context --current --namespace=coder to modify these values to update your PostgreSQL databases (step 4) and enable dev URLs (step 5): - a. Get a copy of your existing Helm values and save it as `values.yaml`: - `helm get values coder -n coder | tail -n +2 > values.yaml` + a. Create an empty file called `values.yaml` which will contain your + deployment configuration options. b. Edit the `values.yaml` file as needed. - > View the [configuration options available in the `values.yaml` - > file.](https://github.com/cdr/enterprise-helm#values) + > View the + > [configuration options available in the `values.yaml` file.](https://github.com/cdr/enterprise-helm#values) c. Upgrade/install your Coder deployment with the updated Helm chart (be sure to replace the placeholder value with your Coder version). **This must be done whenever you update the Helm chart:** ```console - helm upgrade coder coder/coder -n coder --version= --values values.yaml + helm upgrade coder coder/coder --namespace coder --version= --values values.yaml ``` > If you omit `--version`, you'll upgrade to the latest version, excluding @@ -79,7 +79,7 @@ kubectl config set-context --current --namespace=coder > presence of `-rc` in the version number (e.g., `1.16.0-rc.1`). 1. Ensure that you have superuser privileges to your PostgreSQL database. Add - the following to your Helm chart so that Coder uses your external PostgreSQL + the following to your Helm values so that Coder uses your external PostgreSQL databases: ```yaml @@ -94,9 +94,17 @@ kubectl config set-context --current --namespace=coder ``` To create the `passwordSecret`, run - `echo "UserDefinedPassword" | kubectl create secret generic --from-file=password=/dev/stdin` + `kubectl create secret generic --from-literal="password=UserDefinedPassword"` (be sure to replace `UserDefinedPassword` with your actual password). + > Put a space before the command to prevent it from being saved in your shell + > history. + > + > Running this command could potentially expose your database password to + > other users on your system through `/proc`. If this is a concern, you can + > use `--from-file=password=/dev/stdin` instead of `--from-literal=...` to + > enter your password, and hit `Ctrl+D` when you're done to submit it. + You can find/define these values in your [PostgreSQL server configuration file](https://www.postgresql.org/docs/current/config-setting.html). From d5ef5f8787d7da7cf547b0e94ba2850e99173950 Mon Sep 17 00:00:00 2001 From: Katie Horne Date: Mon, 14 Jun 2021 15:48:08 -0500 Subject: [PATCH 5/5] Update installation.md --- setup/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/installation.md b/setup/installation.md index 972a42b86..1b994c335 100644 --- a/setup/installation.md +++ b/setup/installation.md @@ -103,7 +103,7 @@ kubectl config set-context --current --namespace=coder > Running this command could potentially expose your database password to > other users on your system through `/proc`. If this is a concern, you can > use `--from-file=password=/dev/stdin` instead of `--from-literal=...` to - > enter your password, and hit `Ctrl+D` when you're done to submit it. + > enter your password and press `Ctrl+D` when you're done to submit it. You can find/define these values in your [PostgreSQL server configuration file](https://www.postgresql.org/docs/current/config-setting.html).