Currently the Azure Container Service is not available in one of the regions of Azure Germany, that supports you creating an Kubernetes cluster in an easy way.
But do not be afraid. There is a handy tool called the Azure Container Service Engine or short acs-engine available on GitHub to generate the necessary ARM templates for you.
-> https://github.com/Azure/acs-engine
To start with acs-engine, just download the necessary bits for your OS.
-> https://github.com/Azure/acs-engine/releases/latest
In this blog post I am focusing on acs-engine version 0.8.0 for Windows.
Before we are starting with the generation of our ARM templates for the Kubernetes cluster, we will need three things first.
- SSH key
- Azure AD Service Principal
- Kubernetes cluster definition
Generating a SSH key is pretty easy and can be done by following the Azure documentation.
-> https://docs.microsoft.com/en-us/azure/virtual-machines/linux/mac-create-ssh-keys
The next step is to create the necessary Azure AD Service Principal and assign the account with Contributor permissions to the resource group you would like to deploy the Kubernetes cluster in.
Last action item, before we can generate the ARM templates, is to download the standard Kubernetes cluster definition file and modifying it.
-> https://github.com/Azure/acs-engine/blob/master/examples/kubernetes.json
Before we modifying the settings, it is very important to add the location section! Otherwise your Kubernetes cluster will not come up, because the Kubernetes cluster config files will not be generated correctly to leverage Azure Germany. For the location section specify either germanycentral or germanynortheast for the Azure Germany region you prefer.
Then we can start with the modification of the masterProfile, agentPoolProfiles, linuxProfile and servicePrincipalProfile sections.
As an example, have a look at the following Kubernetes cluster definition.
{ "apiVersion": "vlabs", "location": "germanycentral", "properties": { "orchestratorProfile": { "orchestratorType": "Kubernetes" }, "masterProfile": { "count": 1, "dnsPrefix": "kubernetesmaster", "vmSize": "Standard_D2_v2" }, "agentPoolProfiles": [ { "name": "agentpool1", "count": 3, "vmSize": "Standard_D2_v2", "availabilityProfile": "AvailabilitySet" } ], "linuxProfile": { "adminUsername": "azureuser", "ssh": { "publicKeys": [ { "keyData": "Enter you SSH key" } ] } }, "servicePrincipalProfile": { "clientId": "Enter AAD Service Principal Application ID", "secret": "Enter AAD Service Principal Secret" } } }
Copy the Kubernetes cluster definition file kubernetes.json into the acs-engine folder and open a command line or PowerShell window.
Use the following command in the open command line or PowerShell window to generate the ARM templates.
.\acs-engine.exe generate .\kubernetes.json
The command places the ARM templates in the folder _output, if you have not specify any output folder.
Jump into the output folder and kick off the deployment with PowerShell or Azure CLI. See the following PowerShell command for starting the deployment after you successfully logged in to Azure via the Login-AzureRmAccount cmdlet.
New-AzureRmResourceGroupDeployment -ResourceGroupName azurecontainerservice -TemplateParameterFile .\azuredeploy.parameters.json -TemplateFile .\azuredeploy.json -Verbose
The example deployment we are using here needs round about 10 minutes for a successful deployment.
As you can see the Kubernetes cluster is up and running in Azure Germany and ready to use.
Finally, use the following guide to get started with your newly deployed Kubernetes cluster on Azure Germany.
-> https://github.com/Azure/acs-engine/blob/master/docs/kubernetes/walkthrough.md