NOTE: The steps listed here were contributed by a community member, and is not officially supported. Please use at your own risk.
The steps listed on this page describe a way to modify a running Kubernetes cluster deployed with aks-engine on Azure. These steps are only tested with changes targeting actually Azure resources. Changes made to Kubernetes configuration are not tested yet.
These are the common steps (unless described otherwise) you'll have to run after modifying an existing apimodel.json file.
-
Modify the apimodel.json file located in the
_output/<clustername>folder -
Run
aks-engine generate --api-model _output/<clustername>/apimodel.json. This wil update theazuredeploy*files needed for the new ARM deployment. These files are also located in the_outputfolder. -
Apply the changes by manually starting an ARM deployment. From within the
_output/<clustername>runaz group deployment create --template-file azuredeploy.json --parameters azuredeploy.parameters.json --resource-group "<my-resource-group>"To use the
azCLI tools you have to login. More info can be found here: https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli?view=azure-cli-latest_Note: I use
az group deploymentinstead ofaks-engine deploybecause the latter seems to assume you are deploying a new cluster and as a result overwriting you private ssh keys located in the ouput folder -
Grab a coffee
-
Profit!
Add (or copy) an entry in the agentPoolProfiles array.
- Delete the related entry from
agentPoolProfilessection in the_output/<clustername>/api-model.jsonfile - Drain nodes from inside Kubernetes
generateanddeploy(see above)- Delete VM's and related resources (disk, NIC, availability set) from Azure portal
- Remove the pool from the original
apimodel.jsonfile
Use the aks-engine scale command
aks-engine scale --location westeurope --subscription-id "xxx" --resource-group "<my-resource-group" \
--api-model ./somedir/apimodel.json --node-pool <nodepool name> --new-node-count <desired number of nodes> --apiserver <apiserver endpoint FQDN or IP address>
Remember to also update your original api-model.json file (used for 1st deployment) or else you would end up with the original number of VM's after using the generate command described above
- Modify the
vmSizein theagentPoolProfilessection generateanddeploy(see above)
Important: The default ARM deployment won't drain your Kubernetes nodes properly before 'rebooting' them. Please drain them manually before deploying the change