From 9972c3d1f86428eb87ef150748305362086b59d2 Mon Sep 17 00:00:00 2001 From: Bruce Becker Date: Sat, 22 Apr 2023 15:30:00 +0200 Subject: [PATCH] feat(podman): initial commit of job with podman driver (#24) feat(podman): initial commit of job with podman driver Signed-off-by: Bruce Becker feat(redis): add migration and update stanzas Signed-off-by: Bruce Becker --------- Signed-off-by: Bruce Becker --- .pre-commit-config.yaml | 9 -------- redis-podman.hcl | 49 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 redis-podman.hcl diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bea8e75..02deeba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,14 +26,5 @@ repos: rev: v1.26.3 hooks: - id: tfsec-system - - - repo: local - hooks: - - id: packer-fmt - name: Packer Format - language: system - types: - - hcl - entry: packer fmt ci: autoupdate_branch: main diff --git a/redis-podman.hcl b/redis-podman.hcl new file mode 100644 index 0000000..106d1c3 --- /dev/null +++ b/redis-podman.hcl @@ -0,0 +1,49 @@ +variable "redis_version" { + type = string + default = "6.0" + description = "version of redis to run" +} +job "redis" { + datacenters = ["dc1"] + type = "service" + migrate { + max_parallel = 1 + health_check = "checks" + min_healthy_time = "10s" + healthy_deadline = "5m" + } + update { + max_parallel = 2 + health_check = "checks" + min_healthy_time = "10s" + healthy_deadline = "5m" + progress_deadline = "10m" + auto_revert = true + auto_promote = true + canary = 1 + stagger = "30s" + } + group "cache" { + network { + port "redis" { to = 6379 } + } + service { + tags = ["cache","redis","urlprefix-/redis"] + port = "redis" + check { + name = "redis_probe" + type = "tcp" + interval = "10s" + timeout = "1s" + } + + } + task "redis" { + driver = "podman" + config { + image = "docker://redis:${var.redis_version}" + ports = ["redis"] + } + } + } +}