Unverified Commit 26c88ec8 authored by Adam Reese's avatar Adam Reese Committed by GitHub

Merge pull request #4703 from adshmh/4556-fix-paths-ingress-template

fix paths in the ingress template and values file written by helm create
parents e83a54f7 1a54463b
...@@ -71,7 +71,7 @@ ingress: ...@@ -71,7 +71,7 @@ ingress:
annotations: {} annotations: {}
# kubernetes.io/ingress.class: nginx # kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" # kubernetes.io/tls-acme: "true"
path: / paths: []
hosts: hosts:
- chart-example.local - chart-example.local
tls: [] tls: []
...@@ -124,7 +124,7 @@ const defaultIgnore = `# Patterns to ignore when building packages. ...@@ -124,7 +124,7 @@ const defaultIgnore = `# Patterns to ignore when building packages.
const defaultIngress = `{{- if .Values.ingress.enabled -}} const defaultIngress = `{{- if .Values.ingress.enabled -}}
{{- $fullName := include "<CHARTNAME>.fullname" . -}} {{- $fullName := include "<CHARTNAME>.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}} {{- $ingressPaths := .Values.ingress.paths -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
kind: Ingress kind: Ingress
metadata: metadata:
...@@ -154,10 +154,12 @@ spec: ...@@ -154,10 +154,12 @@ spec:
- host: {{ . | quote }} - host: {{ . | quote }}
http: http:
paths: paths:
- path: {{ $ingressPath }} {{- range $ingressPaths }}
- path: {{ . }}
backend: backend:
serviceName: {{ $fullName }} serviceName: {{ $fullName }}
servicePort: http servicePort: http
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
` `
...@@ -238,8 +240,10 @@ spec: ...@@ -238,8 +240,10 @@ spec:
const defaultNotes = `1. Get the application URL by running these commands: const defaultNotes = `1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }} {{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }} {{- range $host := .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} {{- range $.Values.ingress.paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }}
{{- end }}
{{- end }} {{- end }}
{{- else if contains "NodePort" .Values.service.type }} {{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "<CHARTNAME>.fullname" . }}) export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "<CHARTNAME>.fullname" . }})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment