alexandrevilain / temporal-operator

Temporal Kubernetes Operator
https://temporal-operator.pages.dev/
Apache License 2.0
164 stars 36 forks source link

Issue: Lack of Support for Configuring UI Paths for Temporal Operator #794

Closed ujala-singh closed 2 months ago

ujala-singh commented 2 months ago

Summary: Currently, the Temporal Operator does not support custom UI paths, leading to failures when attempting to configure UI paths in the Ingress configuration. This issue causes 404 errors when trying to access the UI through specific paths.

Details: When configuring the Temporal UI using an Ingress with custom paths, the following errors are encountered:

ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /_app/immutable/entry/start.u8QLqEdd.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 139 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.000 404 bdf5630f223695525e76ab42c66feed9
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /_app/immutable/chunks/entry.IjUtTUp0.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 46 0.000 [upstream-default-backend] [] 127.0.0.1:8181 146 0.001 404 632f985259faa76c345c9625924c9b49
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /_app/immutable/chunks/scheduler.yuwC4fMQ.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 49 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.001 404 1ff97de67e020d331ecf2a01262d1317
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /_app/immutable/chunks/paths.zRL2Vh_X.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 46 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.000 404 3fd588a9cde4c2b74a4243aea0874c60
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /_app/immutable/chunks/control.pJ1mnnAb.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 47 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.000 404 e16464953b8de1e9412ac52cb5f757da
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /_app/immutable/entry/app.mFdnAP5J.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 44 0.000 [upstream-default-backend] [] 127.0.0.1:8181 146 0.001 404 927574bae99b2b344b011773c608eb4a
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /_app/immutable/chunks/index.m6evPz-M.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 46 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.001 404 62321d26def7090b4909db8c504749ac
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.25.92 - - [28/Aug/2024:13:04:59 +0000] "GET /favicon.ico HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 98 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.000 404 681e772aabae22f9a99c809386aeea3e
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.74.239 - - [28/Aug/2024:13:06:07 +0000] "GET /_app/immutable/chunks/entry.IjUtTUp0.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 46 0.002 [upstream-default-backend] [] 127.0.0.1:8181 146 0.002 404 3ef27e25d38f5c11805f941400632540
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.74.239 - - [28/Aug/2024:13:06:07 +0000] "GET /_app/immutable/chunks/scheduler.yuwC4fMQ.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 49 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.001 404 ecb8c4df6775a7699cc7dac86193dd65
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.74.239 - - [28/Aug/2024:13:06:07 +0000] "GET /_app/immutable/entry/start.u8QLqEdd.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 107 0.002 [upstream-default-backend] [] 127.0.0.1:8181 146 0.002 404 e3fb39601e44719f7647cd37fd47fe63
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.74.239 - - [28/Aug/2024:13:06:07 +0000] "GET /_app/immutable/chunks/index.m6evPz-M.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 46 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.001 404 af71b24d3d9e83d43cff11abfd5541d2
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.74.239 - - [28/Aug/2024:13:06:07 +0000] "GET /_app/immutable/entry/app.mFdnAP5J.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 44 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.002 404 19d2cf33dcd3a2e2989091c3473414b7
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.74.239 - - [28/Aug/2024:13:06:07 +0000] "GET /_app/immutable/chunks/paths.zRL2Vh_X.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 46 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.002 404 971717ca3e5aa3e3a0eac7bd2e18a1e2
ingress-nginx-controller-5b4766cfdb-9rpdc controller 10.188.74.239 - - [28/Aug/2024:13:06:07 +0000] "GET /_app/immutable/chunks/control.pJ1mnnAb.js HTTP/2.0" 404 146 "https://temporal.dev/api/orchestration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0" 47 0.001 [upstream-default-backend] [] 127.0.0.1:8181 146 0.002 404 88e31a425962726ec5005fda01f32602

This configuration works without custom paths:

ui:
  replicas: 2
  resources:
    requests:
      cpu: 100m
      memory: 256Mi
    limits:
      cpu: 100m
      memory: 256Mi
  enabled: true
  ingress:
    enabled: true
    className: "nginx"
    annotations:
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/proxy-body-size: "0"
      nginx.ingress.kubernetes.io/ssl-redirect: "true"
    hosts:
      - temporal.dev
    tls:
      - secretName: tls-cert-dev
        hosts:
          - temporal.dev

However, when attempting to use custom paths, it fails with the following Ingress configuration:

ui:
  replicas: 2
  resources:
    requests:
      cpu: 100m
      memory: 256Mi
    limits:
      cpu: 100m
      memory: 256Mi
  enabled: true
  ingress:
    enabled: true
    className: "nginx"
    annotations:
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/proxy-body-size: "0"
      nginx.ingress.kubernetes.io/ssl-redirect: "true"
      nginx.ingress.kubernetes.io/rewrite-target: /$3
    hosts:
      - host: temporal.dev
        paths:
          - path: /api/orchestration(/|$)(.*)
            pathType: ImplementationSpecific
    tls:
    - secretName: tls-cert-dev
      hosts:
        - temporal.dev

Impact: The inability to configure custom UI paths limits the flexibility of deploying the Temporal UI behind an Ingress controller, especially in scenarios where the UI needs to be accessible under a specific path or domain structure.

Expected Behavior: The Temporal Operator should support custom UI paths, allowing users to configure and access the Temporal UI under a specified path without encountering 404 errors.

Proposed Solution:

• Add support in the Temporal Operator for configuring custom UI paths.
• Update the documentation to include instructions on how to properly configure UI paths using Ingress annotations.
• Implement testing for scenarios involving custom UI paths to ensure compatibility with various Ingress configurations.

Steps to Reproduce:

1. Deploy Temporal UI with the Ingress configuration using custom paths as provided above.
2. Attempt to access the Temporal UI through the configured path.
3. Observe the 404 errors in the Ingress controller logs.
alexandrevilain commented 2 months ago

Hi @ujala-singh !

It looks like the issue is not on the operator side but on your configuration. I don't see any type of extra things the operator should do to allow you to configure the custom path.

As all ingresses are requirering custom annotations it looks hard for me to support all of them.