Joxit / helm-charts

Official Helm Chart Repository for Joxit Applications
https://helm.joxit.dev/
MIT License
12 stars 7 forks source link

docker-registry-ui: add support for ingress #2

Closed Joxit closed 2 years ago

Joxit commented 2 years ago

As requested by @masterkain I added the support for kubernetes ingress

Interesting use case when the ui is on a custom pathname:

  ingress:
    # Enable the ingress for the user interface.
    enabled: true
    # Fully qualified domain name of a network host.
    host: null
    # Path is matched against the path of an incoming request.
    path: /ui(/|$)(.*)
    # Determines the interpretation of the Path matching, must be Prefix to serve assets.
    pathType: Prefix
    # The name of an IngressClass cluster resource.
    ingressClassName: nginx
    # TLS configuration
    tls: null
    annotations:
      # This will rewrite the query to the backend and use only the last part (after ui) to serve assets.
      nginx.ingress.kubernetes.io/rewrite-target: /$2

fixes #1

masterkain commented 2 years ago

looks good to me, however these null are a bit weird in these spots, I'm used to this method for example on annotations:

ingress template

{{- if .Values.ingress.enabled -}}
...
...
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ $fullName }}
  labels:
    {{- include "myapp.labels" . | nindent 4 }}
  annotations:
    {{- with .Values.ingress.annotations }}
    {{- toYaml . | nindent 4 }}
  {{- end }} 

values.yaml

ingress:
  enabled: false
  ingressClassName: nginx
  annotations: {}
  hosts: []
  tls: []

meaning that annotations will be always rendered (but eventually might ends up empty {}) and not have its entire presence behind a conditional.

this enables admins running kubernetes easier patching and whatnot.

cheers

Joxit commented 2 years ago

Thanks for your feedback :smile: I did the change !