How to find out config parameters of a running cluster

How to find out config parameters of a running cluster

If you have a running precomposer cluster, you might want to read the running config parameters and secrets - e.g. when the cluster was setup by someone else and you would like to know the details of the actual running configuration.

For example, you might want to know which commercetools project or which Storyblok space the installation is using.

Prerequisites

You need some kind of administrative access to the cluster:

  • Either via UI (your provider's console UI or a kubernetes dashboard)
  • or via command line using kubectl.

Abstract

All variables and secrets are store in Kubernetes config maps and secrets.

Here is a list of the most important ones:

TypeNameNamespaceMost important config vars
config mapaggregator-configecube-precomposer-ENVSEARCH_PROVIDER_TO_USE
COMMERCETOOLS_AUTH_URL
COMMERCETOOLS_PROJECT_KEY
STORYBLOK_ACCESS_TOKEN
STORYBLOK_CONTENT_VERSION
ALGOLIA_INDEX
config mapstorefront-config-abcdshop-stack-ENVNEXTAUTH_URL
NEXT_PUBLIC_API_GRAPHQL_ENDPOINT
NEXT_PUBLIC_BASE_URL
NEXT_PUBLIC_CMS_BASE_PATH
config mapemail-processor-configemail-processor-ENVSENDER_EMAIL_ADDRESS
secretaggregator-secretsecube-precomposer-ENVCOMMERCETOOLS_AUTH_CLIENT_ID
COMMERCETOOLS_AUTH_CLIENT_SECRET
COMMERCETOOLS_CLIENT_ID
COMMERCETOOLS_CLIENT_SECRET
ALGOLIA_APPLICATION_ID
ALGOLIA_SEARCH_KEY
secretemail-processor-secretsemail-processor-ENVSENDGRID_API_KEY

(ENV will be the name of the environment you entered when setting up the environment.)

Variant A: Use the cluster's UI (Kubernetes dashboard)

Here's they you do it using the "Kubernetes dashboard". If you're using a different UI, the steps may vary but will be similar.

  1. Optional: Select the desired namespace (e.g. ecube-precomposer-dev - replace "dev" by the name of your environment).
  2. Click on "config maps" resp. "secrets".
  3. Select (or filter for) the needed config map resp. secret (see table above).

Variant B: Use the command line (kubectl)

E.g. to read the aggregator-config:

kubectl -n ecube-precomposer-dev get configmaps aggregator-config  --output='jsonpath={.data}' | jq

Result will be similar to

{
  ...
  "COMMERCETOOLS_API_URL": "https://api.europe-west1.gcp.commercetools.com/",
  ...
  "COMMERCETOOLS_AUTH_URL": "https://auth.europe-west1.gcp.commercetools.com/",
  "COMMERCETOOLS_ENABLE_QUERY_MONITORING": "true",
  "COMMERCETOOLS_PROJECT_KEY": "norma",
  "SEARCH_PROVIDER_TO_USE": "algolia",
  "ALGOLIA_INDEX": "algolia_index",
  "SENDER_EMAIL_ADDRESS": "sender@example.com",
  ...
  "ENABLE_GRAPHQL_PLAYGROUND": "false",
  ...
  "STORYBLOK_ACCESS_TOKEN": "ABCxzy...",
  "STORYBLOK_CONTENT_VERSION": "draft",
  ...
}

E.g. to read the aggregator-secrets:

kubectl -n ecube-precomposer-dev get secrets aggregator-secrets  --output='jsonpath={.data}' | jq

Result will be similar to

{
  "COMMERCETOOLS_AUTH_CLIENT_ID": "ABCxzy...",
  "COMMERCETOOLS_AUTH_CLIENT_SECRET": "ABCxzy...",
  "COMMERCETOOLS_CLIENT_ID": "ABCxzy...",
  "COMMERCETOOLS_CLIENT_SECRET": "ABCxzy...=",
  "ALGOLIA_APPLICATION_ID": "ABCxzy...=",
  "ALGOLIA_SEARCH_KEY": "ABCxzy...=",
  "SENDGRID_API_KEY": "SG.1234567..."
}

(Note: The | jq at the end will pretty-print the JSON. If you haven't got jq, just leave this out.)