Pre-Installation Setup¶
Monitoring has a lot of secrets to communicate with various Phalanx components and to stock its mapping of alerts (via Slack webhooks) to channels.
Initial Gafaelfawr Setup¶
Gafaelfawr must have config.oidcServer.enabled set to true if you intend to use it as the authentication source for Chronograf.
Initial Secret Setup¶
Do an initial sync of the secrets: If there is no
monitoringsecret in the environment you’re working on, create it: Add a new static secret. Follow the guide at Update a static secret to add values foradmin-tokenandadmin-password. I usually use the output fromopenssl rand -hex 16to generate a 32-character password representing 16 random bytes, but any random password generation method would do.Configure the
webhooks.yamlsecret. If you can, you should probably just copy it from a working environment and edit to suit. But if you must recreate it from scratch:It is a YAML document that is a list of mappings of Slack webooks to channels.
Each entry in the list has four string fields:
channel,phalanx_env,phalanx_host, andwebhook_url.For each channel you want to send alerts to (in the LSSTC slack, they start with
#status-), configure as many of these as you can.For a phalanx environment, you should have all four fields. For instance, at the time of writing, channel
#status-usdf-rsp-devhasphalanx_envusdfdev,phalanx_hostusdf-rsp-dev.slac.stanford.edu, and awebhook_urlfound in theMonitoring (InfluxDBv2)Slack application in theLSSTCworkspace).It is possible that there are status channels you want to use that are not tied to a specific Phalanx environment (e.g. old Roundtable at
#status-roundtable) or which are not specific to a unique instance (e.g.#status-square-dev); in that case, the inapplicable values should be set to the empty string.
Once you have the YAML written, base64-encode it, and store the resulting string as the value of
webhooks.yaml.
Create dummy entries for
influx-alert-tokenandtelegraf-token. These will get overwritten after installation, so their values don’t matter. The telegraf token is not actually used by themonitoringapplication, but having it stored safely will make configuring the monitoring agents much easier.Audit the secrets: Audit secrets for an environment. If you are only missing the
monitoringsecrets, you’re doing fine. If anything else is incorrect, fix that first before coming back here.Sync the secrets: Sync secrets for an environment.
Add the OIDC Secrets to Gafaelfawr¶
Now you’ll need the values for
GENERIC_CLIENT_IDandGENERIC_CLIENT_SECRET.GENERIC_CLIENT_IDischronograf-client-idunless you’ve done a per-environment override.These can be found with
vault kv get secret/phalanx/<environment>/monitoring. They are not in 1Password because they are randomly generated when secrets are synced.Add these values to the JSON document inside the
oidc-server-secretsentry of thegafaelfawrsecret, replacing an old entry if needed.idwill be the value ofGENERIC_CLIENT_ID.return_uriwill behttps://<environment FQDN>/chronograf/oauth/OIDC/callback.secretwill be the value ofGENERIC_CLIENT_SECRET.
Restart Gafaelfawr to pick up the changed secrets.