Scaling Azure kubernetes clusters with Acs-engine

Source: Internet
Author: User

I. When deploying the Kubernetes cluster, we used Acs-engine to generate 3 JSON files and some certificate files, as follows:
    1. Apimodel.json-Cluster configuration file
    2. Azuredeploy.json-Core Arm (Azure Resource Model) template for deploying k8s clusters
    3. Azuredeploy.parameters.json-Deployment parameters file, where parameters can be customized
    4. Certificate and Access config Files-kubernetes some of the certificates that are required, and the Kube config profiles it relies on are also stored under the arm template sibling directory

It is important to note that when you modify an existing Docker container cluster, you should modify the Apimodel.json file to ensure that the latest deployment does not affect the resources that are already present in the cluster. For example, if the number of nodes in a container cluster is insufficient, you can modify the number of cluster nodes in the Apimodel.json, and then rerun the Acs-engine command and use Apimodel.json as the input parameter to generate a new arm template. After this deployment, the old nodes in the cluster will not change, and the new nodes will automatically join. Only node node expansion is currently supported.

Two. Modify the number of node nodes in the Apimodel.json and use the Apimodel.json file as the input file to generate a new template.
{  "apiversion": "Vlabs",  "location": "Chinaeast",  "Properties": {    "Orchestratorprofile": {      .....    },    "Masterprofile": {      "Count": 3,        },    "Agentpoolprofiles": [      {        "name": " Testagpool1 ",        " Count ": 4,    #修改node节点数量, expansion to 4 node nodes      }}

Three. Modify the newly generated Azuredeploy.json and Azuredeploy.parameters.json files to add offset information.

In the newly generated template file and in the parameter file, you need to modify and add the number of the node's offset, indicating the number of node nodes that existed before the expansion, so that the expansion does not modify the virtual machine that already has the offset number, and creates a new VM from the offset location.

If you find the following error in the expansion, it should be the number of offset not properly configured:

{"  error": {    "code": "Propertychangenotallowed",    "target": "CustomData",    "message": "Changing Property ' CustomData ' was not allowed. "}

Modify the offset number of node nodes in Azuredeploy.json, for example, if there are 2 node nodes before expansion, then offset is 2:

"Testagpool1offset": {      "allowedvalues": [        0,        ...        . "      DefaultValue": 2,      "metadata": {        "description": "The offset into the agent pool where to S Tart creating agents.  This value can is from 0 to a, but must is less than Agentcount "      },      " type ":" Int "    }

Add the node offset information to the Azuredeploy.parameters.json:

"Testagpool1offset": {   "value": 2}

Four. Remove the network interface associations in the network security group.

When deploying Kubernetes, Acs-engine built a network security group and associated the NIC for master and all node nodes. During the scaling process, the script removes all other ports in the network security group except for the default port 22/443, so you need to disassociate the NICs in the network security group before you perform the capacity expansion command, otherwise the service will not be accessible externally during the expansion process. If your service does not require external access, you can do so without doing so.

  

Five. Execute the capacity expansion instruction to realize node expansion.

Azure CLI2:

$ az Cloud set-n azurechinacloud$ az login$ az account set--subscription "<SUBSCRIPTIONNAME OR ID>"$ AZ Group Create--name"<Resource_group_name>"--location"< Location>"$ AZ Group Deployment Create--name"<DEPLOYMENTNAME>"--resource-group"<Resource_group_name>"--template-file"./_output/<INSTANCE>/azuredeploy.json "--parameters"./_output/<INSTANCE>/azuredeploy.parameters.json "

Using Acs-engine to expand an azure kubernetes cluster

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.