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

Support the infra server's /version endpoint in the automate-deployed infra server #3313

Merged
merged 2 commits into from
Apr 13, 2020

Conversation

yzl
Copy link
Contributor

@yzl yzl commented Apr 7, 2020

🔩 Description: What code changed, and why?

Supporting the infra server's /version endpoint enables using knife ec backup to backup the data from an infra server installed from an omnibus package and using knife ec restore to restore the data to an automate-deployed infra server.

Fixes #3301

⛓️ Related Resources

👍 Definition of Done

👟 How to Build and Test the Change

Deploy an infra server and take a backup

  1. In automate/components/automate-deployment, run vagrant up to bring up a minimal vagrant box. Use vagrant ssh to login, and go to the `/a2/ directory.
  2. Install a standalone infra server.
  3. As root, install chefdk (dpkg -i chefdk_4.7.113-1_amd64.deb) and the knife-ec-backup plugin (apt-get install ruby-dev g++ libpq-dev; chef gem install knife-ec-backup).
  4. As root, run knife fetch ssl to make the infra server's SSL certs available to knife.
  5. As root, backup the infra server: mkdir ./tmp; knife ec backup --server-url https://automate-deployment.test --key <admin-key> ./tmp. The backup will land in automate/components/automate-deployment/tmp.
  6. Exit the vagrant box and run vagrant destroy -f to stop and remove it.

Deploy the infra server using Automate and restore the data from the first infra serveer

  1. Checkout the branch yzl/3301 from the automate repo, bring up the studio dev environment, and run build components/automate-load-balancer.
  2. In automate/components/automate-deployment, run vagrant up to bring up a minimal vagrant environment.
  3. Go to the /a2 directory and, as root, install automate and infra server using the package built in the first step, e.g. ./components/automate-deployment/bin/linux/chef-automate deploy --product automate --product chef-server --hartifacts ./results --override-origin <your-origin>
  4. As root, install chefdk (dpkg -i chefdk_4.7.113-1_amd64.deb) and the knife-ec-backup plugin (apt-get install ruby-dev g++ libpq-dev; chef gem install knife-ec-backup).
  5. As root, run knife ssl fetch to make Automate's SSL certs available to knife.
  6. As root, go to components/automate-deployment/tmp, which contains the infra server backup, and restore the data to the infra server:
knife ec restore . -u pivotal --webui-key /hab/svc/automate-cs-oc-erchef/data/webui_priv.pem --skip-version-check -s https://`hostname -f`

✅ Checklist

📷 Screenshots, if applicable

to the infra server's nginx.

Signed-off-by: Yvonne Lam <[email protected]>
@yzl yzl marked this pull request as ready for review April 8, 2020 16:45
Copy link

@chef-davin chef-davin left a comment

Choose a reason for hiding this comment

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

Thanks for putting in this PR so quickly! It'll definitely help when it gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

knife ec restore does not work against the embedded chef server
3 participants