Do the following in the CloudStack Management Server to get setup.
- Create an Account with role DomainAdmin on the appropriate Domain. Set the credentials and other settings as desired.
- Login to the Domain you would like to work in, with the Account.
- When logging in, specify the post-ROOT path for the Domain. EG:
/ROOT/parent/childwould beparent/child
- When logging in, specify the post-ROOT path for the Domain. EG:
- Create a Project and note its
nameas thevar.cloudstack_projectvariable value. - Navigate to your Profile in the top right.
- If you don't already have API Keys, click the 3rd button in from the left,
Generate New API/Secret Keys - Copy the
API Keyintovar.cloudstack_api_key. - Copy the
Secret Keyintovar.cloudstack_secret_key. - Navigate to Zones and copy the desired
nameintovar.cloudstack_zone. - In the terraform variables, also set;
var.vm_username
You should now be ready to start running Terraform.
# make sure you have terraform configured correctly
terraform init
# plan and apply. you can review the plan before typing 'yes'
terraform plan && terraform applyReview the different templates/*_config.tpl files to review the packages and configurations installed.
Right now, each of the files are the same, however, they are broken out into different files so the configurations can diverge as applications get installed.
There are two key reasons why this happens.
Usually the error will be: Network is unreachable
- The VM has started, but the cloudinit / cloud-config has't finished executing, so SSH isn't ready yet. This is impacted by the
package_upgrade: trueat the top of thetemplate/*.tplfiles. - Terraform is setting up the networking and public IPs too quickly, so the public IP didn't get setup correctly. You need to restart the VPC with
Clean Upenabled. This will force the VR to set the configuration sequentially and fix the broken VR config.
# Connect to the jump server
ssh -i ./terraform.tfstate.d/default/id_rsa ${var.vm_username}@${cloudstack_ipaddress.jump_public_ip.ip_address}
# Run ansible to deploy the software on each machine
ansible-playbook site-k3s.yml -i inventory.ini 