Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 1 | {{/* |
Hyunsun Moon | 97e111d | 2022-05-13 17:56:56 -0700 | [diff] [blame] | 2 | Copyright 2022-present Open Networking Foundation |
| 3 | SPDX-License-Identifier: Apache-2.0 |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 4 | */}} |
| 5 | |
| 6 | 1. 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 Moon | 08898d4 | 2022-05-16 14:21:38 -0700 | [diff] [blame^] | 13 | {{- else if contains "NodePort" .Values.service.streaming.type }} |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 14 | 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 Moon | 08898d4 | 2022-05-16 14:21:38 -0700 | [diff] [blame^] | 17 | {{- else if contains "LoadBalancer" .Values.service.streaming.type }} |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 18 | 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 Moon | 08898d4 | 2022-05-16 14:21:38 -0700 | [diff] [blame^] | 21 | echo http://$SERVICE_IP:{{ .Values.service.streaming.port }} |
| 22 | {{- else if contains "ClusterIP" .Values.service.streaming.type }} |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 23 | 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 }} |