---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: identity-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: identity-deployment
  template:
    metadata:
      labels:
        app: identity-deployment
    spec:
      containers:
        - name: identity-container
          image: projectorigin/identity-service:{{ .Values.tag }}
          envFrom:
            - configMapRef:
                name: namespace-config
            - configMapRef:
                name: identity-config
            - secretRef:
                name: identity-system-secret
            - secretRef:
                name: identity-db-secret
          env:
            - name: TRUSTED_CLIENT_ACCOUNT_SERVICE
              valueFrom:
                secretKeyRef:
                  name: account-hydra-secret
                  key: HYDRA_CLIENT_ID
            - name: TRUSTED_CLIENT_EXAMPLE_BACKEND
              valueFrom:
                secretKeyRef:
                  name: example-backend-hydra-secret
                  key: HYDRA_CLIENT_ID
          ports:
          - containerPort: 9120
#          resources:
#            requests:
#              memory: "100Mi"
#              cpu: "500m"
#            limits:
#              memory: "500Mi"
#              cpu: "1000m"
