How To Renew Vault Token LTS1 Setup
Problem
Unable to run the kubectl commands as the vault token was expired on the master nodes.
Nodelet phases getting stuck on Gen-Certs Phase
File \"<string>\", line 1, in <module>"}
KeyError: 'data'"}
Certificate is not signed by CA"}
Error loading file /tmp/authbs-certs.abc/apiserver/
error sending status update to sunpike: rpc error: code = Unknown desc = apiserver storage error: an error on the server
"rpc error: code = DeadlineExceeded desc = latest balancer error: all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: authentication handshake failed: x509: certificate has expired or is not yet valid\""}While checking the directory/tmp/authbs-certs.abc/apiserver/ mentioned in the error, the file request.json had the entryPermission denied instead of the certificate information.
[root@master0 apiserver]# cat /tmp/authbs-certs.abc/apiserver/request.json
{"errors":["permission denied"]}Environment
Platform9 Edge Cloud v-5.3.
Solution
To recover from this issue, it is required to regenerate the vault token.
Validation
Steps to validate the token expiry:
SSH into the DU VM as root user.
Export the required details.
Run the below command to know token expiry details:
Example:
Procedure
The steps to regenerate the vault token are:
Perform below 1 to 7 steps as a root user in the DU VM:
1. Retrieve the affected cluster's UUID
2. Check the current vault token for the affected cluster
3. Set the value for the following variables to regenerate the token:
4. Verify the values of the variables $OLD_VAULT_TOKENand $ROOT_VAULT_TOKEN
5. Generate new vault token using the below commands:
6. Update the new token in the qbert database:
7. Verify the newly generated token using:
Restart the nodeletd phases on each master nodes/affected nodes one at a time.
9. Check the new token in the file /etc/pf9/kube.env
Additional Information
Post pf9-vault token renewal, if the new token generated in the DU VM is not propagated to the nodes in file /etc/pf9/kube.env perform the below workaround:
Manually copy the vault token from the DU VM:
Replace the token in the node in file
/etc/pf9/kube.env
Restart the nodeletd phases in the nodes. This should pick up the new pf9-vault token.
Last updated
