How To Re-generate Certificates If Hostagent Certificates are Expired

Problem

  • Hostagent certificate and other components certificates are expired and all nodes are marked as disconnected and unable to perform upgrades.
  • Performing Higher Version Upgrade is not re-generating hostagent certificates even when the certificates are not expired.

Environment

  • Platform9 Edge Cloud - v5.3 and Higher
  • Airctl
  • Hostagent Certificate

Procedure

There is product bug where the hostagent certificates are not being regenerated during same/higher version upgrades on up to patch 13. Please follow the steps mentioned in this KB if running a deployment on patch 13.

Starting patch 14 (v-5.3.0-2710638), these certificates will be regenerated during both - a same version upgrade, as well as a higher version upgrade.

  • Login/SSH to Deployment Unit Host (DU Host).
  • Start MongoDB container and exec into it.
DU Host
Copy
  • Now inside airctl-mongo run the below commands:
Inside airctl-mongo container
Copy

If multiple indexes are seen with the db.secrets.getIndexes() output then skip below step to create a unique tag index. If getIndexes() output has only one index then create a unique tag index and verify using below commands.

Inside airctl-mongo container
Copy
  • Now open another terminal for Deployment Unit Host and start the pf9deployExec container using the below command and exec into it to export the mentioned env variables:
Start & Exec in pf9deployExec container on DU Host
Copy
  • The above check-certs would show the certs version and denote if it's expiring.
  • Now generate certs and check using:
Inside pf9deploy container
Copy
  • Now dump the MongoDB data using airctl:
  • For DU version 5.3
DU Host
Copy
  • For DU version 5.1
DU Host
Copy
  • Once the new certs are generated, you stop the pf9deployExec and airctl-mongo containers and delete the pf9deployExe container using:
DU Host
Copy

When performing a SAME VERSION upgrade, ensure to use a pristine QCOW2 image when running the upgrade command.

  • Now we can start with the Same Version or Higher Version upgrade using the steps mentioned in the Upgrade documentation. Only follow steps in that page till the **Upgrade DU section** section.
  • If the Upgrade operation above fails with the below Ansible Log Trace, refer this Solution to troubleshoot the upgrade.
pf9deply.log
Copy
  • Final Step: Perform host upgrade using steps mentioned in Configure Host and HostAgent Upgrade.
    • On upgrading the DU to patch14 - v-5.3.0-2710638 (or higher) from a previous patch (up to LTS1 patch 13), host agent certificates generated on the DU using the process described in this page will be automatically copied over to the hosts as part of the host agent upgrade - and the host certificates will be renewed.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard