.... Still in development...
This script allow you to deploy an OpenShift Enterprise v3.7.0 in best practices on Microsoft Azure.
I used this 3 projects to create this one :
- Simple install of OCP 3.7 on Azure from Magnus Glantz
- Deploy OpenShift Origin on Azure using Terraform and Ansible from Sertac Ozercan
- OpenShift Origin Deployment Template
WARNING: Be sure that you are not overriding existing Azure resources that are in use. This Terraform process will create a resource group to contain all dependent resources within. This makes it easy to cleanup.
-
It is assumed that you have a functioning Azure client installed. You can do so here
-
Install Terraform and create credentials for Terraform to access Azure. To do so, you will need to following environment variables :
- ARM_SUBSCRIPTION_ID=
- ARM_CLIENT_ID=
- ARM_CLIENT_SECRET=
- ARM_TENANT_ID=
-
You can also fill the following values in the tfvars file if you prefer.
-
The values for the above environment variables can be obtained through the Azure CLI.
Click here to get the step by step about it
-
First rename the
terraform.tfvars.example
toterraform.tfvars
and review the default configuration. Most common options are available inside. The full list of available options are invariables.tf
. -
Update
terraform.tfvars
with the path to your passwordless SSH public and private keys. (ssh_public_key and connection_private_ssh_key_path) -
Change
openshift_cluster_prefix
to something unique -
Optionally, customize the
master_instance_count
(default 1), thenode_instance_count
(default 1) andinfra_instance_count
for master (default 1), the bastion host size is Standard_D2_v2 and for the others VM is Standard_DS11_v2_Promo per default, but you can change it for your need. -
Create the OpenShift cluster by executing:
$ EXPORT ARM_SUBSCRIPTION_ID=<your subscription id>
$ EXPORT ARM_CLIENT_ID=<your client id>
$ EXPORT ARM_CLIENT_SECRET=<your cient secret>
$ EXPORT ARM_TENANT_ID=<your tenant id>
$ cd <repo> && terraform apply
After your deployment your should be able to reach the OS console
https://<masterFQDN>.<location>.cloudapp.azure.com:8443/console
The cluster will use self-signed certificates. Accept the warning and proceed to the login page.
To restart and cleanup the Azure assets run the following commands from the directory
$ az group delete <yourResourceGroup>
info: Executing command group delete
Delete resource group <yourResourceGroup>? [y/n] y
+ Deleting resource group <yourResourceGroup>
info: group delete command OK
$ cd <repo> && rm *terraform.tfstate
If the deployment gets in an inconsistent state (repeated terraform apply
commands fail, or output references to leases that no longer exist), you may need to manually reconcile. Destroy the <yourResourceGroup>
resource group, run terraform remote config -disable
and delete all terraform.tfstate*
files from os
, follow the above instructions again.
You can execute in 2 steps :
$ terraform plan -out=out.tfplan
$ terraform apply "out.tfplan"
During the OCP installation you can check from the bastion host the content of /var/lib/waagent/custom-script/download/0 directory and the 2 files stdout and stderr.