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_output
folder. -
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
az
CLI 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 deployment
instead ofaks-engine deploy
because 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
agentPoolProfiles
section in the_output/<clustername>/api-model.json
file - Drain nodes from inside Kubernetes
generate
anddeploy
(see above)- Delete VM's and related resources (disk, NIC, availability set) from Azure portal
- Remove the pool from the original
apimodel.json
file
Use the aks-engine scale
command
aks-engine scale --location westeurope --subscription-id "xxx" --resource-group "<my-resource-group" \
--deployment-dir ./_output/<clustername> --node-pool <nodepool name> --new-node-count <desired number of nodes> --master-FQDN <fqdn of the master lb>
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
vmSize
in theagentPoolProfiles
section generate
anddeploy
(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