Under normal circumstances, you can retrieve KOTS application config values using the KOTS CLI kots get config
When the KOTS Admin Console is unavailable but you need to access application configuration values, you can retrieve them directly from the rqlite database. This guide explains how to access both current and previous version configurations.
Prerquisites
- Access to the Kubernetes cluster with sufficient permissions
- StatefulSet
kotsadm-rqlite
is up and running kubectl
CLI tool installed and configuredyq
curl
jq
installed
Instructions
- Port-Forward to rqlite Service, first establish a connection to the rqlite service:
export NAMESPACE=<namespace>
kubectl port-forward svc/kotsadm-rqlite 4001:4001 -n $NAMESPACE
- Retrieve Configuration Values in a new terminal window, run the following commands:
export NAMESPACE=<namespace>
export URL=kotsadm:$(kubectl get secret kotsadm-rqlite -n $NAMESPACE -o jsonpath='{.data.password}' | base64 -d)@localhost:4001
# for latest config values
curl -sG $URL/db/query\?pretty\&timings --data-urlencode 'q=select av.config_values from app_version av join app a on a.id=av.app_id and a.current_sequence = av.sequence' | jq -r '.results[0].values[0][0]' | yq e 'del(.metadata, .status)' -
# for config values for specific app sequence, replace <sequence> with actual sequence number
curl -sG $URL/db/query\?pretty\&timings --data-urlencode 'q=select config_values from app_version where sequence = <sequence>' | jq -r '.results[0].values[0][0]' | yq e 'del(.metadata, .status)' -