Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kotsadm-rqlite-db DB export fails due to credentials not being available #82

Open
CpuID opened this issue Oct 23, 2023 · 1 comment
Open

Comments

@CpuID
Copy link

CpuID commented Oct 23, 2023

Seems the RQLITE_PASSWORD env var isn't available to the kotsadm-rqlite pod? But it's on the kotsadm pod. We need to adjust the spec to make that password available to the collector.

STR:

  • install a Replicated KOTS app on a throwaway VM (eg. using kURL)
  • ensure kotsadm is running with rqlite, example:
# kubectl get po | grep kotsadm
kotsadm-546dd567fc-bf7pn              1/1     Running   0          31m
kotsadm-rqlite-0                      1/1     Running   0          31m
kurl-proxy-kotsadm-7d565684d5-qn8sx   1/1     Running   0          31m
  • run the below:
kubectl support-bundle https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml`
tar xzvf support-bundle-*.tar.gz
cat support-bundle-*/kots/admin_console/default/kotsadm-rqlite-0/kotsadm-rqlite-db-*
[
  "command terminated with exit code 1"
]
wget: server returned error: HTTP/1.1 401 Unauthorized

Password is stored in this K8s secret:

export RQLITE_PASSWORD=$(kubectl get secret kotsadm-rqlite -o jsonpath='{.data.password}' | base64 -d)
echo $RQLITE_PASSWORD
<redacted>

Confirmed this works manually, by using it in an rqlite pod shell:

kubectl exec -it kotsadm-rqlite-0 -- /bin/sh
/ $ export RQLITE_PASSWORD=<password-from-above> # so it's available in the rqlite pod shell
/ $ wget -qO- kotsadm:${RQLITE_PASSWORD}@localhost:4001/db/backup?fmt=sql
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
...
...
COMMIT;
@banjoh
Copy link
Member

banjoh commented Oct 26, 2023

Perhaps we should collect the DB dump in the kotsadm pod instead of trying to get the env var available in the rqlite pod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants