apiVersion: apps/v1
kind: Deployment
metadata:
  name: easyai-acceptance-emulator
  namespace: easyai
  labels:
    app.kubernetes.io/name: easyai-acceptance-emulator
    app.kubernetes.io/part-of: easyai-ai-gateway
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: easyai-acceptance-emulator
  template:
    metadata:
      labels:
        app.kubernetes.io/name: easyai-acceptance-emulator
        app.kubernetes.io/part-of: easyai-ai-gateway
    spec:
      nodeSelector:
        easyai.io/site: ningbo
        easyai.io/workload: "true"
      securityContext:
        runAsNonRoot: true
        runAsUser: 10001
        runAsGroup: 10001
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: emulator
          image: easyai-api
          command: ["/app/easyai-ai-gateway-acceptance-emulator"]
          env:
            - name: HTTP_ADDR
              value: ":8090"
          ports:
            - name: http
              containerPort: 8090
          readinessProbe:
            httpGet:
              path: /healthz
              port: http
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: "2"
              memory: 1Gi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop: ["ALL"]
            readOnlyRootFilesystem: true
---
apiVersion: v1
kind: Service
metadata:
  name: easyai-acceptance-emulator
  namespace: easyai
spec:
  selector:
    app.kubernetes.io/name: easyai-acceptance-emulator
  ports:
    - name: http
      port: 8090
      targetPort: http
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: easyai-acceptance-callback-collector
  namespace: easyai
  labels:
    app.kubernetes.io/name: easyai-acceptance-callback-collector
    app.kubernetes.io/part-of: easyai-ai-gateway
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: easyai-acceptance-callback-collector
  template:
    metadata:
      labels:
        app.kubernetes.io/name: easyai-acceptance-callback-collector
        app.kubernetes.io/part-of: easyai-ai-gateway
    spec:
      nodeSelector:
        easyai.io/site: hongkong
        easyai.io/workload: "true"
      securityContext:
        runAsNonRoot: true
        runAsUser: 10001
        runAsGroup: 10001
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: collector
          image: easyai-api
          command: ["/app/easyai-ai-gateway-acceptance-callback-collector"]
          env:
            - name: HTTP_ADDR
              value: ":8091"
          ports:
            - name: http
              containerPort: 8091
          readinessProbe:
            httpGet:
              path: /healthz
              port: http
          resources:
            requests:
              cpu: 20m
              memory: 32Mi
            limits:
              cpu: 250m
              memory: 128Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop: ["ALL"]
            readOnlyRootFilesystem: true
---
apiVersion: v1
kind: Service
metadata:
  name: easyai-acceptance-callback-collector
  namespace: easyai
spec:
  selector:
    app.kubernetes.io/name: easyai-acceptance-callback-collector
  ports:
    - name: http
      port: 8091
      targetPort: http
