prole/tmp/patch_jemalloc_v2.sh
chrisfu b4fc5641db checkpoint: sanitize prole config for host portability
- fix conf/prod/prole.cfg by replacing hardcoded /Users/chrisfu paths with /Users/chrisfu

- remove injected [update.sh] log lines and stray password artifacts so config is executable

- include latest pending updates across deployment config, UI/core flow, vault/network artifacts, and helper scripts
2026-04-10 05:58:40 -07:00

57 lines
2.8 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
export KUBECONFIG=/Users/chrisfu/dev/prole/prole-k3s.kubeconfig
echo "==> Deleting failed migrations job so operator can recreate it..."
kubectl -n gitlab delete job -l app=migrations --ignore-not-found
echo "==> Patching GitLab CR — extraVolumes/extraVolumeMounts as YAML strings..."
# The GitLab chart expects extraVolumes/extraVolumeMounts as YAML strings, not arrays
kubectl -n gitlab patch gitlab gitlab --type=merge -p '{
"spec":{"chart":{"values":{
"global":{
"extraEnv":{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"}
},
"gitlab":{
"migrations":{
"extraEnv":{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"},
"extraVolumes":"- name: jemalloc-16k\n hostPath:\n path: /opt/gitlab-jemalloc\n type: Directory\n",
"extraVolumeMounts":"- name: jemalloc-16k\n mountPath: /opt/gitlab-jemalloc\n readOnly: true\n"
},
"sidekiq":{
"extraEnv":{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"},
"extraVolumes":"- name: jemalloc-16k\n hostPath:\n path: /opt/gitlab-jemalloc\n type: Directory\n",
"extraVolumeMounts":"- name: jemalloc-16k\n mountPath: /opt/gitlab-jemalloc\n readOnly: true\n"
},
"webservice":{
"extraEnv":{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"},
"extraVolumes":"- name: jemalloc-16k\n hostPath:\n path: /opt/gitlab-jemalloc\n type: Directory\n",
"extraVolumeMounts":"- name: jemalloc-16k\n mountPath: /opt/gitlab-jemalloc\n readOnly: true\n"
},
"gitaly":{
"extraEnv":{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"},
"extraVolumes":"- name: jemalloc-16k\n hostPath:\n path: /opt/gitlab-jemalloc\n type: Directory\n",
"extraVolumeMounts":"- name: jemalloc-16k\n mountPath: /opt/gitlab-jemalloc\n readOnly: true\n"
},
"toolbox":{
"extraEnv":{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"},
"extraVolumes":"- name: jemalloc-16k\n hostPath:\n path: /opt/gitlab-jemalloc\n type: Directory\n",
"extraVolumeMounts":"- name: jemalloc-16k\n mountPath: /opt/gitlab-jemalloc\n readOnly: true\n"
}
},
"registry":{
"extraEnv":{"LD_PRELOAD":"/opt/gitlab-jemalloc/libjemalloc.so.2"},
"extraVolumes":"- name: jemalloc-16k\n hostPath:\n path: /opt/gitlab-jemalloc\n type: Directory\n",
"extraVolumeMounts":"- name: jemalloc-16k\n mountPath: /opt/gitlab-jemalloc\n readOnly: true\n"
}
}}}}'
echo "==> Patch applied. Waiting 60s for operator to reconcile..."
sleep 60
echo "==> Pod status:"
kubectl -n gitlab get pods --sort-by=.metadata.creationTimestamp | grep -v jemalloc-builder | grep -v arch-check
echo "==> GitLab CR status:"
kubectl -n gitlab get gitlab gitlab