Skip to content

Cloud-Init files to setup a Docker Swarm cluster in Microsoft Azure

License

Notifications You must be signed in to change notification settings

AzSwarm/Cloud-Init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cloud-Init

Cloud-Init files to setup a Docker Swarm cluster in Microsoft Azure.

Requirements

In order to use the cloud-init files you will need to do the following:

  • Create an Azure Resource Group
  • Create an Azure Key Vault
  • Create an Azure User-assigned Managed Identity
  • Setup the Azure Key Vault Access Policy and give "Secret Permissions" to the User-assigned Identity

The Key Vault is used to store the Docker Swarm Join token for the managers and workers using the User-Assigned Managed Identity.

To understand how to assign this permission please check the following Microsoft document Link

How it Works?

During the first boot the cloud-init files will do the following:

  • Add Docker repository
  • Add and Install PowerShell.
  • Add and Install Azure CLI.
  • Initialize Docker Swarm Manager and use an Azure User-assigned Identity to authenticate to Azure and save the Swarm Manager/Worker token inside the Azure Key Vault.
  • Adding Docker Swarm Manger/Worker and use an Azure User-assigned Identity to authenticate to Azure and get the Swarm Manager/Worker token inside the Azure Key Vaul to join the VM to the cluster.

Deploy Docker Swarm Manager.

In order to deploy a Docker Swarm Manager please select the cloud-init-manager.yml file for your distribution and replace the following values:

Key
subscriptionId
resourceGroupName
userAssignedIdentityName
keyVaultName

After replacing the values you can create a new VM using Azure CLI and include the cloud-init-manager.yml file.

Please check this Microsoft document for an example Link.

Adding a Docker Swarm Manager.

In order to add a Docker Swarm Manager please select the cloud-init-add-manager.yml file for your distribution and replace the following values:

Key
subscriptionId
resourceGroupName
userAssignedIdentityName
keyVaultName
swarmManagerIp

After replacing the values you can create a new VM using Azure CLI and include the cloud-init-add-manager.yml file.

Please check this Microsoft document for an example Link.

Adding a Docker Swarm Worker.

In order to add a Docker Swarm Worker please select the cloud-init-add-worker.yml file for your distribution and replace the following values:

Key
subscriptionId
resourceGroupName
userAssignedIdentityName
keyVaultName
swarmManagerIp

After replacing the values you can create a new VM using Azure CLI and include the cloud-init-add-worker.yml file.

Please check this Microsoft document for an example Link.

About

Cloud-Init files to setup a Docker Swarm cluster in Microsoft Azure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published