Expose ports 9000 and 9001 for minio
This commit is contained in:
parent
f23b6fbb2f
commit
7161564458
3 changed files with 21 additions and 0 deletions
1
minio.tf
1
minio.tf
|
@ -4,4 +4,5 @@ module "minio" {
|
||||||
network = docker_network.loadbalancer
|
network = docker_network.loadbalancer
|
||||||
storage_path = "/media/storage/minio"
|
storage_path = "/media/storage/minio"
|
||||||
admin_username = "techinc"
|
admin_username = "techinc"
|
||||||
|
expose_ports = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,3 +18,8 @@ variable "storage_path" {
|
||||||
type = string
|
type = string
|
||||||
description = "The path to the storage directory to use"
|
description = "The path to the storage directory to use"
|
||||||
}
|
}
|
||||||
|
variable "expose_ports" {
|
||||||
|
type = bool
|
||||||
|
description = "Expose the minio ports to the outside world"
|
||||||
|
default = false
|
||||||
|
}
|
|
@ -49,6 +49,21 @@ resource "docker_service" "minio" {
|
||||||
parallelism = 1
|
parallelism = 1
|
||||||
order = "stop-first"
|
order = "stop-first"
|
||||||
}
|
}
|
||||||
|
dynamic "endpoint_spec" {
|
||||||
|
for_each = var.expose_ports ? toset(["aw yis"]) : toset([])
|
||||||
|
content {
|
||||||
|
ports {
|
||||||
|
target_port = 9000
|
||||||
|
published_port = 9000
|
||||||
|
publish_mode = "ingress"
|
||||||
|
}
|
||||||
|
ports {
|
||||||
|
target_port = 9001
|
||||||
|
published_port = 9001
|
||||||
|
publish_mode = "ingress"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module "minio_nginx_config" {
|
module "minio_nginx_config" {
|
||||||
|
|
Reference in a new issue