apiVersion: v1
data:
  boundaries: |
    shared:
      mergeOverride:
      - spec.eks.configuration.tags
      merge:
      - spec.strategy
      - spec.eks.configuration.securityGroups
      - spec.eks.configuration.labels
      - spec.eks.configuration.volumes
    restricted:
    - spec.provisioner
    - spec.eks.configuration.clusterName
    - spec.eks.configuration.image
    - spec.eks.configuration.roleName
    - spec.eks.configuration.instanceProfileName
    - spec.eks.configuration.keyPairName
    - spec.eks.configuration.subnets
    - spec.eks.configuration.taints
  defaults: |
    spec:
      provisioner: eks
      strategy:
        type: crd
        crd:
          crdName: rollingupgrades
          statusJSONPath: .status.currentStatus
          statusSuccessString: completed
          statusFailureString: error
          spec: |
            apiVersion: upgrademgr.keikoproj.io/v1alpha1
            kind: RollingUpgrade
            metadata:
              name: rollup-nodes
              namespace: instance-manager
            spec:
              postDrainDelaySeconds: 30
              nodeIntervalSeconds: 180
              asgName: {{`{{ .InstanceGroup.Status.ActiveScalingGroupName }}`}}
      eks:
        configuration:
          clusterName: {{ .ClusterName }}
          subnets: {{range $element := .Subnets}}
            - {{$element}}
          {{ end }}
          keyPairName: {{ .KeyPairName }}
          image: {{ .AmiID }}
          labels:
            a-default-label: "true"
          taints:
          - key: default-taint
            value: a-taint
            effect: NoSchedule
          volumes:
          - size: 30
            type: gp2
            name: /dev/xvda
          roleName: {{ .NodeRole }}
          instanceProfileName: {{ .NodeRole }}
          tags:
          - key: a-default-tag
            value: some-default-value
          securityGroups: {{range $element := .NodeSecurityGroups}}
            - {{$element}}
          {{ end }}

kind: ConfigMap
metadata:
  name: instance-manager
  namespace: instance-manager