job "postgres" { datacenters = ["nummer5"] type = "service" #node_pool = "sys" group "service" { count = 1 volume "postgres-data" { type = "csi" read_only = false source = "postgresql" access_mode = "single-node-writer" attachment_mode = "file-system" } network { mode = "host" port "postgres"{ static = 5432 } } service { name = "postgres" port = "postgres" #tags = [ # "traefik.enable=true", # "traefik.tcp.routers.postgres.rule=Host(`postgres.service.nr5`)", #] } task "postgres" { driver = "podman" config { image = "docker.io/postgres:13" ports = ["postgres"] } volume_mount { volume = "postgres-data" destination = "/var/lib/postgresql/data" } env { POSTGRES_USER="root" POSTGRES_PASSWORD="pg2020" } logs { max_files = 5 max_file_size = 15 } resources { cpu = 1000 memory = 512 } } restart { attempts = 10 interval = "5m" delay = "25s" mode = "delay" } } update { max_parallel = 1 min_healthy_time = "5s" healthy_deadline = "9m" auto_revert = false canary = 0 } }