apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: cluster-autoscaler
  namespace: kube-system
  labels:
    k8s-app: cluster-autoscaler
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: cluster-autoscaler
  template:
    metadata:
      labels:
        k8s-app: cluster-autoscaler
      annotations:
        scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated", "value":"master"}]'
    spec:
        containers:
          - name: cluster-autoscaler
            image: {{IMAGE}}
            resources:
              limits:
                cpu: 100m
                memory: 300Mi
              requests:
                cpu: 100m
                memory: 300Mi
            command:
              - ./cluster-autoscaler
              - --cloud-provider={{CLOUD_PROVIDER}}
              - --nodes={{MIN_NODES}}:{{MAX_NODES}}:{{GROUP_NAME}}
            env:
              - name: AWS_REGION
                value: {{AWS_REGION}}
            volumeMounts:
              - name: ssl-certs
                mountPath: {{SSL_CERT_PATH}}
                readOnly: true
        volumes:
          - name: ssl-certs
            hostPath:
              path: {{SSL_CERT_PATH}}
        nodeSelector:
          kubernetes.io/role: master

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: cluster-autoscaler
  namespace: kube-system
  labels:
    k8s-app: cluster-autoscaler
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: cluster-autoscaler
  template:
    metadata:
      labels:
        k8s-app: cluster-autoscaler
      annotations:
         # For 1.6, we keep the old tolerations in case of a downgrade to 1.5
        scheduler.alpha.kubernetes.io/tolerations: '[{"key":"dedicated", "value":"master"}]'
    spec:
        containers:
          - name: cluster-autoscaler
            image: {{IMAGE}}
            resources:
              limits:
                cpu: 100m
                memory: 300Mi
              requests:
                cpu: 100m
                memory: 300Mi
            command:
              - ./cluster-autoscaler
              - --cloud-provider={{CLOUD_PROVIDER}}
              - --nodes={{MIN_NODES}}:{{MAX_NODES}}:{{GROUP_NAME}}
            env:
              - name: AWS_REGION
                value: {{AWS_REGION}}
            volumeMounts:
              - name: ssl-certs
                mountPath: {{SSL_CERT_PATH}}
                readOnly: true
        volumes:
          - name: ssl-certs
            hostPath:
              path: {{SSL_CERT_PATH}}
        nodeSelector:
          node-role.kubernetes.io/master: ""
        tolerations:
          - key: "node-role.kubernetes.io/master"
            effect: NoSchedule

Set tolerations on cluster-autoscaler.yaml as field for Kubernetes 1.6 support
Set tolerations on cluster-autoscaler.yaml as field for Kubernetes 1.6 support
