Upgrade
Note
Steps to upgrade the Chef Automate HA are as shown below:
Download the latest CLI
curl https://chefdownload-commercial.chef.io/files/current/latest/chef-automate-cli/chef-automate_linux_amd64.zip | gunzip - > chef-automate && chmod +x chef-automate | cp -f chef-automate /usr/bin/chef-automate
Download Airgapped Bundle, download latest Bundle with this:
curl https://chefdownload-commercial.chef.io/airgap_bundle/current/automate/latest.aib -o latest.aib
Download specific version bundle with this:
curl https://chefdownload-commercial.chef.io/airgap_bundle/current/automate/<version>.aib -o automate-<version>.aib
Note
Chef Automate bundles are available for 365 days from the release of a version. However, the milestone release bundles are available for download forever.If we want to only upgrade FrontEnd Services i.e. Chef Automate and Chef Infra Server.
chef-automate upgrade run --airgap-bundle latest.aib --upgrade-frontends
If we want to only upgrade BackEnd Services i.e. PostgreSQL and OpenSearch.
chef-automate upgrade run --airgap-bundle latest.aib --upgrade-backends
To upgrade full Chef Automate HA System run this command from Bastion Host:
chef-automate upgrade run --airgap-bundle latest.aib
Note
- Backend upgrades will restart the backend service, which take time for cluster to be in health state.
- Backend upgrades should be performed in maintenance window.
- Upgrade command, currently only supports minor upgrade.
- To skip user confirmation prompt in upgrade, you can pass a flag
chef-automate upgrade run --airgap-bundle latest.aib --auto-approve OR chef-automate upgrade run --airgap-bundle latest.aib --upgrade-backends --auto-approve OR chef-automate upgrade run --airgap-bundle latest.aib --upgrade-frontends --auto-approve
Upgrade will also check for new version of bastion workspace, if new version is available, it will prompt for a confirmation for workspace upgrade before upgrading the Frontend or backend nodes,
In case of yes, it will do workspace upgrade and no will skip this. We can also pass a flag in upgrade command to avoid prompt for workspace upgrade.
chef-automate upgrade run --airgap-bundle latest.aib --auto-approve --workspace-upgrade yes
OR
chef-automate upgrade run --airgap-bundle latest.aib --auto-approve --workspace-upgrade no
Note
AMI Upgrade Setup For AWS Deployment
Note
Note
Steps to set up the AMI Upgraded Cluster
Deploy the New cluster into a same/different region with S3 backup configuration.you can refer AWS Deployment steps.
Do the backup configuration only when you have not provided the (backup information) configuration at the time of deployment. Refer backup section for s3 configuration.
On Primary Cluster
- Take a backup of Primary cluster from bastion by running below command:
chef-automate backup create --no-progress > /var/log/automate-backups.log
- Create a bootstrap bundle, this bundle captures any local credentials or secrets that aren’t persisted in the database. To create the bootstrap bundle, run the following command in one of the Automate nodes:
chef-automate bootstrap bundle create bootstrap.abb
- Copy
bootstrap.abb
to all Automate and Chef Infra frontend nodes in the New cluster.
On New AMI upgraded Cluster
- Install
bootstrap.abb
on all the Frontend nodes (Chef-server and Automate nodes) by running the following command:
sudo chef-automate bootstrap bundle unpack bootstrap.abb
- Run the following command in bastion to get the ID of the backups:
chef-automate backup list
- Make sure all the services in New cluster are up and running by running the following command from bastion:
chef-automate status
On New Cluster Trigger restore command from bastion.
- For Chef Managed OpenSearch follow the below steps:
sudo chef-automate config show > current_config.toml
- Add the below config into
current_config.toml
(without any changes) and copycurrent_config.toml
to bastion
[global.v1.external.opensearch.auth.basic_auth] username = "admin" password = "admin"
- On New cluster, use the following restore command to restore the backup of Primary Cluster from bastion.
sudo chef-automate backup restore s3://<s3-bucket-name>/<path-to-backup>/<backup-id>/ --patch-config /path/to/current_config.toml --airgap-bundle /path/to/airgap-bundle --skip-preflight --s3-access-key "Access_Key" --s3-secret-key "Secret_Key"
- Install
If you want to reuse the same custom domain used previously, update your DNS record to point to the Load-Balancer of the new cluster.
Once the restore is successful you can destroy the Primary Cluster.