apiVersion: apps/v1
kind: Deployment
metadata:
  name: ng-autoscaler
  labels:
    app: ng-autoscaler
spec:
  strategy:
   type: RollingUpdate
   rollingUpdate:
     maxSurge: 1
     maxUnavailable: 0
  revisionHistoryLimit: 2
  replicas: 1
  selector:
    matchLabels:
      app: ng-autoscaler
  template:
    metadata:
      labels:
        app: ng-autoscaler
    spec:
      serviceAccountName: central  # default
      containers:
        - name: autoscaler
          image: 385595570414.dkr.ecr.us-west-2.amazonaws.com/tidbcloud/ng-autoscaler:main-4d5410fb0eb2c731631cc69394e61b4a8b57eb69
          ports:
          - containerPort: 8080
            protocol: TCP
            name: http
          - containerPort: 9100
            protocol: TCP
            name: metrics
          env:
          - name: AUTH0_CLIENT_ID
            valueFrom:
              secretKeyRef:
                name: o11y-proxy-client
                key: auth0ClientId
          - name: AUTH0_CLIENT_SECRET
            valueFrom:
              secretKeyRef:
                name: o11y-proxy-client
                key: auth0ClientSecret
          volumeMounts:
          - mountPath: /etc/ng_autoscaler
            name: config
            readOnly: true
          resources:
            limits:
              cpu: 1
              memory: 500Mi
            requests:
              cpu: 500m
              memory: 200Mi
      volumes:
      - name: config
        configMap:
          name: ng-autoscaler-config
