blob: 3315e015d4f581184808289253c4ec172d17e493 [file] [log] [blame]
Shad Ansari0a4637a2022-05-11 12:20:59 -07001{{/*
Hyunsun Moon97e111d2022-05-13 17:56:56 -07002Copyright 2022-present Open Networking Foundation
3SPDX-License-Identifier: Apache-2.0
Shad Ansari0a4637a2022-05-11 12:20:59 -07004*/}}
5
61. Get the application URL by running these commands:
7{{- if .Values.ingress.enabled }}
8{{- range $host := .Values.ingress.hosts }}
9 {{- range .paths }}
10 http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
11 {{- end }}
12{{- end }}
Hyunsun Moon08898d42022-05-16 14:21:38 -070013{{- else if contains "NodePort" .Values.service.streaming.type }}
Shad Ansari0a4637a2022-05-11 12:20:59 -070014 export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "person-detection-app.fullname" . }})
15 export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
16 echo http://$NODE_IP:$NODE_PORT
Hyunsun Moon08898d42022-05-16 14:21:38 -070017{{- else if contains "LoadBalancer" .Values.service.streaming.type }}
Shad Ansari0a4637a2022-05-11 12:20:59 -070018 NOTE: It may take a few minutes for the LoadBalancer IP to be available.
19 You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "person-detection-app.fullname" . }}'
20 export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "person-detection-app.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
Hyunsun Moon08898d42022-05-16 14:21:38 -070021 echo http://$SERVICE_IP:{{ .Values.service.streaming.port }}
22{{- else if contains "ClusterIP" .Values.service.streaming.type }}
Shad Ansari0a4637a2022-05-11 12:20:59 -070023 export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "person-detection-app.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
24 export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
25 echo "Visit http://127.0.0.1:8080 to use your application"
26 kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
27{{- end }}