diff --git a/minio-simple.nomad b/minio-simple.nomad new file mode 100644 index 0000000..677b887 --- /dev/null +++ b/minio-simple.nomad @@ -0,0 +1,129 @@ +variable "minio_storage_size"{ + description = "Size of the minio storage" + type = number + // default = 10737418204 + default = "10" +} + +job "minio" { + vault { + policies = ["read-only"] + } + meta { + auto-backup = true + backup-schedule = "@daily" + backup-target-db = "postgres" + } + datacenters = ["dc1"] + type = "service" + + constraint { + distinct_hosts = true + } + + constraint { + attribute = "${attr.unique.hostname}" + value = "sense" + operator = "==" + } + + group "server-1" { + network { + port "api" {} + + port "console" {} + + port "broker" {} + } + + task "server" { + driver = "raw_exec" + artifact { + source = "https://dl.min.io/server/minio/release/linux-arm64/minio" + destination = "${NOMAD_ALLOC_DIR}/minio" + mode = "file" + options { + checksum = "sha256:8789568665b4deda376e52f19bc85ca847a8644564446780b948961a7d5655cf" + } + } + + config { + command = "${NOMAD_ALLOC_DIR}/minio" + args = [ + "server", + "--address=${NOMAD_ADDR_api}", + "${MINIO_VOLUMES}", + "--console-address=${NOMAD_ADDR_console}" + ] + } + + template { + data = <