{"id":25305844,"url":"https://github.com/lanimall/openshift-cluster-terraform","last_synced_at":"2026-01-21T01:01:57.917Z","repository":{"id":141795615,"uuid":"183250864","full_name":"lanimall/openshift-cluster-terraform","owner":"lanimall","description":"A terraform project to automatically create a complete 3-node OKD cluster (OKD = Open source openshift - https://www.okd.io/) on AWS leveraging standard Enterprise RHEL 7 images.","archived":false,"fork":false,"pushed_at":"2019-04-24T14:58:50.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T05:47:49.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lanimall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security_group.tf","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-24T14:54:53.000Z","updated_at":"2019-04-24T14:58:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a6c71ae-1152-43a1-8807-0fa838d7170c","html_url":"https://github.com/lanimall/openshift-cluster-terraform","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lanimall/openshift-cluster-terraform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanimall%2Fopenshift-cluster-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanimall%2Fopenshift-cluster-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanimall%2Fopenshift-cluster-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanimall%2Fopenshift-cluster-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanimall","download_url":"https://codeload.github.com/lanimall/openshift-cluster-terraform/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanimall%2Fopenshift-cluster-terraform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28620572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"ssl_error","status_checked_at":"2026-01-20T23:47:29.996Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-02-13T09:55:25.434Z","updated_at":"2026-01-21T01:01:57.865Z","avatar_url":"https://github.com/lanimall.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openshift-terraform\n\nA terraform project to automatically create a complete 3-node OKD cluster (OKD = Open source openshift - https://www.okd.io/) on AWS leveraging standard Enterprise RHEL 7 image.\n\nCredits: this project was heavily inspired from these 2 great projects (sort of merged them and modified them to fit my needs)\n - https://github.com/dwmkerr/terraform-aws-openshift\n - https://github.com/berndonline/openshift-terraform\n\n## Prerequisites\n\nYou need:\n\n1. [Terraform](https://www.terraform.io/intro/getting-started/install.html) - `brew update \u0026\u0026 brew install terraform`\n2. An AWS account, configured with the cli locally\n\n## Get the code and initial setup\n\n```\ngit clone -b aws-dev https://github.com/lanimall/openshift-terraform.git\ncd ./openshift-terraform/\nssh-keygen -b 2048 -t rsa -f ./helper_scripts/id_rsa_bastion -q -N \"\"\nssh-keygen -b 2048 -t rsa -f ./helper_scripts/id_rsa -q -N \"\"\nchmod 600 ./helper_scripts/id_rsa*\n```\n\n## Creating the Cluster\n\nCreate the infrastructure first:\n\n```bash\nterraform init \u0026\u0026 terraform apply -auto-approve \n```\n\nAfter a little while, all AWS infrastructure should have been created...you should see:\n\n```\n...\nApply complete! Resources: 14 added, 0 changed, 0 destroyed.\n```\n\nThat's it! The infrastructure is ready and you can install OpenShift. \nThere are some post-provisoning scripts that are running after the AWS nodes are up...so leave about five minutes for everything to start up fully.\n\nTo make sure the provisoning scripts are really finished...a simple check is to verify that ansible was installed properly on the bastion host:\n```\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ansible --version\"\n```\n\nWhich should poutput:\n```\nansible 2.6.5\n  config file = None\n  configured module search path = [u'/home/ec2-user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\n  ansible python module location = /usr/lib/python2.7/site-packages/ansible\n  executable location = /usr/bin/ansible\n  python version = 2.7.5 (default, Mar 26 2019, 22:13:06) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]\n```\n\nYou can also check the provisoning logs:\n```\nssh -A ec2-user@$(terraform output bastion-public_ip) \"tail -f /var/log/user-data.log\"\n```\n\nCouple of output variables that you can reference later using notation  'terraform output \u003coutput\u003e':\n - bastion-private_dns\n - bastion-private_ip\n - bastion-public_ip\n - master-private_dns\n - master-private_ip\n - master-private_route53_dns\n - master-public_ip\n - node1-private_dns\n - node1-private_ip\n - node1-private_route53_dns\n - node1-public_ip\n - node2-private_dns\n - node2-private_ip\n - node2-private_route53_dns\n - node2-public_ip\n\n## Installing OpenShift\n\nCopy the ssh key and ansible-hosts file to the bastion host from where you need to run the Ansible OpenShift playbooks.\n```\nssh-add ./helper_scripts/id_rsa_bastion \u0026\u0026\nssh-keyscan -t rsa -H $(terraform output bastion-public_ip) \u003e\u003e ~/.ssh/known_hosts \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output master-private_route53_dns)\u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output master-private_dns) \u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output master-private_ip) \u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output node1-private_route53_dns)\u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output node1-private_dns) \u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output node1-private_ip) \u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output node2-private_route53_dns)\u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output node2-private_dns) \u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nssh -A ec2-user@$(terraform output bastion-public_ip) \"ssh-keyscan -t rsa -H $(terraform output node2-private_ip) \u003e\u003e ~/.ssh/known_hosts\" \u0026\u0026 \\\nscp ./helper_scripts/id_rsa ec2-user@$(terraform output bastion-public_ip):~/.ssh/ \u0026\u0026 \\\nscp ./inventory.cfg ec2-user@$(terraform output bastion-public_ip):~ \u0026\u0026 \\\necho DONE!\n```\n\nThen, run the install script.\n```\ncat ./helper_scripts/install-from-bastion.sh | ssh -A ec2-user@$(terraform output bastion-public_ip)\n```\n\nNOTE: Bet patient...this will take 10s of minutes: ansible at work!!!\n\nIf all went well, you should see the following output at the end:\n\n```\n...\nINSTALLER STATUS ***************************************************************\nInitialization               : Complete (0:00:23)\nHealth Check                 : Complete (0:00:05)\nNode Bootstrap Preparation   : Complete (0:03:34)\netcd Install                 : Complete (0:00:45)\nMaster Install               : Complete (0:04:37)\nMaster Additional Install    : Complete (0:00:42)\nNode Join                    : Complete (0:00:46)\nHosted Install               : Complete (0:00:57)\nCluster Monitoring Operator  : Complete (0:01:18)\nWeb Console Install          : Complete (0:00:55)\nConsole Install              : Complete (0:00:22)\nMetrics Install              : Complete (0:02:08)\nmetrics-server Install       : Complete (0:00:50)\nService Catalog Install      : Complete (0:03:43)\n```\n\nFinally, when the ansible scripts are finished, run post install scripts:\n```\ncat ./helper_scripts/postinstall-master.sh | ssh -A ec2-user@$(terraform output bastion-public_ip) ssh master.openshift.local\ncat ./helper_scripts/postinstall-node.sh | ssh -A ec2-user@$(terraform output bastion-public_ip) ssh node1.openshift.local\ncat ./helper_scripts/postinstall-node.sh | ssh -A ec2-user@$(terraform output bastion-public_ip) ssh node2.openshift.local\n```\n\n\nIf the public DNS name you assigned to the openshift install is not in a public DNS, siomply add the public IP of the master node in your local host file...\n```\necho \"$(terraform output master-public_ip) console.awspaas.clouddemo.saggov.com\" \u003e\u003e /etc/hosts\n```\n\nThen, should be able to login to openshift CLI or web console) with our sample cluster-admin test user.\n```\noc login -u admin -p test123! https://console.awspaas.clouddemo.saggov.com:8443\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanimall%2Fopenshift-cluster-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanimall%2Fopenshift-cluster-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanimall%2Fopenshift-cluster-terraform/lists"}