|
| 1 | +1. Get the application URL by running these commands: |
| 2 | +{{- if .Values.httpRoute.enabled }} |
| 3 | +{{- if .Values.httpRoute.hostnames }} |
| 4 | + export APP_HOSTNAME={{ .Values.httpRoute.hostnames | first }} |
| 5 | +{{- else }} |
| 6 | + export APP_HOSTNAME=$(kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o jsonpath="{.spec.listeners[0].hostname}") |
| 7 | + {{- end }} |
| 8 | +{{- if and .Values.httpRoute.rules (first .Values.httpRoute.rules).matches (first (first .Values.httpRoute.rules).matches).path.value }} |
| 9 | + echo "Visit http://$APP_HOSTNAME{{ (first (first .Values.httpRoute.rules).matches).path.value }} to use your application" |
| 10 | + |
| 11 | + NOTE: Your HTTPRoute depends on the listener configuration of your gateway and your HTTPRoute rules. |
| 12 | + The rules can be set for path, method, header and query parameters. |
| 13 | + You can check the gateway configuration with 'kubectl get --namespace {{(first .Values.httpRoute.parentRefs).namespace | default .Release.Namespace }} gateway/{{ (first .Values.httpRoute.parentRefs).name }} -o yaml' |
| 14 | +{{- end }} |
| 15 | +{{- else if .Values.ingress.enabled }} |
| 16 | +{{- range $host := .Values.ingress.hosts }} |
| 17 | + {{- range .paths }} |
| 18 | + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} |
| 19 | + {{- end }} |
| 20 | +{{- end }} |
| 21 | +{{- else if contains "NodePort" .Values.service.type }} |
| 22 | + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "killbill.fullname" . }}) |
| 23 | + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") |
| 24 | + echo http://$NODE_IP:$NODE_PORT |
| 25 | +{{- else if contains "LoadBalancer" .Values.service.type }} |
| 26 | + NOTE: It may take a few minutes for the LoadBalancer IP to be available. |
| 27 | + You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "killbill.fullname" . }}' |
| 28 | + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "killbill.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") |
| 29 | + echo http://$SERVICE_IP:{{ .Values.service.port }} |
| 30 | +{{- else if contains "ClusterIP" .Values.service.type }} |
| 31 | + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "killbill.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") |
| 32 | + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") |
| 33 | + echo "Visit http://127.0.0.1:8080 to use your application" |
| 34 | + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT |
| 35 | +{{- end }} |
0 commit comments