job "vault-single-nomad" { datacenters = ["dc1"] type = "service" group "vault-warden" { count = 1 volume "vault-storage" { type = "host" read_only = false source = "vault-storage" } constraint { attribute = "${node.unique.name}" operator = "=" value = "warden" } network { port "http" { static = 8200 to = 8200 } } task "vault" { driver = "exec" volume_mount { volume = "vault-storage" destination = "/opt/nomad/data/vault-storage" read_only = false } resources { cpu = 500 memory = 1024 } service { name = "vault" port = "http" tags = ["vault-server"] check { type = "http" path = "/v1/sys/health" interval = "30s" timeout = "5s" } } # Vault配置 - 使用Consul存储 template { data = <