Skip to content

Rotate Cluster Secrets

This feature was introduced in Hydrolix version 6.6.

Schedule the Hydrolix operator to replace the cluster's generated passwords and keys, exclude specific keys, and check a rotation's progress. For how rotation works and which keys it changes, see How Secret Rotation Works.

Prerequisites⚓︎

  • Hydrolix v6.6 or later
  • Permission to modify the HydrolixCluster specification
  • A maintenance window that doesn't overlap a Hydrolix upgrade

Schedule a rotation⚓︎

Effects during a rotation

Until the affected workloads restart, sign-in can fail and services can't open new database connections. The Grafana and Superset admin passwords change. See Effects during a rotation.

  1. Set secret_rotation.at to the start time, in ISO 8601 format with a UTC offset such as Z. Optionally, set secret_rotation.timeout. The default is 30m.

    hydrolixcluster.yaml
    1
    2
    3
    4
    5
    6
    apiVersion: hydrolix.io/v1
    kind: HydrolixCluster
    spec:
      secret_rotation:
        at: "2026-11-01T02:00:00Z"
        timeout: "30m"
    
  2. Apply the configuration.

    Apply the Configuration
    kubectl apply -f hydrolixcluster.yaml
    

The rotation starts within 15 seconds after the at time, once the cluster status is Ready.

To rotate again, set a later at. Each at value starts one rotation.

Exclude a key from rotation⚓︎

The operator doesn't rotate keys in the curated secret. To keep a key's current value, copy the key from general into curated. This example excludes the Grafana admin password:

Copy a Key Into the Curated Secret
VALUE=$(kubectl get secret general -o jsonpath='{.data.GRAFANA_ADMIN_PASSWORD}')
kubectl patch secret curated --type merge -p "{\"data\":{\"GRAFANA_ADMIN_PASSWORD\":\"$VALUE\"}}"

The command copies the base64-encoded value as Kubernetes stores it. If the cluster has no curated secret, see Create a curated secret.

To return a key to rotation, remove it from curated. The next rotation includes it.

Check a rotation's progress⚓︎

  • Show the rotation status. The phase field shows the current phase, and error shows the reason for a revert or failure.

    Show the Rotation Status
    kubectl get hydrolixcluster -o jsonpath='{.items[*].status.secretRotation}'
    
  • Monitor the o6r_hdx_secret_rotation_phase metric. The current phase is 1. Alert when phase="failed" or phase="rolled-back" is 1. The restarting phase has no timeout, so also alert when it stays at 1 longer than a normal rollout takes.

  • Search the operator log for secret rotation.

For phase and field definitions, see Status and metrics.

Respond to a failed rotation⚓︎

When the phase is rolled-back, the cluster is on its previous values and general is unchanged.

  1. Read status.secretRotation.error.
  2. Fix the cause.
  3. Set a later at.

When the phase is failed, the revert didn't complete, and some services might use values that differ from general. Don't set a new at. Collect the rotation status and the logs of the rotation jobs, and contact Hydrolix support.

List the Rotation Jobs
kubectl get jobs -l hdx_secret_rotation