---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: cluster-autoscaler
  namespace: kube-system
  labels:
    app: cluster-autoscaler
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cluster-autoscaler
  template:
    metadata:
      namespace: kube-system
      labels:
        app: cluster-autoscaler
    spec:
      serviceAccountName: cluster-autoscaler-account
      containers:
        - name: cluster-autoscaler
          image: swr.cn-north-4.myhuaweicloud.com/{Organization name}/cluster-autoscaler:dev
          imagePullPolicy: Always
          command:
            - ./cluster-autoscaler
            - --alsologtostderr
            - --cloud-config=/config/cloud-config
            - --cloud-provider=huaweicloud
            - --nodes=1:50:crc-nodepool
            - --scale-down-delay-after-add=1m0s
            - --scale-down-unneeded-time=1m0s
            - --expander=random
          volumeMounts:
            - name: cloud-config
              mountPath: /config
              readOnly: true
      volumes:
        - name: cloud-config
          secret:
            secretName: cluster-autoscaler-cloud-config
