Skip to content

Commit

Permalink
[stable/gocd] add host in template ingress.yaml instead of using defa…
Browse files Browse the repository at this point in the history
…ult backend (helm#10983)

* if there is no host in template ingress.yaml, use default backend

Signed-off-by: cola <[email protected]>

* Update CHANGELOG

Signed-off-by: cola <[email protected]>
  • Loading branch information
colachg authored and k8s-ci-robot committed Jan 31, 2019
1 parent 95f3e72 commit f672cf7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
6 changes: 6 additions & 0 deletions stable/gocd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 1.6.6

* [84bd7fe](https://github.com/kubernetes/charts/commit/f44d408):

- If there is no host in template ingress.yaml, use default backend.

### 1.6.5

* [f44d408](https://github.com/kubernetes/charts/commit/f44d408):
Expand Down
2 changes: 1 addition & 1 deletion stable/gocd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: gocd
home: https://www.gocd.org/
version: 1.6.5
version: 1.6.6
appVersion: 19.1.0
description: GoCD is an open-source continuous delivery server to model and visualize complex workflows with ease.
icon: https://gocd.github.io/assets/images/go-icon-black-192x192.png
Expand Down
19 changes: 14 additions & 5 deletions stable/gocd/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,25 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
backend:
serviceName: {{ template "gocd.fullname" . }}-server
servicePort: {{ .Values.server.service.httpPort }}
{{- if .Values.server.ingress.hosts }}
{{ $dot := .}}
rules:
{{- range $host := .Values.server.ingress.hosts }}
- host: {{ $host }}
{{- end -}}
http:
paths:
- backend:
serviceName: {{ template "gocd.fullname" $dot }}-server
servicePort: {{ $dot.Values.server.service.httpPort }}
{{- end }}
{{- else }}
backend:
serviceName: {{ template "gocd.fullname" . }}-server
servicePort: {{ .Values.server.service.httpPort }}
{{- end -}}
{{- if .Values.server.ingress.tls }}
tls:
{{ toYaml .Values.server.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
4 changes: 2 additions & 2 deletions stable/gocd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ server:
# server.ingress.enabled is the toggle to enable/disable GoCD Server Ingress
enabled: true
# server.ingress.hosts is used to create an Ingress record.
# hosts:
# - ci.example.com
# hosts:
# - ci.example.com
annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
Expand Down

0 comments on commit f672cf7

Please sign in to comment.