Skip to content

Commit 6361d30

Browse files
authored
helm: Use templates in NOTES.txt for better advice.
This logic is should give the correct Zulip URL in a wider range of configurations.
1 parent f44200d commit 6361d30

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

kubernetes/chart/zulip/templates/NOTES.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,23 @@
55

66
2. Zulip will be available on:
77

8-
https://{{ .host }}
8+
9+
{{- if .Values.ingress.enabled }}
10+
{{- range $host := .Values.ingress.hosts }}
11+
{{- range .paths }}
12+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
13+
{{- end }}
14+
{{- end }}
15+
{{- else if contains "NodePort" .Values.service.type }}
16+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "zulip.fullname" . }})
17+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
18+
echo http://$NODE_IP:$NODE_PORT
19+
{{- else if contains "LoadBalancer" .Values.service.type }}
20+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
21+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "zulip.fullname" . }}'
22+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "zulip.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
23+
echo http://$SERVICE_IP:{{ .Values.service.port }}
24+
{{- else if contains "ClusterIP" .Values.service.type }}
25+
echo "Visit http://127.0.0.1:{{ .Values.service.port }} to use your application"
26+
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ .Release.Name }}-http {{ .Values.service.port }}:{{ .Values.service.port }}
27+
{{- end }}

0 commit comments

Comments
 (0)