Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Support EC2 instance tags per node role #1027

Merged
merged 2 commits into from
Nov 27, 2017

Commits on Nov 22, 2017

  1. Configuration menu
    Copy the full SHA
    c50d38f View commit details
    Browse the repository at this point in the history
  2. Support EC2 instance tags per node role

    This feature will be handy when e.g. your monitoring tools discovers EC2 instances and then groups resource metrics with EC2 instance tags.
    
    Changes:
    - Add support for stackTags to SpotFleet-based node pool
    - Add a new configuration key `instanceTags` to cluster.yaml per `worker.nodePools[]`, `controller` and `etcd`.
    
    I recomment to use `stackTags` for adding cluster-wide metadata to all the resources managed by Cfn, whereas `instanceTags` are by definition used for node-group-wide metadata to EC2 instances(node pool name, node role, and anything configurable per node pool for example).
    
    A typical cluster.yaml using both `stackTags` and `instanceTags` would look like:
    
    ```yaml
    worker:
      nodePools:
      - name: pool1
         instanceTags:
           myrole: worker
           type: ondemand
         # Propagated to (hopefully, it's up to cfn) all the stack resources for the pool1 stack
         stackTags:
           env: prod
      - name: pool2
         spotFleet:
           targetCapacity: 2
         # Propagated to EC2 instances managed by this spot fleet (via tag-spot-instance.service)
         instanceTags:
           myrole: worker
           type: spot
         # Propagated to (hopefully, it's up to cfn) all the stack resources for the pool2 stack
         stackTags:
           env: prod
    
    controller:
      instanceTags:
        myrole: controller
        type: ondemand
      # invalid as controller nodes don't have a dedicated cfn stack
      # stackTags:
    
    etcd:
      instanceTags:
        myrole: etcd
        type: ondemand
      # invalid as etcd nodes don't have a dedicated cfn stack
      # stackTags:
    
    stackTags:
      env: prod
    ```
    
    Resolves kubernetes-retired#1026
    mumoshu committed Nov 22, 2017
    Configuration menu
    Copy the full SHA
    12e30ec View commit details
    Browse the repository at this point in the history