Skip to content

Commit f9af93c

Browse files
committed
Switch Zenko consumers to vendored GHCR mongodb images
Cut over Zenko consumers from the Bitnami-hosted mongodb images to the vendored ones built in CI: - `solution-base/deps.yaml` now points the mongodb-sharded, mongodb-exporter and os-shell entries to `ghcr.io/scality/zenko/`, replacing the previous bitnamilegacy references that required a paid subscription secret to pull. - `solution-base/build.sh` consumes the same images for the ISO using the immutable tree-hash tag computed by `mongodb_build_vars.sh`, so the ISO is built against the exact image content that was tested in CI. - `.github/scripts/end2end/install-kind-dependencies.sh` resolves the mongodb image references via `mongodb_build_vars.sh` and appends the tree-hash suffix to the GHCR image tags, so the kind cluster used by end2end tests pulls the exact freshly built images. Issue: ZENKO-5110
1 parent da2970f commit f9af93c

3 files changed

Lines changed: 26 additions & 16 deletions

File tree

.github/scripts/end2end/install-kind-dependencies.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ kubectl wait --for=condition=Ready --timeout=240s clusterissuer/artesca-root-ca-
113113

114114
# Copy root CA secret to default namespace for applications to use
115115
echo "Copying root CA certificate to default namespace..."
116-
kubectl get secret root-ca -n cert-manager -o json |
117-
jq '.metadata.namespace="default" | .metadata.name="zenko-root-ca"' |
116+
kubectl get secret root-ca -n cert-manager -o json |
117+
jq '.metadata.namespace="default" | .metadata.name="zenko-root-ca"' |
118118
kubectl apply -f -
119119

120120
# prometheus
@@ -152,9 +152,9 @@ metadata:
152152
name: mongodb-db-creds
153153
stringData:
154154
mongodb-root-username: $MONGODB_ROOT_USERNAME
155-
mongodb-root-password: $MONGODB_ROOT_PASSWORD
155+
mongodb-root-password: $MONGODB_ROOT_PASSWORD
156156
mongodb-username: $MONGODB_APP_USERNAME
157-
mongodb-password: $MONGODB_APP_PASSWORD
157+
mongodb-password: $MONGODB_APP_PASSWORD
158158
mongodb-database: $MONGODB_APP_DATABASE
159159
mongodb-replica-set-key: $MONGODB_RS_KEY
160160
EOF
@@ -196,10 +196,10 @@ patch_mongodb_selector() {
196196

197197
# Remove volume selectors from mongos StatefulSet
198198
yq eval 'select(.kind == "StatefulSet" and .metadata.name == "data-db-mongodb-sharded-mongos") |= del(.spec.volumeClaimTemplates[].spec.selector)' -i "$base_yaml_path"
199-
200-
# Remove volume selectors from configsvr StatefulSet
199+
200+
# Remove volume selectors from configsvr StatefulSet
201201
yq eval 'select(.kind == "StatefulSet" and .metadata.name == "data-db-mongodb-sharded-configsvr") |= del(.spec.volumeClaimTemplates[].spec.selector)' -i "$base_yaml_path"
202-
202+
203203
# Remove volume selectors from shard StatefulSets
204204
for ((i=0; i<shard_count; i++)); do
205205
yq eval "select(.kind == \"StatefulSet\" and .metadata.name == \"data-db-mongodb-sharded-shard${i}-data\") |= del(.spec.volumeClaimTemplates[].spec.selector)" -i "$base_yaml_path"
@@ -215,7 +215,7 @@ build_solution_base_manifests() {
215215
# Limits and requests for MongoDB are computed based on the current system
216216
# Detect total system RAM in GiB
217217
TOTAL_RAM_GB=$(awk '/MemTotal/ {printf "%.0f", $2/1024/1024}' /proc/meminfo)
218-
218+
219219
# Compute MongoDB settings based on the total RAM
220220
MONGODB_WIRETIGER_CACHE_SIZE_GB=$((TOTAL_RAM_GB * 335 / 1000))
221221
MONGODB_MONGOS_RAM_LIMIT=$((TOTAL_RAM_GB * 165 / 1000))Gi
@@ -233,7 +233,11 @@ build_solution_base_manifests() {
233233

234234
get_image_from_deps() {
235235
local dep_name=$1
236-
yq eval ".$dep_name | (.sourceRegistry // \"docker.io\") + \"/\" + .image + \":\" + .tag" $SOLUTION_BASE_DIR/deps.yaml
236+
237+
source <( "$SOLUTION_BASE_DIR/mongodb_build_vars.sh" )
238+
239+
yq eval ".$dep_name | (.sourceRegistry // \"docker.io\") + \"/\" + .image + \":\" + .tag" $SOLUTION_BASE_DIR/deps.yaml |
240+
sed '/ghcr.io\/scality\/zenko\/mongo/ s/$/-'"${MONGODB_BUILD_TREE_HASH}"'/'
237241
}
238242

239243
retry() {

solution-base/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ MONGODB_MONGOS_RAM_REQUEST="MONGODB_MONGOS_RAM_REQUEST"
6464

6565
function flatten_source_images()
6666
{
67-
yq eval '.* | (.sourceRegistry // "docker.io") + "/" + .image + ":" + .tag' ${SOLUTION_BASE_DIR}/deps.yaml
67+
source <( ${SOLUTION_BASE_DIR}/mongodb_build_vars.sh )
68+
69+
yq eval '.* | (.sourceRegistry // "docker.io") + "/" + .image + ":" + .tag' ${SOLUTION_BASE_DIR}/deps.yaml |
70+
sed '/ghcr.io\/scality\/zenko\// s/$/-'"${MONGODB_BUILD_TREE_HASH}"'/'
6871
}
6972

7073
function clean()

solution-base/deps.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
# to sort keys, use the following command
33
# yq eval 'sortKeys(.)' -i deps.yaml
44
mongodb-sharded:
5-
image: bitnamilegacy/mongodb-sharded
6-
tag: 8.0.13-debian-12-r0
5+
sourceRegistry: ghcr.io
6+
image: scality/zenko/mongodb-sharded
7+
tag: "8.0.13"
78
mongodb-sharded-exporter:
8-
image: bitnamilegacy/mongodb-exporter
9-
tag: 0.47.0-debian-12-r1
9+
sourceRegistry: ghcr.io
10+
image: scality/zenko/mongodb-exporter
11+
tag: "0.49.0"
1012
mongodb-shell:
11-
image: bitnamilegacy/os-shell
12-
tag: 12-debian-12-r51
13+
sourceRegistry: ghcr.io
14+
image: scality/zenko/os-shell
15+
tag: "12"

0 commit comments

Comments
 (0)