apiVersion: apps/v1
kind: Deployment
metadata:
  name: gprc
  namespace: ac
spec:
  selector:
    matchLabels:
      app: grpc
  replicas: 1
  template:
    metadata:
      labels:
        app: grpc
    spec:
      containers:
      - name: grpc
        image: registry.gitlab.com/target-digital-transformation/access-control/ac-be:3.3.6
        command: 
         - /usr/local/bin/ac-serve 
         - serve 
         - grpc
         - --address=:7001
         - --dsn=postgres://postgres:password@postgres.postgres:5432/ac?sslmode=disable
         - --verbose
        env:
        - name: TARGET_SYS_ADMIN
          value: "CiQwOGE4Njg0Yi1kYjg4LTRiNzMtOTBhOS0zY2QxNjYxZjU0NjYSBWxvY2Fs"
        - name: CACHE_STRATEGY
          value: "MEMORY"
        - name: CACHE_EXPIRED
          value: "6h"
        - name: CACHE_MEMORY_MAXSIZE
          value: "1024"
        ports:
        - containerPort: 7001
        livenessProbe:
          exec:
            command: 
            - /usr/local/bin/grpc_health_probe
            - -addr=:7001
          initialDelaySeconds: 30
          periodSeconds: 30
          failureThreshold: 3
        readinessProbe:
          exec:
            command: 
            - /usr/local/bin/grpc_health_probe
            - -addr=:7001
          initialDelaySeconds: 10
          periodSeconds: 5
          failureThreshold: 3
      imagePullSecrets:
      - name: registry.gitlab.com
