apiVersion: apps/v1
kind: Deployment
metadata:
  name: authx-service
  namespace: authx-service
spec:
  selector:
    matchLabels:
      app: authx-service
  replicas: 1
  template:
    metadata:
      labels:
        app: authx-service
    spec:
      containers:
        - name: authx-service
          image: jurajveverka/authx-micro-service:1.2.0-amd64
          ports:
            - name: http
              containerPort: 8080
          resources:
            limits:
              memory: 512Mi
              cpu: 1000m
            requests:
              memory: 256Mi
              cpu: 500m
          env:
            - name: REDIS_HOST
              value: "redis.host.com"
            - name: REDIS_PORT
              value: "6379"
            - name: MONGODB_HOST
              value: "mongo.host.com"
            - name: MONGODB_PORT
              value: "27017"
            - name: MONGODB_DB
              value: "admin"
            - name: MONGODB_USERNAME
              value: "root"
            - name: SERVER_PORT
              value: "8080"
            - name: AUTHX_APP_ID
              value: "authx-server-001"
            - name: AUTHX_INTERNAL_URL
              value: "http://authx:8080/authx"
            - name: AUTHX_EXTERNAL_URL
              value: "http://authx:8080/authx"
            - name: MONGODB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: authx-service
                  key: MONGODB_PASSWORD
            - name: ADMIN_USER_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: authx-service
                  key: ADMIN_USER_PASSWORD
            - name: ADMIN_CLIENT_SECRET
              valueFrom:
                secretKeyRef:
                  name: authx-service
                  key: ADMIN_CLIENT_SECRET
