apiVersion: apps/v1
kind: Deployment
metadata:
  name: gateway-controller
  labels:
    control-plane: gateway-controller
spec:
  selector:
    matchLabels:
      control-plane: gateway-controller
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: gateway-controller
    spec:
      securityContext:
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      containers:
      - command:
        - /gateway-controller
        args:
          - --leader-elect
          - --health-probe-bind-address=:8081
        image: tidbcloud-registry.ap-southeast-1.cr.aliyuncs.com/dbaas/aws-shared-provider-gateway-controller:9f50b77c0384dee42db51295f3250d0908f0efba
        name: gateway-controller
        env:
        - name: O11Y_GLOBAL_READ_URL
          valueFrom:
            configMapKeyRef:
              name: o11y-config
              key: global.readRemote
        ports: []
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - "ALL"
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8081
          initialDelaySeconds: 15
          periodSeconds: 20
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8081
          initialDelaySeconds: 5
          periodSeconds: 10
        resources:
          limits:
            cpu: "1"
            memory: 2Gi
          requests:
            cpu: "1"
            memory: 2Gi
        volumeMounts:
          - name: gateway-controller-config
            mountPath: /etc/gateway-controller
            readOnly: true
      volumes:
        - name: gateway-controller-config
          configMap:
            name: gateway-controller-config
      serviceAccountName: gateway-controller
      terminationGracePeriodSeconds: 10
