|
1 | 1 | 1. Get the application URL by running these commands: |
2 | 2 | {{- if .Values.ingress.enabled }} |
3 | | -{{- $contexPath := include "cosmotech-api.contexPath" . -}} |
| 3 | +{{- $contextPath := include "cosmotech-api.contextPath" . -}} |
4 | 4 | {{- range $host := .Values.ingress.hosts }} |
5 | | - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ $contexPath }} |
| 5 | + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ $contextPath }} |
6 | 6 | {{- range .paths }} |
7 | 7 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} |
8 | 8 | {{- end }} |
9 | 9 | {{- end }} |
10 | 10 | {{- else if contains "NodePort" .Values.service.type }} |
11 | 11 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "cosmotech-api.fullname" . }}) |
12 | 12 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") |
13 | | - echo http://$NODE_IP:$NODE_PORT{{ include "cosmotech-api.contexPath" . }} |
| 13 | + echo http://$NODE_IP:$NODE_PORT{{ include "cosmotech-api.contextPath" . }} |
14 | 14 | {{- else if contains "LoadBalancer" .Values.service.type }} |
15 | 15 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. |
16 | 16 | You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "cosmotech-api.fullname" . }}' |
17 | 17 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "cosmotech-api.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") |
18 | | - echo http://$SERVICE_IP:{{ .Values.service.port }}{{ include "cosmotech-api.contexPath" . }} |
| 18 | + echo http://$SERVICE_IP:{{ .Values.service.port }}{{ include "cosmotech-api.contextPath" . }} |
19 | 19 | {{- else if contains "ClusterIP" .Values.service.type }} |
20 | 20 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "cosmotech-api.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") |
21 | 21 | export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") |
22 | | - echo "Visit http://127.0.0.1:8080{{ include "cosmotech-api.contexPath" . }} to use your application" |
| 22 | + echo "Visit http://127.0.0.1:8080{{ include "cosmotech-api.contextPath" . }} to use your application" |
23 | 23 | kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT |
24 | 24 | {{- end }} |
0 commit comments