Migrating from single to multi-master

    Start out by deciding which availability zones you want to deploy the masters to. You can only have one master per availability zone.

    Then you need to add new subnets for your availability zones. Which subnets you need to add depend on which topology you have chosen. Simplest is to copy the sections you already have. Make sure that you add additional subnets per type. E.g if you have a and a utility subnet, you need to copy both.

    Change the subnet section to look something like this:

    1. - cidr: 172.20.32.0/19
    2. name: eu-west-1a
    3. type: Private
    4. zone: eu-west-1a
    5. - cidr: 172.20.64.0/19
    6. name: eu-west-1b
    7. type: Private
    8. zone: eu-west-1b
    9. name: eu-west-1c
    10. type: Private
    11. - cidr: 172.20.0.0/22
    12. name: utility-eu-west-1a
    13. type: Utility
    14. zone: eu-west-1a
    15. - cidr: 172.20.4.0/22
    16. name: utility-eu-west-1b
    17. type: Utility
    18. zone: eu-west-1b
    19. - cidr: 172.20.8.0/22
    20. name: utility-eu-west-1c
    21. zone: eu-west-1c

    Example:

    This command will bring up an editor with the default values. Ensure that:

    • maxSize and minSize is 1
    • only one zone is listed
    • you have the correct image and machine type

    Bring up mycluster.yaml again to add etcd members to each of new masters.

    1. $EDITOR mycluster.yaml
    • In .spec.etcdClusters add 2 new members in each cluster, one for each new availability zone.
    1. - instanceGroup: master-<availability-zone2>
    2. name: <availability-zone2-name>
    3. - instanceGroup: master-<availability-zone3>
    4. name: <availability-zone3-name>

    Update the cluster spec and apply the config by running the following:

    1. kops replace -f mycluster.yaml
    2. kops update cluster example.com

    This will launch the two new masters. You will also need to roll the old master so that it can join the new etcd cluster.

    After about 5 minutes all three masters should have found each other. Run the following to ensure everything is running as expected.