chore: Update templates from Always to IfNotPresent for image_pull_policy (#501)

## Description

Change `image_pull_policy` from `Always` to `IfNotPresent` on Coder
owned templates. Given these are a reference point for users and
customers and they copy them into their own templates I think it makes
sense to encourage the use of caching of images.

## Type of Change

- [ ] New module
- [ ] New template
- [ ] Bug fix
- [x] Feature/enhancement
- [ ] Documentation
- [ ] Other

## Template Information

**Path:** 


https://github.com/coder/registry/tree/main/registry/coder/templates/kubernetes-devcontainer

https://github.com/coder/registry/tree/main/registry/coder/templates/kubernetes-envbox

https://github.com/coder/registry/tree/main/registry/coder/templates/kubernetes

## Testing & Validation

- [ ] Tests pass (`bun test`)
- [ ] Code formatted (`bun fmt`)
- [x] Changes tested locally

## Related Issues

None
This commit is contained in:
Rowan Smith 2025-10-23 15:28:58 +11:00 committed by GitHub
parent 0c5a8a2354
commit 63e42283ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -264,7 +264,7 @@ resource "kubernetes_deployment" "main" {
container { container {
name = "dev" name = "dev"
image = var.cache_repo == "" ? local.devcontainer_builder_image : envbuilder_cached_image.cached.0.image image = var.cache_repo == "" ? local.devcontainer_builder_image : envbuilder_cached_image.cached.0.image
image_pull_policy = "Always" image_pull_policy = "IfNotPresent"
security_context { security_context {
privileged = true privileged = true
} }

View File

@ -152,7 +152,7 @@ resource "kubernetes_pod" "main" {
name = "dev" name = "dev"
# We highly recommend pinning this to a specific release of envbox, as the latest tag may change. # We highly recommend pinning this to a specific release of envbox, as the latest tag may change.
image = "ghcr.io/coder/envbox:latest" image = "ghcr.io/coder/envbox:latest"
image_pull_policy = "Always" image_pull_policy = "IfNotPresent"
command = ["/envbox", "docker"] command = ["/envbox", "docker"]
security_context { security_context {

View File

@ -287,7 +287,7 @@ resource "kubernetes_deployment" "main" {
container { container {
name = "dev" name = "dev"
image = "codercom/enterprise-base:ubuntu" image = "codercom/enterprise-base:ubuntu"
image_pull_policy = "Always" image_pull_policy = "IfNotPresent"
command = ["sh", "-c", coder_agent.main.init_script] command = ["sh", "-c", coder_agent.main.init_script]
security_context { security_context {
run_as_user = "1000" run_as_user = "1000"