apiVersion: apps/v1
kind: Deployment
metadata:
  name: agent-gateway
  labels:
    app: agent-gateway
spec:
  replicas: 1
  selector:
    matchLabels:
      app: agent-gateway
  template:
    metadata:
      labels:
        app: agent-gateway
    spec:
      serviceAccountName: agent-gateway-sa
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        runAsGroup: 1000
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: agent-gateway
          image: agent-gateway:latest
          imagePullPolicy: IfNotPresent
          args:
            - "--config"
            - "/etc/agent-gateway/config.yaml"
          ports:
            - name: http
              containerPort: 8080
            - name: grpc
              containerPort: 9090
          readinessProbe:
            grpc:
              port: 9090
            initialDelaySeconds: 5
            periodSeconds: 10
          livenessProbe:
            grpc:
              port: 9090
            initialDelaySeconds: 10
            periodSeconds: 10
          resources:
            requests:
              cpu: 100m
              memory: 128Mi
            limits:
              cpu: "1"
              memory: 1Gi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
          volumeMounts:
            - name: config
              mountPath: /etc/agent-gateway
              readOnly: true
      volumes:
        - name: config
          configMap:
            name: agent-gateway-config
