Support custom Ingress path #151

Merged
mattkaar merged 1 commits from refs/pull/151/head into master 2021-06-24 18:28:45 +00:00
mattkaar commented 2021-04-26 19:41:30 +00:00 (Migrated from gitea.com)

Adds support for a custom Ingress path. This allows us to run Gitea as a path in an existing domain.

Adds support for a custom Ingress path. This allows us to run Gitea as a path in an existing domain.
luhahn commented 2021-05-03 08:45:20 +00:00 (Migrated from gitea.com)

Should we maybe add the path parameter to the hosts list? This way we could define paths for multiple hosts.

rules:
    {{- range .Values.ingress.hosts }}
    - host: {{ .host | quote }}
      http:
        paths:
          {{- range .paths }}
          - path: {{ .path }}
            {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
            pathType: Prefix
            {{- end }}
            backend:
            {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
              service:
                name: {{ $fullName }}-http
                port:
                  number: {{ $httpPort }}
            {{- else }}
              serviceName: {{ $fullName }}-http
              servicePort: {{ $httpPort }}
            {{- end }}
          {{- end }}
    {{- end }}
ingress:
  hosts:
    - host: chart-example.local
      paths: []

Something like the default ingress template approach in helm. Of course, this would be a breaking change.

Should we maybe add the path parameter to the hosts list? This way we could define paths for multiple hosts. ```yaml rules: {{- range .Values.ingress.hosts }} - host: {{ .host | quote }} http: paths: {{- range .paths }} - path: {{ .path }} {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} pathType: Prefix {{- end }} backend: {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} service: name: {{ $fullName }}-http port: number: {{ $httpPort }} {{- else }} serviceName: {{ $fullName }}-http servicePort: {{ $httpPort }} {{- end }} {{- end }} {{- end }} ``` ```yaml ingress: hosts: - host: chart-example.local paths: [] ``` Something like the default ingress template approach in helm. Of course, this would be a breaking change.
mattkaar commented 2021-05-03 12:41:59 +00:00 (Migrated from gitea.com)

I like your approach better—I was trying to avoid that breaking change with mine.

Let me know how you want to move forward. I can update the PR to match.

I like your approach better—I was trying to avoid that breaking change with mine. Let me know how you want to move forward. I can update the PR to match.
luhahn commented 2021-05-04 11:24:14 +00:00 (Migrated from gitea.com)

I'd say that, we should release a breaking change. This way we have a more common approach on ingress.

I'd say that, we should release a breaking change. This way we have a more common approach on ingress.
mattkaar commented 2021-06-08 14:29:21 +00:00 (Migrated from gitea.com)

Sounds good. I just made those edits and rebased onto master.

Sounds good. I just made those edits and rebased onto master.
luhahn commented 2021-06-08 17:47:12 +00:00 (Migrated from gitea.com)

great, will test it tomorrow :)

great, will test it tomorrow :)
luhahn commented 2021-06-21 13:30:34 +00:00 (Migrated from gitea.com)

Hi @mattkaar sorry for the delay, i was, again, kinda flooded with work. However your PR will be next in line for the merge. Can you once again update your branch with the latest changes?

Sorry again

Hi @mattkaar sorry for the delay, i was, again, kinda flooded with work. However your PR will be next in line for the merge. Can you once again update your branch with the latest changes? Sorry again
mattkaar commented 2021-06-21 14:57:55 +00:00 (Migrated from gitea.com)

Done!

Done! ✅
justusbunsi (Migrated from gitea.com) reviewed 2021-06-21 17:33:31 +00:00
luhahn commented 2021-06-23 08:06:41 +00:00 (Migrated from gitea.com)

Just tested on my cluster, looks good!

Just tested on my cluster, looks good!
luhahn (Migrated from gitea.com) approved these changes 2021-06-23 08:07:10 +00:00
justusbunsi (Migrated from gitea.com) approved these changes 2021-06-24 18:12:39 +00:00
justusbunsi (Migrated from gitea.com) left a comment

?

?
Sign in to join this conversation.
No description provided.