From 8bb3c0de41c86f03e55cf038f225bd89b63d8696 Mon Sep 17 00:00:00 2001 From: Katie Horne Date: Fri, 24 Jun 2022 10:39:40 -0500 Subject: [PATCH 1/2] chore: add info re: always updating images --- docs/templates.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/templates.md b/docs/templates.md index 4b58acf4e3b8e..1b525d804e1c9 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -162,6 +162,23 @@ resource "docker_container" "workspace" { } ``` +#### Using updated images when rebuilding a workspace + +To ensure that Coder uses an updated image when rebuilding a workspace, set the +`imagePullPolicy` to `Always` in your Terraform template; when set, Coder will +check `image:tag` on every build and update if necessary: + +```tf +resource "kubernetes_pod" "podName" { + spec { + container { + image_pull_policy = "Always" + } + } +} +``` + + #### Delete workspaces When a workspace is deleted, the Coder server essentially runs a @@ -172,7 +189,7 @@ resources associated with the workspace. > [prevent-destroy](https://www.terraform.io/language/meta-arguments/lifecycle#prevent_destroy) > and > [ignore-changes](https://www.terraform.io/language/meta-arguments/lifecycle#ignore_changes) -> meta-arguments can be used to accidental data loss. +> meta-arguments can be used to accidental data loss. ### Coder apps From f42a33dc760f6d80a7970f167c9f29348c23463c Mon Sep 17 00:00:00 2001 From: Katie Horne Date: Tue, 28 Jun 2022 08:57:47 -0500 Subject: [PATCH 2/2] chore: add warning and faster option --- docs/templates.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/templates.md b/docs/templates.md index 1b525d804e1c9..9a11f1bfaa101 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -164,9 +164,14 @@ resource "docker_container" "workspace" { #### Using updated images when rebuilding a workspace -To ensure that Coder uses an updated image when rebuilding a workspace, set the -`imagePullPolicy` to `Always` in your Terraform template; when set, Coder will -check `image:tag` on every build and update if necessary: +To ensure that Coder uses an updated image when rebuilding a workspace, we +suggest that admins update the tag in the template (e.g., `my-image:v0.4.2` -> +`my-image:v0.4.3`) or digest (`my-image@sha256:[digest]` -> +`my-image@sha256:[new_digest]`). + +Alternatively, if you're willing to wait for longer start times from Coder, you +can set the `imagePullPolicy` to `Always` in your Terraform template; when set, +Coder will check `image:tag` on every build and update if necessary: ```tf resource "kubernetes_pod" "podName" {