From 3cbd3ced6abf8c732410660f44f541d24ba1df8b Mon Sep 17 00:00:00 2001 From: Ivan Pedrazas Date: Sat, 19 Nov 2016 17:14:00 +0000 Subject: [PATCH 1/3] .status.loadBalancer.ingress[0].ip is empty in AWS Fixes #237 `.status.loadBalancer.ingress[0].ip}` has no value in AWS since the ELB only returns the hostname. I've added instructions to get the jenkins url using the hostname of the eLB instead of the IP. --- stable/jenkins/templates/NOTES.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stable/jenkins/templates/NOTES.txt b/stable/jenkins/templates/NOTES.txt index ae66c688f2..ae9e5c5038 100644 --- a/stable/jenkins/templates/NOTES.txt +++ b/stable/jenkins/templates/NOTES.txt @@ -12,6 +12,11 @@ **** You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}' **** export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo http://$SERVICE_IP:{{ .Values.Master.ServicePort }}/login + +If you're running Kubernetes in AWS, the ingress has not ip, but you can use the Hostname + export SERVICE_HOSTNAME=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].Hostname}') + echo http://$SERVICE_HOSTNAME:{{ .Values.Master.ServicePort }}/login + {{- else if contains "ClusterIP" .Values.Master.ServiceType }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "component={{ template "fullname" . }}-master" -o jsonpath="{.items[0].metadata.name}") echo http://127.0.0.1:{{ .Values.Master.ServicePort }} From 1810e37f435554c6a8af0baf3f3be3a944b440e5 Mon Sep 17 00:00:00 2001 From: Ivan Pedrazas Date: Mon, 21 Nov 2016 18:32:54 +0000 Subject: [PATCH 2/3] .status.loadBalancer.ingress[0].ip is empty in AWS `.status.loadBalancer.ingress[0].ip}` has no value in AWS since the ELB only returns the hostname. I've added instructions to get the jenkins url using the hostname of the ELB instead of the IP. --- stable/jenkins/templates/NOTES.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/stable/jenkins/templates/NOTES.txt b/stable/jenkins/templates/NOTES.txt index ae9e5c5038..ca9f8e7c2d 100644 --- a/stable/jenkins/templates/NOTES.txt +++ b/stable/jenkins/templates/NOTES.txt @@ -10,13 +10,9 @@ {{- else if contains "LoadBalancer" .Values.Master.ServiceType }} **** NOTE: It may take a few minutes for the LoadBalancer IP to be available. **** **** You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}' **** - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + export SERVICE_IP=$(kubectl get svc {{ template "fullname" . }} --namespace {{ .Release.Namespace }} --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}") echo http://$SERVICE_IP:{{ .Values.Master.ServicePort }}/login -If you're running Kubernetes in AWS, the ingress has not ip, but you can use the Hostname - export SERVICE_HOSTNAME=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].Hostname}') - echo http://$SERVICE_HOSTNAME:{{ .Values.Master.ServicePort }}/login - {{- else if contains "ClusterIP" .Values.Master.ServiceType }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "component={{ template "fullname" . }}-master" -o jsonpath="{.items[0].metadata.name}") echo http://127.0.0.1:{{ .Values.Master.ServicePort }} From 2026e1d150ae4ef85dbf6a24d3a089947d070e66 Mon Sep 17 00:00:00 2001 From: Ivan Pedrazas Date: Tue, 22 Nov 2016 09:31:15 +0000 Subject: [PATCH 3/3] escape fixed --- stable/jenkins/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/jenkins/templates/NOTES.txt b/stable/jenkins/templates/NOTES.txt index ca9f8e7c2d..a37d6d3b26 100644 --- a/stable/jenkins/templates/NOTES.txt +++ b/stable/jenkins/templates/NOTES.txt @@ -10,7 +10,7 @@ {{- else if contains "LoadBalancer" .Values.Master.ServiceType }} **** NOTE: It may take a few minutes for the LoadBalancer IP to be available. **** **** You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}' **** - export SERVICE_IP=$(kubectl get svc {{ template "fullname" . }} --namespace {{ .Release.Namespace }} --template "{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}") + export SERVICE_IP=$(kubectl get svc {{ template "fullname" . }} --namespace {{ .Release.Namespace }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.Master.ServicePort }}/login {{- else if contains "ClusterIP" .Values.Master.ServiceType }}