mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
62 lines
1.9 KiB
Bash
62 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
export KUBECONFIG=/Users/chrisfu/dev/knoe/knoe-k3s.kubeconfig
|
|
|
|
JEMALLOC_PATH="/opt/gitlab-jemalloc/libjemalloc.so.2"
|
|
JEMALLOC_MOUNT="/opt/gitlab-jemalloc"
|
|
|
|
echo "==> Patching GitLab CR with hostPath jemalloc-16k for all ARM64 components..."
|
|
|
|
# Build the extra volumes / mounts JSON (shared across components)
|
|
EXTRA_VOL='[{"name":"jemalloc-16k","hostPath":{"path":"/opt/gitlab-jemalloc","type":"Directory"}}]'
|
|
EXTRA_MOUNT='[{"name":"jemalloc-16k","mountPath":"/opt/gitlab-jemalloc","readOnly":true}]'
|
|
PRELOAD_ENV='{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"}'
|
|
|
|
kubectl -n gitlab patch gitlab gitlab --type=merge -p "{
|
|
\"spec\":{\"chart\":{\"values\":{
|
|
\"global\":{
|
|
\"extraEnv\": ${PRELOAD_ENV}
|
|
},
|
|
\"gitlab\":{
|
|
\"migrations\":{
|
|
\"extraEnv\": ${PRELOAD_ENV},
|
|
\"extraVolumes\": ${EXTRA_VOL},
|
|
\"extraVolumeMounts\": ${EXTRA_MOUNT}
|
|
},
|
|
\"sidekiq\":{
|
|
\"extraEnv\": ${PRELOAD_ENV},
|
|
\"extraVolumes\": ${EXTRA_VOL},
|
|
\"extraVolumeMounts\": ${EXTRA_MOUNT}
|
|
},
|
|
\"webservice\":{
|
|
\"extraEnv\": ${PRELOAD_ENV},
|
|
\"extraVolumes\": ${EXTRA_VOL},
|
|
\"extraVolumeMounts\": ${EXTRA_MOUNT}
|
|
},
|
|
\"gitaly\":{
|
|
\"extraEnv\": ${PRELOAD_ENV},
|
|
\"extraVolumes\": ${EXTRA_VOL},
|
|
\"extraVolumeMounts\": ${EXTRA_MOUNT}
|
|
},
|
|
\"toolbox\":{
|
|
\"extraEnv\": ${PRELOAD_ENV},
|
|
\"extraVolumes\": ${EXTRA_VOL},
|
|
\"extraVolumeMounts\": ${EXTRA_MOUNT}
|
|
}
|
|
},
|
|
\"registry\":{
|
|
\"extraEnv\": ${PRELOAD_ENV},
|
|
\"extraVolumes\": ${EXTRA_VOL},
|
|
\"extraVolumeMounts\": ${EXTRA_MOUNT}
|
|
}
|
|
}}}}"
|
|
|
|
echo "==> Patch applied. Waiting 60s for operator to reconcile..."
|
|
sleep 60
|
|
|
|
echo "==> Pod status:"
|
|
kubectl -n gitlab get pods
|
|
|
|
echo "==> GitLab CR status:"
|
|
kubectl -n gitlab get gitlab gitlab
|