{"id":20510369,"url":"https://github.com/frobware/aws-cluster-up","last_synced_at":"2025-03-05T22:31:54.119Z","repository":{"id":66960993,"uuid":"134908457","full_name":"frobware/aws-cluster-up","owner":"frobware","description":"Define and deploy AWS infrastructure; generate OpenShift ansible inventories","archived":false,"fork":false,"pushed_at":"2020-02-05T08:55:02.000Z","size":42,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T07:38:22.397Z","etag":null,"topics":["aws","cluster","openshift","openshift-ansible","terraform"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frobware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-25T21:59:28.000Z","updated_at":"2020-02-05T08:55:03.000Z","dependencies_parsed_at":"2023-05-14T05:00:23.297Z","dependency_job_id":null,"html_url":"https://github.com/frobware/aws-cluster-up","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Faws-cluster-up","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Faws-cluster-up/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Faws-cluster-up/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frobware%2Faws-cluster-up/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frobware","download_url":"https://codeload.github.com/frobware/aws-cluster-up/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242114315,"owners_count":20073937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cluster","openshift","openshift-ansible","terraform"],"created_at":"2024-11-15T20:29:17.153Z","updated_at":"2025-03-05T22:31:54.094Z","avatar_url":"https://github.com/frobware.png","language":"Shell","readme":"# aws-cluster-up\n\nDefine and deploy AWS infrastructure; generate OpenShift ansible inventories.\n\n# Install\n\n\tgit clone https://github.com/frobware/aws-cluster-up.git\n\tcd aws-cluster-up\n\t./bootstrap.sh\n\t./configure\n\tsudo make install\n\n## Dependencies\n\nThree external tools are required:\n\n- `sudo dnf install -y jq`\n- `sudo dnf install -y awscli`\n- [terraform](https://www.terraform.io/intro/getting-started/install.html#installing-terraform)\n\nNote: terraform - version 0.11.14 last known version to work with the\n`jq` scripts that parse `terraform.tfstate`.\n\n# Usage\n\nThe general usage pattern is:\n\n1. Setup the environment\n2. Generate and provision a cluster\n3. Generate an OpenShift Ansible inventory\n4. Generate ssh/config entries\n5. Run the OpenShift ansible playbooks\n6. Destroy the cluster\n\n## 1. Setup the environment\n\n```bash\nsource /usr/local/share/aws-cluster-up/examples/aws/us-east-1.bash\n```\n\nThis defines defaults for the subnet to use, the instance type to\nprovision, the region the instances should run in, et al.\n\nWe'll also need AWS credentials and OpenShift registry credentials set\nin the environment. If you don't already have AWS or OREG credentials\ndefined you can create and store them as follows:\n\n```bash\ncat \u003c\u003cEOF \u003e ~/.oreg-credentials\nexport OREG_AUTH_USER=abc\nexport OREG_AUTH_PASSWORD=def\nEOF\n\ncat \u003c\u003cEOF \u003e ~/.aws-credentials\nexport AWS_ACCESS_KEY_ID=abc\nexport AWS_SECRET_ACCESS_KEY=def\nEOF\n```\n\nNow source these into the current environment:\n\n```bash\nsource ~/.aws-credentials\nsource ~/.oreg-credentials\n```\n\nI have these files GPG encrypted so my usage is as follows:\n\n```bash\nsource \u003c(less ~/.aws-credentials.gpg)\nsource \u003c(less ~/.oreg-credentials.gpg)\n```\n\nAll these environment variables are substituted into the terraform\ndefinition and the OpenShift ansible inventory file.\n\n## 2. Generate and provision a cluster\n\n```bash\nacu-launch ~/amcdermo-triage /usr/local/share/aws-cluster-up/examples/aws/ocp-3.10/single-master.tf\n```\n\nThe `basename` of the output directory `~/amcdermo-triage` becomes the\nname of the cluster when viewed in the EC2 dashboard. In this example\nyou would have nodes named `acmdermo-triage-master`,\n`acmdermo-triage-infra` and `acmdermo-triage-node`.\n\n## 3. Generate an OpenShift Ansible inventory\n\n```bash\nacu-generate-inventory ~/amcdermo-triage /usr/local/share/aws-cluster-up/examples/aws/ocp-3.10/single-master.inventory \u003e ~/amcdermo-triage/ocp.ini\n```\n\n## 4. Generate ssh/config entries\n\n```bash\nmkdir -p $HOME/.ssh/aws-cluster-up/conf.d\nacu-generate-ssh-config ~/amcdermo-triage \u003e ~/.ssh/conf.d/aws-cluster-up/amcdermo-triage.conf\nchmod 600 ~/.ssh/conf.d/aws-cluster-up/amcdermo-triage.conf\n```\n\nYou will need the following `Include` directive at the beginning of\nyour `.ssh/config` for tab completion and for running the\nanisble-playbook:\n\n\tInclude conf.d/aws-cluster-up/*.conf\n\nVerify that tab completion works for the instances in your cluster:\n\n```bash\nssh amcdermo-triage-\u003cTAB\u003e\u003cTAB\u003e\n```\n\nThe generated ssh config entries should allow you to login without\nrequiring a password (assuming you have the correct key).\n\n## 5. Run the OpenShift ansible playbooks\n\n```bash\ngit clone https://github.com/openshift/openshift-ansible.git\ncd ~/openshift-ansible\ngit checkout openshift-ansible-3.10.0-0.53.0\n\nansible-playbook -i ~/amcdermo-triage/ocp.ini ~/openshift-ansible/playbooks/prerequisites.yml\nansible-playbook -i ~/amcdermo-triage/ocp.ini ~/openshift-ansible/playbooks/deploy_cluster.yml\n```\n\n## 6. Destroy the cluster\n\n```bash\nacu-destroy ~/amcdermo-triage\n```\n\nThis will automatically retag the instance names with `-terminate` so\nthey get garbage collected.\n\n# Creating custom definitions and inventories\n\nThe example terraform cluster definitions and inventory files are just\nexamples. You can copy these and modify them to support a different\nset of configurations.\n\n```bash\n#\n# Take copies\n#\ncp /usr/local/share/examples/aws/ocp-3.10/single-master.tf ~/autoscale-group.tf\ncp /usr/local/share/examples/aws/ocp-3.10/single-master.inventory ~/autoscale-group.inventory\n\n#\n# Make modifications, then launch based on the new configuration\n#\nacu-launch ~/amcdermo-ASG ~/autoscale-group.tf\n\n#\n# Make modificiations, then generate the inventory definition\n#\nacu-generate-inventory ~/amcdermo-ASG ~/autoscale-group.inventory\n\n#\n# Run ansible playbooks\n#\nansible-playbook -i ~/autoscale-group.inventory ~/openshift-ansible/playbooks/prerequisites.yml\nansible-playbook -i ~/autoscale-group.inventory ~/openshift-ansible/playbooks/deploy_cluster.yml\n```\n\nThe `acu-`scripts export pertinent information through environment\nvariables that all begin with `ACU_`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Faws-cluster-up","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrobware%2Faws-cluster-up","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrobware%2Faws-cluster-up/lists"}