diff --git a/ix-dev/enterprise/minio/app.yaml b/ix-dev/enterprise/minio/app.yaml index f8512ede55..aaaa1f8000 100644 --- a/ix-dev/enterprise/minio/app.yaml +++ b/ix-dev/enterprise/minio/app.yaml @@ -1,3 +1,5 @@ +annotations: + min_scale_version: '25.04' app_version: RELEASE.2025-01-20T14-49-07Z capabilities: [] categories: @@ -31,4 +33,4 @@ sources: - https://github.com/minio/minio title: MinIO train: enterprise -version: 1.2.10 +version: 1.3.0 diff --git a/ix-dev/enterprise/minio/migrations.yaml b/ix-dev/enterprise/minio/migrations.yaml new file mode 100644 index 0000000000..9ea7d33101 --- /dev/null +++ b/ix-dev/enterprise/minio/migrations.yaml @@ -0,0 +1,6 @@ +migrations: + - file: ip_port_migration + # from: + # max_version: "FIXME:" + target: + min_version: 1.3.0 diff --git a/ix-dev/enterprise/minio/migrations/ip_port_migration b/ix-dev/enterprise/minio/migrations/ip_port_migration new file mode 100755 index 0000000000..5ea82630c3 --- /dev/null +++ b/ix-dev/enterprise/minio/migrations/ip_port_migration @@ -0,0 +1,28 @@ +#!/usr/bin/python3 + +import os +import sys +import yaml + + +def migrate(values): + values["network"]["api_port"] = { + "port_number": values["network"]["api_port"], + "bind_mode": "published", + "host_ips": [], + } + values["network"]["console_port"] = { + "port_number": values["network"]["console_port"], + "bind_mode": "published", + "host_ips": [], + } + return values + + +if __name__ == "__main__": + if len(sys.argv) != 2: + exit(1) + + if os.path.exists(sys.argv[1]): + with open(sys.argv[1], "r") as f: + print(yaml.dump(migrate(yaml.safe_load(f.read())))) diff --git a/ix-dev/enterprise/minio/questions.yaml b/ix-dev/enterprise/minio/questions.yaml index 607d5bf6cb..96035fd218 100644 --- a/ix-dev/enterprise/minio/questions.yaml +++ b/ix-dev/enterprise/minio/questions.yaml @@ -150,20 +150,100 @@ questions: label: API Port description: The port for the MinIO API. schema: - type: int - default: 30000 - required: true - $ref: - - "definitions/port" + type: dict + attrs: + - variable: bind_mode + label: Port Bind Mode + description: | + The port bind mode.
+ - Publish: The port will be published on the host for external access.
+ - Expose: The port will be exposed for inter-container communication.
+ - None: The port will not be exposed or published.
+ Note: If the Dockerfile defines an EXPOSE directive, + the port will still be exposed for inter-container communication regardless of this setting. + schema: + type: string + default: "published" + enum: + - value: "published" + description: Publish port on the host for external access + - value: "exposed" + description: Expose port for inter-container communication + - value: "" + description: None + - variable: port_number + label: Port Number + schema: + type: int + show_if: [["bind_mode", "!=", ""]] + default: 30000 + required: true + $ref: + - definitions/port + - variable: host_ips + label: Host IPs + description: IPs on the host to bind this port + schema: + type: list + default: [] + items: + - variable: host_ip + label: Host IP + schema: + type: string + required: true + $ref: + - definitions/node_bind_ip + - variable: console_port label: Console Port (Web UI) description: The port for the MinIO Web UI. schema: - type: int - default: 30001 - required: true - $ref: - - "definitions/port" + type: dict + attrs: + - variable: bind_mode + label: Port Bind Mode + description: | + The port bind mode.
+ - Publish: The port will be published on the host for external access.
+ - Expose: The port will be exposed for inter-container communication.
+ - None: The port will not be exposed or published.
+ Note: If the Dockerfile defines an EXPOSE directive, + the port will still be exposed for inter-container communication regardless of this setting. + schema: + type: string + default: "published" + enum: + - value: "published" + description: Publish port on the host for external access + - value: "exposed" + description: Expose port for inter-container communication + - value: "" + description: None + - variable: port_number + label: Port Number + schema: + type: int + show_if: [["bind_mode", "!=", ""]] + default: 30001 + required: true + $ref: + - definitions/port + - variable: host_ips + label: Host IPs + description: IPs on the host to bind this port + schema: + type: list + default: [] + items: + - variable: host_ip + label: Host IP + schema: + type: string + required: true + $ref: + - definitions/node_bind_ip + - variable: server_url label: Server URL description: | diff --git a/ix-dev/enterprise/minio/templates/docker-compose.yaml b/ix-dev/enterprise/minio/templates/docker-compose.yaml index 27f4b264fc..3066b806da 100644 --- a/ix-dev/enterprise/minio/templates/docker-compose.yaml +++ b/ix-dev/enterprise/minio/templates/docker-compose.yaml @@ -45,8 +45,8 @@ {% set cmd = namespace(x=[ "server", - "--address", ":%d"|format(values.network.api_port), - "--console-address", ":%d"|format(values.network.console_port), + "--address", ":%d"|format(values.network.api_port.port_number), + "--console-address", ":%d"|format(values.network.console_port.port_number), ]) %} {% if values.network.certificate_id %} @@ -78,7 +78,7 @@ {% endfor %} {% do c1.environment.add_user_envs(values.minio.additional_envs) %} -{% do c1.environment.add_env("MC_HOST_health", "%s://localhost:%d" | format(proto, values.network.api_port)) %} +{% do c1.environment.add_env("MC_HOST_health", "%s://localhost:%d" | format(proto, values.network.api_port.port_number)) %} {% do c1.environment.add_env("MINIO_ROOT_USER", values.minio.credentials.access_key) %} {% do c1.environment.add_env("MINIO_ROOT_PASSWORD", values.minio.credentials.secret_key) %} @@ -96,14 +96,14 @@ {% do c1.environment.add_env("MINIO_VOLUMES", minio_config_items.x|join(" ")) %} {% endif %} -{% do c1.ports.add_port(values.network.console_port, values.network.console_port) %} -{% do c1.ports.add_port(values.network.api_port, values.network.api_port) %} +{% do c1.add_port(values.network.console_port) %} +{% do c1.add_port(values.network.api_port) %} {% if perm_container.has_actions() %} {% do perm_container.activate() %} {% do c1.depends.add_dependency(values.consts.perms_container_name, "service_completed_successfully") %} {% endif %} -{% do tpl.portals.add_portal({"port": values.network.console_port, "scheme": proto}) %} +{% do tpl.portals.add_portal({"port": values.network.console_port.port_number, "scheme": proto}) %} {{ tpl.render() | tojson }} diff --git a/ix-dev/enterprise/minio/templates/test_values/basic-multi-mode-values.yaml b/ix-dev/enterprise/minio/templates/test_values/basic-multi-mode-values.yaml index 626cfbf6d5..536d84903f 100644 --- a/ix-dev/enterprise/minio/templates/test_values/basic-multi-mode-values.yaml +++ b/ix-dev/enterprise/minio/templates/test_values/basic-multi-mode-values.yaml @@ -16,8 +16,12 @@ minio: anonymous: false network: - api_port: 9000 - console_port: 9001 + api_port: + bind_mode: published + port_number: 9000 + console_port: + bind_mode: published + port_number: 9001 certificate_id: null host_network: false console_url: http://localhost:9001 diff --git a/ix-dev/enterprise/minio/templates/test_values/basic-values.yaml b/ix-dev/enterprise/minio/templates/test_values/basic-values.yaml index c99de01d83..3ebedcfe9b 100644 --- a/ix-dev/enterprise/minio/templates/test_values/basic-values.yaml +++ b/ix-dev/enterprise/minio/templates/test_values/basic-values.yaml @@ -14,8 +14,12 @@ minio: anonymous: false network: - api_port: 9000 - console_port: 9001 + api_port: + bind_mode: published + port_number: 9000 + console_port: + bind_mode: published + port_number: 9001 certificate_id: null host_network: false console_url: http://localhost:9001 diff --git a/ix-dev/enterprise/minio/templates/test_values/https-values.yaml b/ix-dev/enterprise/minio/templates/test_values/https-values.yaml index 2fa606d274..8e5a5f4cf5 100644 --- a/ix-dev/enterprise/minio/templates/test_values/https-values.yaml +++ b/ix-dev/enterprise/minio/templates/test_values/https-values.yaml @@ -14,8 +14,12 @@ minio: anonymous: false network: - api_port: 9000 - console_port: 9001 + api_port: + bind_mode: published + port_number: 9000 + console_port: + bind_mode: published + port_number: 9001 certificate_id: "1" host_network: false console_url: http://localhost:9001