KloudMate Agents
Installation
Infrastructure as a Code (IaaC) Installation
7 min
infrastructure as a code (iaac) installation deploy the kloudmate agent across any cloud provider or on premises infrastructure using infrastructure as a code (iaac) and automation tools deployment approaches method best for cloud support cloud init new vms, asgs, scale sets all providers ansible existing vm fleets all providers + on prem terraform module iaac managed infrastructure all providers packer pre baked machine images aws, gcp, azure decision matrix if you are provisioning a new vm or auto scaling group, you should use cloud init via user data/custom data if you want faster boot times, use packer to pre bake the image and cloud init for config only if you are managing an existing fleet, use an ansible playbook if you are managing infrastructure with terraform , use the terraform module 1\ cloud init (universal) works on every provider that supports cloud init (aws, gcp, azure, digitalocean, alibaba, hetzner, vultr, linode, etc ) aws # encode and attach to launch template base64 w0 cloud init/cloud init yaml > /tmp/userdata b64 aws ec2 create launch template \\ \ launch template name kmagent template \\ \ launch template data '{ "userdata" "'$(cat /tmp/userdata b64)'" }' gcp gcloud compute instance templates create kmagent template \\ \ metadata from file user data=cloud init/cloud init yaml \\ \ machine type e2 medium \\ \ image family ubuntu 2204 lts \\ \ image project ubuntu os cloud azure az vmss create \\ \ name kmagent vmss \\ \ resource group myresourcegroup \\ \ image ubuntu2204 \\ \ custom data cloud init/cloud init yaml digitalocean doctl compute droplet create kmagent node \\ \ image ubuntu 22 04 x64 \\ \ size s 1vcpu 1gb \\ \ user data file cloud init/cloud init yaml alibaba cloud paste cloud init yaml content into ecs console → instance → advanced options → user data 2\ ansible ansible is perfect for deploying the kloudmate agent to existing vm fleets navigate to the ansible directory cd ansible/ set your api key export km api key="your kloudmate api key" edit your inventory add your hosts to the inventory file vim inventories/production ini deploy ansible playbook i inventories/production ini deploy kmagent yml \\ e "km api key=$km api key km endpoint=https //otel kloudmate com" dynamic inventory (auto discover vms) instead of static inventory files, use cloud native dynamic inventory plugins aws # encode and attach to launch template base64 w0 cloud init/cloud init yaml > /tmp/userdata b64 aws ec2 create launch template \\ \ launch template name kmagent template \\ \ launch template data '{ "userdata" "'$(cat /tmp/userdata b64)'" }' gcp gcloud compute instance templates create kmagent template \\ \ metadata from file user data=cloud init/cloud init yaml \\ \ machine type e2 medium \\ \ image family ubuntu 2204 lts \\ \ image project ubuntu os cloud azure az vmss create \\ \ name kmagent vmss \\ \ resource group myresourcegroup \\ \ image ubuntu2204 \\ \ custom data cloud init/cloud init yaml