This repo helps to automate the deployment of Cloudbreak Deployer. We use Google deployment manager to create a vm with the necessary resources that starts a Cloudbreak deployment by the startup script. The only dependency that needs to be installed on your machine is the Google cloud SDK. The SDK contains the gcloud CLI tool which is the main pillar of our deployer examples. The virtual machines always started from the latest Centos 7 image that is available under the centos-cloud image repository.
- Google cloud SDK
- The
Compute Engine API
and theCloud Runtime Configuration API
services need to be enabled under the navigation menuAPIs & Services
subitem. Click on "ENABLE APIS AND SERVICES" then type the service names in the filter and enable it. - A service account is needed that has read and write permissions to
Compute Image
,Compute Instance
,Compute Network
,Compute Security
andCloud RuntimeConfig
. This service account email needs to specified in the config.yaml or in the gcloud command explicitly as a property.
region: us-central1
zone: us-central1-a
instance_type: n1-standard-4
ssh_pub_key: "You need to set the SSH_KEY environment variable"
os_user: cloudbreak
user_email: admin@example.com
user_password: cloudbreak
service_account_email: You need to set the GCP_ACCOUNT_EMAIL environment variable
gcloud deployment-manager deployments create cbd-deployment --config=vm_template_config.yaml
gcloud deployment-manager deployments delete cbd-deployment -q
With the gcloud
command-line tool, you can pass in the template file directly and provide the values for your template properties explicitly on the command-line. But in this case you should specify all of the properties that is required by our template schema. We have generated a default one, but please review and customize the previously mentioned key-value pairs, especially the ssh_pub_key
one:
gcloud deployment-manager deployments create cbd-deployment \
--template=vm-template.jinja \
--properties region:us-central1,zone:us-central1-a,instance_type:n1-standard-4,os_user:cloudbreak,user_email:admin@example.com,user_password:'cloudbreak',cbd_version:2.9.2,startup-script:'https://raw.githubusercontent.com/hortonworks/cbd-quickstart/2.9.2/install-and-start-cbd.sh',source_image:centos-7-v20190619,ssh_pub_key:'...',service_account_email:'...'
We are using the CentOS images from the
centos-cloud
global image repository.
make list-latest-images
make echo_version
The version of the image in the generated template is configured as an environment variable in the Makefile. To update only the variable needs to be overridden with the name of the desired centos-cloud
image in the Makefile.
export CENTOS_CLOUD_IMAGE_NAME=centos-7-v20190619
After updating the image version the templates needs to be regenerated by running the make build
command to get the ARM template with the updated image version.
https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/centos-7-v20190619