Merge pull request #8505 from jiayushe/master

Avoid hardcoded container port in default notes
pull/8574/head
Martin Hickey 4 years ago committed by GitHub
commit 621c2020c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -381,8 +381,9 @@ const defaultNotes = `1. Get the application URL by running these commands:
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "<CHARTNAME>.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
`

Loading…
Cancel
Save