ducktors / turborepo-remote-cache

Open source implementation of the Turborepo custom remote cache server.
https://ducktors.github.io/turborepo-remote-cache/
MIT License
1.03k stars 95 forks source link

Health check without auth header #85

Closed jazmon closed 1 year ago

jazmon commented 1 year ago

🚀 Feature Proposal

Create a (or modify the existing) health check endpoint that is not protected with the authorization header.

Motivation

Without this, it's not possible to scale the service behind an AWS ALB with a health check as ALB doesn't support passing headers.

Example

AWS ALB health checks

Atrax1 commented 1 year ago

We currently use following annotations for ingress for AWS Load Balancer :

    alb.ingress.kubernetes.io/healthcheck-path: '/v8/artifacts/status'
    alb.ingress.kubernetes.io/success-codes: '200,400'

and on deployment.yaml

          livenessProbe:
            httpGet:
              path: /v8/artifacts/status
              port: http
              httpHeaders:
                - name: Authorization
                  value: {{ printf "Bearer %s" .Values.envs.turboToken }}
          readinessProbe:
            httpGet:
              path: /v8/artifacts/status
              port: http
              httpHeaders:
                - name: Authorization
                  value: {{ printf "Bearer %s" .Values.envs.turboToken }}

Indeed would be nice to have healthcheck not requiring auth

fox1t commented 1 year ago

Hi! Thanks for pointing this out. Would you like to open a PR to implement it?

matteovivona commented 1 year ago

We can use this other tool https://github.com/ducktors/arecibo to create a /health route

adriantr commented 1 year ago

@jazmon implemented now!

https://github.com/ducktors/turborepo-remote-cache/pull/103