How to Renew vault Token?

Problem

The vault token is expired.

Environment

  • Platform9 Managed Kubernetes v5.9.3

Validation

Steps to validate the token expiry:

  1. Exec into pf9-vault pod in Management Plane namespace.

$ kubectl exec -it -n <MANAGEMENT_PLANE_NAMESPACE> --kubeconfig <KUBECONFIG> $(kubectl get pods -n $NS -l du-app=pf9-vault -o jsonpath="{.items[0].metadata.name}") -- /bin/bash
  1. Export the required details.

# export VAULT_TOKEN=$(mysql qbert -Bse "SELECT credential_value FROM qbert_secrets where credential_name='root_token'")

# export VAULT_ADDR=http://127.0.0.1:8200

# CLUSTER_UUID=<CLUSTER_UUID>

# OLD_VAULT_TOKEN=$(mysql qbert -Bse "SELECT vaultToken FROM clusters WHERE uuid='$CLUSTER_UUID'")

# ROOT_VAULT_TOKEN=$(mysql qbert -Bse "SELECT credential_value FROM qbert_secrets where credential_name='root_token'")

# CLUSTER_VAULT_TOKEN=$(mysql qbert -Bse "SELECT vaultToken FROM clusters WHERE uuid='$CLUSTER_UUID'")
  1. Run the below command to know token expiry details:

Example:

Procedure

  1. Exec Into pf9-vault pod in customer namespace

  1. Export required details (in pf9-vault pod)

  1. Generate New Token (in pf9-vault pod)

  1. Update the new token in qbert Database (in pf9-vault pod)

  1. Open a new terminal window and Verify if the new token is updated at cluster and node level (Execute on a new terminal window)

  1. If the token in Sunpike does not match the token in Qbert, run the following command to patch the Sunpike host object.(from the same terminal window as Step 5 )

  1. restart the full stack restart on nodes that got stuck at the Cert Generation phase (if any).

  2. revoke the old Token (in pf9-vault pod) - once all nodes are working fine.

Additional Information

To check if the vault token is expired follow these steps:

  1. From the problematic master node, perform this.

  1. Come to the DU VM and perform this.

Last updated