mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 11:03:59 +00:00
- 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
35 lines
1.9 KiB
Bash
35 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
export KUBECONFIG=/Users/chrisfu/dev/prole/prole-k3s.kubeconfig
|
|
|
|
echo "==> Patching minio main container with MINIO_ROOT_USER/PASSWORD from secret..."
|
|
kubectl -n gitlab patch deployment gitlab-minio --type=json -p '[
|
|
{"op":"add","path":"/spec/template/spec/containers/0/env/-",
|
|
"value":{"name":"MINIO_ROOT_USER","valueFrom":{"secretKeyRef":{"name":"gitlab-minio-secret","key":"accesskey"}}}},
|
|
{"op":"add","path":"/spec/template/spec/containers/0/env/-",
|
|
"value":{"name":"MINIO_ROOT_PASSWORD","valueFrom":{"secretKeyRef":{"name":"gitlab-minio-secret","key":"secretkey"}}}}
|
|
]'
|
|
|
|
echo "==> Deleting minio pod to restart with correct env..."
|
|
kubectl -n gitlab delete pod -l app=minio --ignore-not-found
|
|
|
|
echo "==> Waiting 60s for minio to restart..."
|
|
sleep 60
|
|
|
|
echo "==> Init container log:"
|
|
kubectl -n gitlab logs -l app=minio -c configure --tail=3 2>&1 || true
|
|
|
|
echo "==> Minio main log:"
|
|
kubectl -n gitlab logs -l app=minio --tail=5 2>&1 | grep -v LD_PRELOAD | head -5 || true
|
|
|
|
echo "==> Test credentials..."
|
|
AK=$(kubectl -n gitlab get secret gitlab-minio-secret -o jsonpath='{.data.accesskey}' | base64 -d | tr -d '\n')
|
|
SK=$(kubectl -n gitlab get secret gitlab-minio-secret -o jsonpath='{.data.secretkey}' | base64 -d | tr -d '\n')
|
|
kubectl -n gitlab delete pod minio-cred-test --ignore-not-found 2>/dev/null || true
|
|
kubectl -n gitlab run minio-cred-test \
|
|
--image=minio/mc:latest --restart=Never \
|
|
--overrides="{\"spec\":{\"nodeName\":\"gandalf.prole.org\",\"tolerations\":[{\"operator\":\"Exists\"}],\"containers\":[{\"name\":\"t\",\"image\":\"minio/mc:latest\",\"command\":[\"sh\",\"-c\",\"mc alias set gl http://gitlab-minio-svc.gitlab.svc.cluster.local:9000 ${AK} ${SK} && mc ls gl && echo CREDS_OK\"]}]}}"
|
|
sleep 40
|
|
kubectl -n gitlab logs minio-cred-test 2>&1 | tail -5 || true
|
|
kubectl -n gitlab delete pod minio-cred-test --ignore-not-found 2>/dev/null || true
|