diff --git a/simplyblock_core/env_var b/simplyblock_core/env_var index 5abdecd44..10fa1a739 100644 --- a/simplyblock_core/env_var +++ b/simplyblock_core/env_var @@ -3,3 +3,19 @@ SIMPLY_BLOCK_VERSION=19.2.34 SIMPLY_BLOCK_DOCKER_IMAGE=public.ecr.aws/simply-block/simplyblock:main SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=public.ecr.aws/simply-block/ultra:main-latest + +# external images +FDB_IMAGE=foundationdb/foundationdb:7.3.63 +HAPROXY_IMAGE=haproxytech/haproxy-debian:latest +MONGODB_IMAGE=mongo:5.0 +OPENSEARCH_IMAGE=opensearchproject/opensearch:2.4.0 +GRAYLOG_IMAGE=graylog/graylog:5.0 +PROMETHEUS_IMAGE=prom/prometheus:v2.44.0 +THANOS_IMAGE=thanosio/thanos:v0.31.0 +NODE_EXPORTER_IMAGE=prom/node-exporter:v1.7.0 +GRAFANA_IMAGE=grafana/grafana:10.0.12 +FLUENTD_IMAGE=public.ecr.aws/simply-block/fluentd-kubernetes-daemonset:v1.17.1-debian-graylog-1.2 +KUBECTL_IMAGE=alpine/kubectl:1.34.1 +UBUNTU_IMAGE=ubuntu:22.04 +ALPINE_IMAGE=alpine:3.20 +ALPINE_TOOLS_IMAGE=simplyblock/alpine-tools:3.21.3 \ No newline at end of file diff --git a/simplyblock_core/env_var.org b/simplyblock_core/env_var.org new file mode 100644 index 000000000..574f7d075 --- /dev/null +++ b/simplyblock_core/env_var.org @@ -0,0 +1,21 @@ +SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev +SIMPLY_BLOCK_VERSION=19.2.34 + +SIMPLY_BLOCK_DOCKER_IMAGE=public.ecr.aws/simply-block/simplyblock:main-images-to-env-var +SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=public.ecr.aws/simply-block/ultra:main-latest + +# external images +FDB_IMAGE=foundationdb/foundationdb:7.3.63 +HAPROXY_IMAGE=haproxytech/haproxy-debian:latest +MONGODB_IMAGE=mongo:5.0 +OPENSEARCH_IMAGE=opensearchproject/opensearch:2.4.0 +GRAYLOG_IMAGE=graylog/graylog:5.0 +PROMETHEUS_IMAGE=prom/prometheus:v2.44.0 +THANOS_IMAGE=thanosio/thanos:v0.31.0 +NODE_EXPORTER_IMAGE=prom/node-exporter:v1.7.0 +GRAFANA_IMAGE=grafana/grafana:10.0.12 +FLUENTD_IMAGE=public.ecr.aws/simply-block/fluentd-kubernetes-daemonset:v1.17.1-debian-graylog-1.2 +KUBECTL_IMAGE=alpine/kubectl:1.34.1 +UBUNTU_IMAGE=ubuntu:22.04 +ALPINE_IMAGE=alpine:3.20 +ALPINE_TOOLS_IMAGE=simplyblock/alpine-tools:3.21.3 diff --git a/simplyblock_core/env_var.quay.io b/simplyblock_core/env_var.quay.io new file mode 100644 index 000000000..86d4e1a5e --- /dev/null +++ b/simplyblock_core/env_var.quay.io @@ -0,0 +1,21 @@ +SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev +SIMPLY_BLOCK_VERSION=19.2.34 + +SIMPLY_BLOCK_DOCKER_IMAGE=quay.io/simplyblock-io/simplyblock:main-images-to-env-var +SIMPLY_BLOCK_SPDK_ULTRA_IMAGE=quay.io/simplyblock-io/ultra:main-latest + +# external images +FDB_IMAGE=quay.io/simplyblock-io/foundationdb:7.3.63 +HAPROXY_IMAGE=quay.io/simplyblock-io/haproxy-debian:latest +MONGODB_IMAGE=quay.io/simplyblock-io/mongo:5.0 +OPENSEARCH_IMAGE=quay.io/simplyblock-io/opensearch:2.4.0 +GRAYLOG_IMAGE="quay.io/simplyblock-io/graylog:5.0" +PROMETHEUS_IMAGE=quay.io/simplyblock-io/prometheus:v2.44.0 +THANOS_IMAGE=quay.io/simplyblock-io/thanos:v0.31.0 +NODE_EXPORTER_IMAGE=quay.io/simplyblock-io/node-exporter:v1.7.0 +GRAFANA_IMAGE=quay.io/simplyblock-io/grafana:10.0.12 +FLUENTD_IMAGE=quay.io/simplyblock-io/fluentd-kubernetes-daemonset:v1.17.1-debian-graylog-1.2 +KUBECTL_IMAGE=quay.io/simplyblock-io/kubectl:1.34.1 +UBUNTU_IMAGE=quay.io/simplyblock-io/ubuntu:22.04 +ALPINE_IMAGE=quay.io/simplyblock-io/alpine:3.20 +ALPINE_TOOLS_IMAGE=quay.io/simplyblock-io/alpine-tools:3.21.3 diff --git a/simplyblock_core/scripts/deploy_stack.sh b/simplyblock_core/scripts/deploy_stack.sh index d8a29a1ae..ea8d7b8b6 100644 --- a/simplyblock_core/scripts/deploy_stack.sh +++ b/simplyblock_core/scripts/deploy_stack.sh @@ -16,6 +16,9 @@ export GRAFANA_ENDPOINT=${10} export DISABLE_MONITORING=${11} export DIR="$(dirname "$(realpath "$0")")" +set -a +source "$DIR"/../env_var + if [ -s "/etc/foundationdb/fdb.cluster" ] then FDB_CLUSTER_FILE_CONTENTS=$(tail /etc/foundationdb/fdb.cluster -n 1) diff --git a/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml b/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml index b672f6511..21b131acf 100644 --- a/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +++ b/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml @@ -3,7 +3,7 @@ version: '3.8' services: ### monitoring ### mongodb: - image: "mongo:5.0" + image: $MONGODB_IMAGE volumes: - "mongodb_data:/data/db" deploy: @@ -15,7 +15,7 @@ services: - monitoring-net opensearch: - image: "opensearchproject/opensearch:2.4.0" + image: $OPENSEARCH_IMAGE environment: - "OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g" - "bootstrap.memory_lock=true" @@ -35,7 +35,7 @@ services: graylog: hostname: "server" - image: "graylog/graylog:5.0" + image: $GRAYLOG_IMAGE entrypoint: "/usr/bin/tini -- wait-for-it opensearch:9200 -- /docker-entrypoint.sh" environment: GRAYLOG_NODE_ID_FILE: "/usr/share/graylog/data/config/node-id" @@ -75,7 +75,7 @@ services: - monitoring-net prometheus: - image: prom/prometheus:v2.44.0 + image: $PROMETHEUS_IMAGE user: root volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml @@ -96,7 +96,7 @@ services: - monitoring-net thanos-sidecar: - image: thanosio/thanos:v0.31.0 + image: $THANOS_IMAGE user: root command: - sidecar @@ -114,7 +114,7 @@ services: - monitoring-net thanos-store: - image: thanosio/thanos:v0.31.0 + image: $THANOS_IMAGE command: - store - --objstore.config-file=/etc/thanos/objstore.yml @@ -130,7 +130,7 @@ services: - monitoring-net thanos-query: - image: thanosio/thanos:v0.31.0 + image: $THANOS_IMAGE command: - query - --http-address=0.0.0.0:9091 @@ -144,7 +144,7 @@ services: - monitoring-net thanos-compactor: - image: thanosio/thanos:v0.31.0 + image: $THANOS_IMAGE command: - compact - --data-dir=/data @@ -165,7 +165,7 @@ services: - monitoring-net node-exporter: - image: prom/node-exporter:v1.7.0 + image: $NODE_EXPORTER_IMAGE user: root volumes: - /proc:/host/proc:ro @@ -185,7 +185,7 @@ services: - monitoring-net grafana: - image: grafana/grafana:10.0.12 + image: $GRAFANA_IMAGE environment: GF_SECURITY_ADMIN_USER: "admin" GF_SECURITY_ADMIN_PASSWORD: "${CLUSTER_SECRET}" diff --git a/simplyblock_core/scripts/docker-compose-swarm.yml b/simplyblock_core/scripts/docker-compose-swarm.yml index 453279ae5..fbea7cf88 100644 --- a/simplyblock_core/scripts/docker-compose-swarm.yml +++ b/simplyblock_core/scripts/docker-compose-swarm.yml @@ -11,7 +11,7 @@ services: fdb-server: <<: *service-base - image: foundationdb/foundationdb:7.3.63 + image: $FDB_IMAGE networks: - hostnet environment: @@ -34,7 +34,7 @@ services: fdb-backup-agent: <<: *service-base - image: foundationdb/foundationdb:7.3.63 + image: $FDB_IMAGE entrypoint: "/usr/bin/backup_agent -C /etc/foundationdb/fdb.cluster" networks: - hostnet @@ -121,7 +121,7 @@ services: SIMPLYBLOCK_LOG_LEVEL: "$LOG_LEVEL" HAProxy: - image: haproxytech/haproxy-debian:latest + image: $HAPROXY_IMAGE deploy: mode: global placement: diff --git a/simplyblock_web/api/internal/storage_node/kubernetes.py b/simplyblock_web/api/internal/storage_node/kubernetes.py index a3003141f..cdeb0faee 100644 --- a/simplyblock_web/api/internal/storage_node/kubernetes.py +++ b/simplyblock_web/api/internal/storage_node/kubernetes.py @@ -343,6 +343,12 @@ def spdk_process_start(body: SPDKParams): node_prepration_core_name += node_name logger.debug(f"deploying k8s job to prepare worker: {node_name}") + fluentd_image = constants.get_config_var("FLUENTD_IMAGE", "public.ecr.aws/simply-block/fluentd-kubernetes-daemonset:v1.17.1-debian-graylog-1.2") + ubuntu_image = constants.get_config_var("UBUNTU_IMAGE", "ubuntu:22.04") + alpine_tools_image = constants.get_config_var("ALPINE_TOOLS_IMAGE", "quay.io/simplyblock-io/alpine-tools:3.21.3") + alpine_image = constants.get_config_var("ALPINE_IMAGE", "quay.io/simplyblock-io/alpine:3.20") + kubectl_image = constants.get_config_var("KUBECTL_IMAGE", "quay.io/simplyblock-io/kubectl:1.34.1") + try: env = Environment(loader=PackageLoader('simplyblock_web', 'templates'), trim_blocks=True, lstrip_blocks=True) values = { @@ -374,6 +380,11 @@ def spdk_process_start(body: SPDKParams): 'CPU_TOPOLOGY_ENABLED': cpu_topology_enabled, 'RESERVED_SYSTEM_CPUS': reserved_system_cpus, 'TLS_ENABLED': Settings().tls_enabled, + 'FLUENTD_IMAGE': fluentd_image, + 'UBUNTU_IMAGE': ubuntu_image, + 'ALPINE_TOOLS_IMAGE': alpine_tools_image, + 'ALPINE_IMAGE': alpine_image, + 'KUBECTL_IMAGE': kubectl_image, } if ubuntu_host: diff --git a/simplyblock_web/templates/Untitled-1.j2 b/simplyblock_web/templates/Untitled-1.j2 deleted file mode 100644 index e69de29bb..000000000 diff --git a/simplyblock_web/templates/oc_storage_core_isolation.yaml.j2 b/simplyblock_web/templates/oc_storage_core_isolation.yaml.j2 index 9b7aa7706..967a7d2f7 100644 --- a/simplyblock_web/templates/oc_storage_core_isolation.yaml.j2 +++ b/simplyblock_web/templates/oc_storage_core_isolation.yaml.j2 @@ -23,7 +23,7 @@ spec: path: /var/simplyblock containers: - name: init-setup - image: alpine/kubectl:1.34.1 + image: ${{ KUBECTL_IMAGE }} securityContext: privileged: true volumeMounts: diff --git a/simplyblock_web/templates/oc_storage_cpu_topology.yaml.j2 b/simplyblock_web/templates/oc_storage_cpu_topology.yaml.j2 index 4191cfa40..7eb2bb9cf 100755 --- a/simplyblock_web/templates/oc_storage_cpu_topology.yaml.j2 +++ b/simplyblock_web/templates/oc_storage_cpu_topology.yaml.j2 @@ -23,7 +23,7 @@ spec: path: /var/simplyblock containers: - name: init-setup - image: alpine/kubectl:1.34.1 + image: ${{ KUBECTL_IMAGE }} securityContext: privileged: true volumeMounts: diff --git a/simplyblock_web/templates/storage_core_isolation.yaml.j2 b/simplyblock_web/templates/storage_core_isolation.yaml.j2 index 1999eda76..44af37b73 100644 --- a/simplyblock_web/templates/storage_core_isolation.yaml.j2 +++ b/simplyblock_web/templates/storage_core_isolation.yaml.j2 @@ -62,7 +62,7 @@ spec: path: /var/simplyblock containers: - name: init-setup - image: ubuntu:22.04 + image: ${{ UBUNTU_IMAGE }} securityContext: privileged: true volumeMounts: diff --git a/simplyblock_web/templates/storage_cpu_topology.yaml.j2 b/simplyblock_web/templates/storage_cpu_topology.yaml.j2 index 667d6468d..bbc99781f 100644 --- a/simplyblock_web/templates/storage_cpu_topology.yaml.j2 +++ b/simplyblock_web/templates/storage_cpu_topology.yaml.j2 @@ -30,7 +30,7 @@ spec: containers: - name: kubelet-cpu-topology - image: alpine:3.20 + image: ${{ ALPINE_IMAGE }} securityContext: privileged: true volumeMounts: diff --git a/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 b/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 index 6f6e58979..056527d44 100644 --- a/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 +++ b/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 @@ -192,7 +192,7 @@ spec: path: /var/log/pods containers: - name: fluentd - image: public.ecr.aws/simply-block/fluentd-kubernetes-daemonset:v1.17.1-debian-graylog-1.2 + image: {{ FLUENTD_IMAGE }} imagePullPolicy: "Always" env: - name: K8S_NODE_NAME diff --git a/simplyblock_web/templates/storage_init_job.yaml.j2 b/simplyblock_web/templates/storage_init_job.yaml.j2 index d66f24f71..3d5a1042a 100644 --- a/simplyblock_web/templates/storage_init_job.yaml.j2 +++ b/simplyblock_web/templates/storage_init_job.yaml.j2 @@ -23,7 +23,7 @@ spec: path: /proc containers: - name: init-setup - image: simplyblock/alpine-tools:3.21.3 + image: ${{ ALPINE_TOOLS_IMAGE }} securityContext: privileged: true volumeMounts: diff --git a/simplyblock_web/templates/ubuntu_kernel_extra.yaml.j2 b/simplyblock_web/templates/ubuntu_kernel_extra.yaml.j2 index 98f950a1b..3db6289e9 100644 --- a/simplyblock_web/templates/ubuntu_kernel_extra.yaml.j2 +++ b/simplyblock_web/templates/ubuntu_kernel_extra.yaml.j2 @@ -23,7 +23,7 @@ spec: path: / containers: - name: init-setup - image: ubuntu:22.04 + image: ${{ UBUNTU_IMAGE }} securityContext: privileged: true volumeMounts: