apiVersion: apps/v1
kind: Deployment
metadata:
  name: rendezvous-iam-deployment
  labels:
    app: rendezvous-iam
spec:
  replicas: 1
  selector:
    matchLabels:
      app: rendezvous-iam
  template:
    metadata:
      labels:
        app: rendezvous-iam
    spec:
      containers:
        - name: iam
          image: ilinaraducristian/rendezvous-iam:0.0.1
          imagePullPolicy: Always
          #          securityContext:
          #            allowPrivilegeEscalation: true
          #            runAsUser: 0
          env:
            - name: DB_VENDOR
              value: "MYSQL"
            - name: DB_ADDR
              value: "rendezvous-database-service"
            - name: DB_DATABASE
              value: "keycloak"
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  name: database-secret
                  key: keycloak_user
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: database-secret
                  key: keycloak_password
            - name: KEYCLOAK_USER
              valueFrom:
                secretKeyRef:
                  name: keycloak-secret
                  key: user
            - name: KEYCLOAK_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: keycloak-secret
                  key: password
            - name: KEYCLOAK_IMPORT
              value: "/tmp/rendezvous.json"
            - name: PROXY_ADDRESS_FORWARDING
              value: "true"
          volumeMounts:
            - name: realm-file
              mountPath: /tmp/rendezvous.json
              subPath: rendezvous.json
          ports:
            - containerPort: 8080
      volumes:
        - name: realm-file
          configMap:
            name: rendezvous-iam-configmap