Skip to main content

Using ArgoCD to deploy Thoras

The Thoras Helm chart is designed to render deterministically for GitOps tools. Credentials are never generated at template time: anything you don’t supply is seeded in-cluster by the Thoras config-controller, and anything you pin in values.yaml is rendered verbatim. Two things still need attention:
  1. Disable legacy secret seeding. Set featureFlags.enableLegacySecretSeeding: false. The flag defaults to true only so clusters upgrading from chart 4.x can migrate their pre-existing credentials. The legacy Secrets it renders use Helm lookup, which Argo CD cannot evaluate. If you are upgrading from 4.x, complete the upgrade with the flag on, then set it to false once the pods are healthy. During that upgrade window, keep jsonPointers: [/data] ignoreDifferences entries for the api-client-secret and thoras-timescale-password Secrets so Argo CD does not overwrite them with freshly-rendered random values before the config-controller has migrated them. Remove those entries once the flag is false. See Upgrading.
  2. Ignore fields that are managed in-cluster. The webhook caBundle is injected after apply (by the chart’s cert-generator or by cert-manager), and the thoras-forecast-worker replica count is managed by Thoras’s built-in scaler. Add both to spec.ignoreDifferences.

Example Application config

The chart’s default webhook certificate flow uses Helm hook Jobs (pre-install, pre-upgrade), which GitOps tools do not handle well. If you run cert-manager, set thorasOperator.webhookCertGen.certManager.enabled: true to replace those Jobs with declarative Issuer and Certificate resources. See Webhook TLS with cert-manager.

Credential rotation under GitOps

When a credential changes (you rotate a pinned value in values.yaml, update a Secret you manage, or delete a generated key so it is re-seeded), the config-controller restarts the affected Thoras workloads for you. It does this by evicting pods rather than patching the Deployment’s pod template, so the restart never shows up as drift in Argo CD. No kubectl rollout restart is needed. See Credentials.

Flux

The same guidance applies to Flux: set featureFlags.enableLegacySecretSeeding: false and prefer cert-manager for webhook TLS. Additionally set flux.enabled: true so Flux’s drift detection does not revert the operator’s own rollout restarts:

Using ArgoCD to manage a Thoras horizontally controlled workload

When Thoras manages horizontal scaling for a workload, it uses a validation webhook to prevent the default Kubernetes Horizontal Pod Autoscaler (HPA) from reducing replicas during anticipated usage spikes. By design, this ensures workloads remain scaled up until Thoras determines it’s safe to scale down. However, ArgoCD interprets these blocked scale-down attempts as HPA errors. This can cause the Application to appear in a degraded state even though the workload is healthy. To prevent this, you can customize ArgoCD’s health assessment logic for HPAs so that these Thoras-specific conditions are handled correctly.

When Do I Need This?

You only need this customization if all of the following are true:
  • The workload is horizontally controlled by Thoras.
  • You are using ArgoCD to monitor the workload state.
  • You notice ArgoCD incorrectly marking the HPA as Degraded when Thoras blocks a scale-down.
If your workloads are not using Thoras for horizontal scaling, this customization is unnecessary. 1. Edit the ArgoCD ConfigMap: Open the argocd-cm ConfigMap in the argocd namespace:
2. Add the following customizations under data:
3. Restart ArgoCD components (to apply changes):