# License terms and conditions for Gluu Cloud Native Edition:
# https://www.apache.org/licenses/LICENSE-2.0
apiVersion: apps/v1
kind: Deployment
metadata:
  name: oxauth
  labels:
    APP_NAME: oxauth
spec:
  replicas: 1
  selector:
    matchLabels:
      app: oxauth
  template:
    metadata:
      labels:
        APP_NAME: oxauth
    spec:
      containers:
      - name: oxauth
        imagePullPolicy: Always
        image: gluufederation/oxauth:4.1.0_01
        command:
          - /bin/sh
          - -c
          - |
              /usr/bin/python /scripts/update-lb-ip.py &
              /app/scripts/entrypoint.sh
        resources:
          requests:
            memory: "2500Mi"
            cpu: "2500m"
          limits:
            memory: "2500Mi"
            cpu: "2500m"
        ports:
        - containerPort: 8080
        envFrom:
        - configMapRef:
            name: oxauth-cm
        volumeMounts:
          - name: cb-pass
            mountPath: "/etc/gluu/conf/couchbase_password"
            subPath: couchbase_password
          - name: cb-crt
            mountPath: "/etc/certs/couchbase.crt"
            subPath: couchbase.crt
          #- name: casa
          #  mountPath: "/etc/gluu/conf/casa.json"
          #  subPath: casa.json
          - mountPath: /scripts
            name: update-lb-ip
        livenessProbe:
          httpGet:
            path: /oxauth/.well-known/openid-configuration
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 30
        readinessProbe:
          httpGet:
            path: /oxauth/.well-known/openid-configuration
            port: 8080
          initialDelaySeconds: 25
          periodSeconds: 25
      hostAliases:
      - ip: NGINX_IP
        hostnames:
        - FQDN
      volumes:
      - name: cb-pass
        secret:
          secretName: cb-pass
      - name: cb-crt
        secret:
          secretName: cb-crt
      #- name: casa
      #  configMap:
      #    name: casacm
      - name: update-lb-ip
        configMap:
          name: updatelbip
