---
# Source: camunda-platform/charts/identity/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: camunda-platform-test-identity
  labels:
    app: camunda-platform
    app.kubernetes.io/name: identity
    app.kubernetes.io/instance: camunda-platform-test
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: camunda-platform
    app.kubernetes.io/version: "8.0.0"
    app.kubernetes.io/component: identity
  annotations:
    {}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: camunda-platform
      app.kubernetes.io/name: identity
      app.kubernetes.io/instance: camunda-platform-test
      app.kubernetes.io/managed-by: Helm
      app.kubernetes.io/part-of: camunda-platform
      app.kubernetes.io/component: identity
  template:
    metadata:
      labels:
        app: camunda-platform
        app.kubernetes.io/name: identity
        app.kubernetes.io/instance: camunda-platform-test
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/part-of: camunda-platform
        app.kubernetes.io/version: "8.0.0"
        app.kubernetes.io/component: identity
    spec:
      imagePullSecrets:
        []
      containers:
      - name: identity
        image: "camunda/identity:8.0.0"
        env:
          - name: KEYCLOAK_USERS_0_USERNAME
            value: "demo"
          - name: KEYCLOAK_USERS_0_PASSWORD
            value: "demo"
          - name: KEYCLOAK_USERS_0_ROLES_0
            value: "Identity"
          - name: KEYCLOAK_USERS_0_ROLES_1
            value: "Operate"
          - name: KEYCLOAK_INIT_OPERATE_SECRET
            valueFrom:
              secretKeyRef:
                name: "camunda-platform-test-operate-identity-secret"
                key: operate-secret
          - name: KEYCLOAK_INIT_OPERATE_ROOT_URL
            value: "http://localhost:8081"

          - name: KEYCLOAK_USERS_0_ROLES_2
            value: "Tasklist"
          - name: KEYCLOAK_INIT_TASKLIST_SECRET
            valueFrom:
              secretKeyRef:
                name: "camunda-platform-test-tasklist-identity-secret"
                key: tasklist-secret
          - name: KEYCLOAK_INIT_TASKLIST_ROOT_URL
            value: "http://localhost:8082"


          - name: KEYCLOAK_USERS_0_ROLES_3
            value: "Optimize"
          - name: KEYCLOAK_INIT_OPTIMIZE_SECRET
            valueFrom:
              secretKeyRef:
                name: "camunda-platform-test-optimize-identity-secret"
                key: optimize-secret
          - name: KEYCLOAK_INIT_OPTIMIZE_ROOT_URL
            value: "http://localhost:8083"
          - name: SERVER_PORT
            value: "8080"
          - name: KEYCLOAK_URL
            value: "http://camunda-platform-tes:80/auth"
          - name: IDENTITY_AUTH_PROVIDER_ISSUER_URL
            value: "http://localhost:18080/auth/realms/camunda-platform"
          - name: IDENTITY_AUTH_PROVIDER_BACKEND_URL
            value: "http://camunda-platform-tes:80/auth/realms/camunda-platform"
          - name: KEYCLOAK_SETUP_USER
            value: admin
          - name: KEYCLOAK_SETUP_PASSWORD
            valueFrom:
                secretKeyRef:
                  name: camunda-platform-test-keycloak
                  key: admin-password
        resources:
          limits:
            cpu: 2000m
            memory: 2Gi
          requests:
            cpu: 600m
            memory: 400Mi
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP