Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation of Process to Upgrade AMI for AWS Deployment #7680

Merged
merged 7 commits into from
Jan 27, 2023

Conversation

bvtejaswi
Copy link
Collaborator

@bvtejaswi bvtejaswi commented Jan 20, 2023

🔩 Description: What code changed, and why?

Created a Docs Page where the Process to Upgrade AMI for AWS Deployment is shown with Backup and Restore method

⛓️ Related Resources

https://chefio.atlassian.net/browse/MADROX-421

👍 Definition of Done

Documentation where the Process to Upgrade AMI for AWS Deployment via Backup and Restore method.

👟 How to Build and Test the Change

✅ Checklist

All PRs must tick these:

With occasional exceptions, all PRs from Progress employees must tick these:

  • Is the code clear? (complicated code or lots of comments--subdivide and use well-named methods, meaningful variable names, etc.)
  • Consistency checked? (user notifications, user prompts, visual patterns, code patterns, variable names)
  • Repeated code blocks eliminated? (adapt and reuse existing components, blocks, functions, etc.)
  • Spelling, grammar, typos checked? (at a minimum use make spell in any component directory)
  • Code well-formatted? (indents, line breaks, etc. improve rather than hinder readability)

All PRs from Progress employees should tick these if appropriate:

  • Tests added/updated? (all new code needs new tests)
  • Docs added/updated? (all customer-facing changes)

Please add a note next to any checkbox above if you are NOT ticking it.

📷 Screenshots, if applicable

@bvtejaswi bvtejaswi requested a review from a team as a code owner January 20, 2023 12:17
@netlify
Copy link

netlify bot commented Jan 20, 2023

Deploy Preview for chef-automate ready!

Name Link
🔨 Latest commit 644f814
🔍 Latest deploy log https://app.netlify.com/sites/chef-automate/deploys/63d3cccb6798ae00081361d7
😎 Deploy Preview https://deploy-preview-7680--chef-automate.netlify.app/automate/ha_upgrade_introduction
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the documentation Anything related to the Automate docs. label Jan 20, 2023
For Disaster Recovery or AMI upgarde, while running the restore in secondary cluster which is in different region follow the steps given below.

- First, Take the bakup in Secondary Cluster
- Then make a curl request `curl -XGET https://localhost:9200/_snapshot?pretty -u admin:admin -k`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CURL is only supported in the OpenSearch node. Make sure to mention that, or add the endpoint to make same request from Automate Node

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- First, Take the bakup in Secondary Cluster
- Then make a curl request `curl -XGET https://localhost:9200/_snapshot?pretty -u admin:admin -k`
- check the curl request response if the region is not matching with the primary cluster follow the below steps:
1. Modify the region in fe nodes by patching the below configs with command, `chef-automate config patch <file-name>.toml --fe`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Modify the region in fe nodes by patching the below configs with command, `chef-automate config patch <file-name>.toml --fe`
1. Modify the region in the FrontEnd nodes by patching the below configs with command, `chef-automate config patch <file-name>.toml --fe`

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


{{< note >}}

The AWS deployment should be configured with S3.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add more details to this note.

  1. Which S3 bucket should be configured to the new (upgraded) cluster setup
  2. Now with MADROX-427, user can directly mention existing bucket name in config.toml

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


### Steps to set up the AMI Upgraded Cluster

1. Deploy the Primary cluster following the deployment instructions by [clicking here](/automate/ha_aws_deploy_steps/#deployment).
Copy link
Collaborator

@ArvinthC3000 ArvinthC3000 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The assumption here is the user will already have a Primary setup (in case of an AMI upgrade). Do we need to mention Step 1?
  2. Should we use the terminology Primary/Secondary cluster, or can we call this something else ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Discussed ,used Primary and New cluster

- Copy `bootstrap.abb` to all Automate and Chef Infra frontend nodes in the Secondary cluster.


1. On New AMI upgraded Cluster
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either we can use New Cluster with upgraded AMI or Secondary Cluster(?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

chef-automate backup list
```

-On Secondary Cluster Trigger restore command `chef-automate backup restore` on one of the Chef Automate nodes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-On Secondary Cluster Trigger restore command `chef-automate backup restore` on one of the Chef Automate nodes.
- On Secondary Cluster Trigger restore command `chef-automate backup restore` on one of the Chef Automate nodes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


-On Secondary Cluster Trigger restore command `chef-automate backup restore` on one of the Chef Automate nodes.

- To run the restore command, you need the airgap bundle. Get the Automate HA airgap bundle from the location `/var/tmp/` in Automate instance. For example: `frontend-4.x.y.aib`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below this line, the Preview link is showing as code snippets for all the descriptions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


### Switch to New Upgraded Cluster

Steps to switch to the New cluster are as follows:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include steps to re-configure user's DNS to new set of Loadbalances created in the New cluster with upgraded AMIs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


In the above approach, there will be two identical clusters

- Primary Cluster (or Production Cluster)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Primary Cluster (or Production Cluster)
- Primary Cluster

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

@punitmundra punitmundra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do the change, other than that ..doc is fine

@bvtejaswi
Copy link
Collaborator Author

do the change, other than that ..doc is fine

All the changes are done now.

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
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 to the database. To create the bootstrap bundle, run the following command in one of the Automate nodes:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Create a bootstrap bundle; this bundle captures any local credentials or secrets that aren't persisted to the database. To create the bootstrap bundle, run the following command in one of the Automate nodes:
- 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:

Copy link
Collaborator

@dishanktiwari2501 dishanktiwari2501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed The Doc Changes.


- On New Cluster Trigger restore command from bastion.

- To run the restore command, you need to add the OpenSearch credentials to the applied config. If using Chef Managed OpenSearch,we need to have automate config.Run the below command in the Chef-Automate node to get the applied config into `current_config.toml`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- To run the restore command, you need to add the OpenSearch credentials to the applied config. If using Chef Managed OpenSearch,we need to have automate config.Run the below command in the Chef-Automate node to get the applied config into `current_config.toml`:
- For Chef Managed OpenSearch follow the below steps:


- Once the restore is successful ,you can destroy the Primary Cluster.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Once the restore is successful ,you can destroy the Primary Cluster.
- Once the restore is successful you can destroy the Primary Cluster.


```

- If you want to reuse the same custom domain used previously, then make sure to update the DNS entry to the Load-Balancer FQDN of the New cluster.
Copy link
Collaborator

@vivekshankar1 vivekshankar1 Jan 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- If you want to reuse the same custom domain used previously, then make sure to update the DNS entry to the Load-Balancer FQDN of the New cluster.
- 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.

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
@vivek-yadav vivek-yadav merged commit 58d822a into main Jan 27, 2023
@vivek-yadav vivek-yadav deleted the tejaswi/ami-upgrade branch January 27, 2023 13:08
@sonarcloud
Copy link

sonarcloud bot commented Jan 27, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

dishanktiwari2501 pushed a commit that referenced this pull request Jan 30, 2023
* Documentation for AMI upgrade

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>

* Documentation for AMI upgrade

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>

* Documentation for AMI upgrade

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>

* Documentation for AMI upgrade

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>

* Documentation for AMI upgrade

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>

* Documentation for AMI upgrade

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>

* Documentation for AMI upgrade

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>

Signed-off-by: Tejaswi Bondila <bondila.venkatatejaswi@progress.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the Automate docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants