This script allow you to deploy an OpenShift Origin v3.6.0 in best practices on Microsoft Azure.
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.
NOTE: This deployment is not meant to obviate the need to understand the install process or read the docs. Please spend some time to understand both OpenShift and the install process.
-
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 prefeer.
-
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 inconfig.tf
. CentOS is the default as it has pre-requirements built in. -
Update
terraform.tfvars
with the path to your passwordless SSH public and private keys. (openshift_azure_public_key and openshift_azure_private_key) -
Change
openshift_azure_resource_prefix
(and optionallyopenshift_azure_resource_suffix
) to something unique -
Optionally, customize the
openshift_azure_master_vm_count
(default 1), theopenshift_azure_node_vm_count
(default 1) andopenshift_azure_infra_vm_count
for master (default 1), the agents size is Standard_D2_V2 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.
- If you didn't change it, the default username/password is
ocpadmin/password123
.
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 could also check this repo : Microsoft/openshift-origin to get more informations