apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    sidecar.jaegertracing.io/inject: jaeger
  name: account-central
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: account-central
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: account-central
    spec:
      containers:
      - command:
        - account-central
        env:
        - name: TIINF_POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: CENTRAL_ROLE
          value: API_SERVICE
        - name: GCP_WORKLOAD_IDENTITY_AUDIENCE
          value: //iam.googleapis.com/projects/301623017899/locations/global/workloadIdentityPools/prod-dbaas/providers/prod-dbaas-eks-oidc
        - name: GCP_IMPERSONATE_SA
          value: prod-prod-central@dbaas-prod.iam.gserviceaccount.com
        - name: AWS_DEFAULT_REGION
          value: us-west-2
        - name: AWS_REGION
          value: us-west-2
        - name: ENABLE_TRACING
          value: "true"
        - name: SQS_QUEUE_URL
          value: https://sqs.us-west-2.amazonaws.com/380838443567/account
        image: 385595570414.dkr.ecr.us-west-2.amazonaws.com/dbaas/staging/account:0d50cc208ecfcc226eddb3b188d75987580f3e98
        imagePullPolicy: IfNotPresent
        name: account-central
        readinessProbe:
          failureThreshold: 10
          httpGet:
            path: /healthz
            port: 11000
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            cpu: 500m
            memory: 500Mi
          requests:
            cpu: 500m
            memory: 500Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /etc/dbaas
          name: dbaas-central-config
          readOnly: true
        - mountPath: /var/log/central
          name: dbaas-central-auditlog
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: central
      serviceAccountName: central
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: argo-account-central-conf
        name: dbaas-central-config
      - emptyDir: {}
        name: dbaas-central-auditlog


---

apiVersion: v1
kind: Service
metadata:
  name: account-central-http  # service name, can be accessed by this name in cluster
spec:
  selector:
    app: account-central
  ports:
    - name: http
      protocol: TCP
      port: 11000
      targetPort: 11000
  externalTrafficPolicy: Local
  type: NodePort
