Autoscaling VM groups

Add a virtual machine to the mesh details how to add a VM manually to the mesh. However, Service Mesh Manager also allows for automated addition as part of any autoscaling activity, such as relying on AWS’s AutoScaling Groups or Google Cloud’s Managed Instance Groups.

One way to achieve mesh membership is by just adding the commands mentioned in Add a virtual machine to the mesh to the init/cloud-init script of the VM to start at boot time. However, if the VM image is custom built using packer or any other solution, you can embed an already configured smm-agent into the image.

Prerequisites

Build a VM image for automatic Istio attachment

During the build process of the virtual machine image, execute the following commands as the root user. Replace the parameters between brackets with suitable values for your environment (replace <token> with the actual token, not the filename).

curl http://<dashboard-url>/get/smm-agent | bash
smm-agent set workload-group <namespace> <workloadgroup-name>
smm-agent set bearer-token <token>
systemctl enable smm-agent

This is a subset of the steps required by the manual registration. These steps ensure that:

  • smm-agent is installed on the VM image
  • smm-agent is configured to be able to connect to the mesh
  • smm-agent is scheduled to be started on the next startup (systemctl enable smm-agent)

When a new instance of this VM image starts, smm-agent contacts the Kubernetes cluster running in the mesh, downloads the current version of Istio, and starts it as soon as it’s fully configured.

This approach ensures that newly started VMs run the right version of Istio.