Keep the proxy tokens in Vault, External Secrets or a CSI driver

Keep the proxy and Grafana tokens out of Helm values and shell history. Your secrets tool hands them to the proxy as a Secret or as files, and a rotated token needs no restart.

What you need
An admin must have added the proxy in Tellagen. You need permission to change the namespace or the host where the proxy runs.

The proxy needs two tokens: the proxy token from Tellagen and a Grafana token. Pick the tab for your tool, then tell the Add proxy page about it. For Helm, open Change the Secret name, or use Vault or token files. For Docker, open A secrets tool writes my token files. The commands on the page change to match.

Steps

  1. Put both tokens in one Secret

    In the namespace tellagen, make a Secret with the key tellagen-proxy-token for the proxy token and grafana-service-account-token for the Grafana token. External Secrets, Sealed Secrets or SOPS can make it for you.

  2. Install with its name

    On the Add proxy page, open Change the Secret name, or use Vault or token files. Keep A Kubernetes Secret, type the name in Name of the Secret, then run the install command. It holds --set existingSecret= and the name.

    The page also prints a command that makes the Secret. Skip it when your tool makes the Secret.

  3. Rotate a token

    Change the value in the Secret, or let your tool do it. The proxy reads the token again within a minute, though Kubernetes can take a little longer to update a mounted Secret. To replace the proxy token by hand, run this where the new token file is.

    Patch the Secret

    kubectl -n tellagen patch secret tellagen-proxy \
      -p "{\"stringData\":{\"tellagen-proxy-token\":\"$(cat tellagen-proxy-token)\"}}"

What happens next

  • The proxy reads each token file again every minute, and at once when Tellagen or Grafana refuses a token. A rotated token reaches it with no restart.
  • The config line of the doctor shows where the proxy read its token, never the token itself.

FAQs

  • The doctor says a token file “is missing or empty”. What do I check?

    The path in the message isn't a file in the container. Check the mount, the file name, and that your tool or sidecar wrote the file.

  • The sidecar writes the files after the proxy starts. Is that a problem?

    No. At start, the proxy waits up to 2 minutes for a token file that is missing or empty.

  • The doctor says a token file “cannot be read by user”. How do I fix it?

    The container user can't read the file. The message names that user. Give the file the mode 0644, or make that user its owner. Docker Compose ignores the owner and mode you set for file secrets.

  • Helm says “tellagen.token and existingSecret are both set. Set only one.” Why?

    A token is in your values and in the Secret or files. Remove tellagen.token and grafana.token from your values when you use existingSecret or secretFiles.

  • The doctor says the value “is not a Tellagen proxy token”. Why?

    The file holds more than the token, such as quotes or a line of a Vault template. Copy the whole token from Tellagen and nothing else.

Related guides

Updated . Something out of date? Write to [email protected]. Open Markdown version