apiVersion: apps/v1
kind: Deployment
metadata:
  name: secret-service
  namespace: oih-dev-ns
  labels:
    app: secret-service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: secret-service
  template:
    metadata:
      labels:
        app: secret-service
    spec:
      containers:
      - name: secret-service
        image: openintegrationhub/secret-service:latest
        ports:
        - containerPort: 3000
        envFrom:
        - configMapRef:
            name: secret-service
        env:
        - name: IAM_TOKEN
          valueFrom:
            secretKeyRef:
              name: secret-service
              key: iamtoken
        - name: MONGODB_CONNECTION
          valueFrom:
            secretKeyRef:
              name: secret-service
              key: mongourl
        - name: CRYPTO_KEY
          valueFrom:
            secretKeyRef:
              name: secret-service
              key: crypto_key
        # - name: IAM_OIDC_SERVICE_CLIENT_ID
        #   value: 8ce00058-5f75-435f-9026-ad952480e15a
        # - name: IAM_OIDC_SERVICE_CLIENT_SECRET
        #   valueFrom:
        #     secretKeyRef:
        #       name: secret-service
        #       key: client-secret
        resources:
          limits:
            cpu: "0.1"
            memory: 1000Mi
        livenessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 120
          timeoutSeconds: 1
        readinessProbe:
          httpGet:
            port: 3000
            path: /healthcheck
          initialDelaySeconds: 10
          timeoutSeconds: 1
  minReadySeconds: 10
  revisionHistoryLimit: 2
