apiVersion: v1
kind: ConfigMap
metadata:
  name: verifier-web-config
data:
  _features.conf : |
    enabledFeatures = [
        entra
    ]
  web.conf: |
    webHost = "0.0.0.0"
    webPort = 3000
  verifier-service.conf: |
    baseUrl = "https://verifier.portal.test.waltid.cloud"
    requestSigningKeyFile = "/waltid-verifier-api/request-signing-secret/ec.key"
    requestSigningCertFile = "/waltid-verifier-api/request-signing-secret/ec.crt"
    x509SanDnsClientId = "verifier.portal.test.waltid.cloud"
  entra.conf: |
    callbackUrl = "https://verifier.portal.test.waltid.cloud/entra/verification-callback/"
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: verifier
spec:
  replicas: 1
  selector:
    matchLabels:
      app: verifier
  template:
    metadata:
      labels:
        app: verifier
      annotations:
        deployment/id: "_DEFAULT_DEPLOYMENT_"
    spec:
      containers:
        - name: verifier
          image: waltid/verifier-api:__DEFAULT_IMAGE_TAG__
          imagePullPolicy: Always
          volumeMounts:
            - name: verifier-web-config
              mountPath: "/waltid-verifier-api/config/"
              readOnly: true
            - name: verifier-request-signing
              mountPath: "/waltid-verifier-api/request-signing-secret/"
          ports:
            - containerPort: 3000
              name: http-api
      volumes:
        - name: verifier-web-config
          configMap:
            name: verifier-web-config
        - name: verifier-request-signing
          secret:
            secretName: verifier-request-signing
---
kind: Service
apiVersion: v1
metadata:
  name: verifier
spec:
  ports:
    - name: http
      port: 80
      targetPort: http-api
      protocol: TCP
  selector:
    app: verifier
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: verifier
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
  tls:
    - hosts:
        - verifier.portal.test.waltid.cloud
      secretName: verifier-tls-secret
  rules:
    - host: verifier.portal.test.waltid.cloud
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: verifier
                port:
                  name: http
