###
# AUTHX
###

kind: Deployment
apiVersion: apps/v1
metadata:
  labels:
    cluster: management
    component: authx
  name: authx
  namespace: __NPH_NAMESPACE
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      cluster: management
      component: authx
  template:
    metadata:
      labels:
        cluster: management
        component: authx
    spec:
      containers:
        - name: authx
          image: __NPH_REGISTRY_NAMESPACE/authx:__NPH_VERSION
          imagePullPolicy: Always
          args:
            - "run"
            - "--secret=/etc/authx/secret"
            - "--managementClusterCertPath=/etc/certs/tls.crt"
            - "--useDBScyllaProviders=true"
            - "--scyllaDBAddress=scylladb.__NPH_NAMESPACE"
            - "--scyllaDBKeyspace=authx"
            - "--scyllaDBPort=9042"
            - "--caCertPath=/etc/cacert/tls.crt"
            - "--caPrivateKeyPath=/etc/cacert/tls.key"
          volumeMounts:
            - name: authx-secret-volume
              mountPath: "/etc/authx"
              readOnly: true
            - name: authx-cert-volume
              mountPath: "/etc/certs"
              readOnly: true
            - name: mngt-ca-cert-volume
              mountPath: "/etc/cacert"
              readOnly: true
          securityContext:
            runAsUser: 2000
      volumes:
        - name: authx-secret-volume
          secret:
            secretName: authx-secret
        - name: authx-cert-volume
          secret:
            secretName: tls-client-certificate
        - name: mngt-ca-cert-volume
          secret:
            secretName: mngt-ca-cert
