Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 1 | 1. Get the application URL by running these commands: |
| 2 | {{- if .Values.ingress.enabled }} |
| 3 | {{- range .Values.ingress.hosts }} |
| 4 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} |
| 5 | {{- end }} |
| 6 | {{- else if contains "NodePort" .Values.service.type }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 7 | export NODE_PORT=$(kubectl get --namespace {{ template "prometheus-pushgateway.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "prometheus-pushgateway.fullname" . }}) |
| 8 | export NODE_IP=$(kubectl get nodes --namespace {{ template "prometheus-pushgateway.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}") |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 9 | echo http://$NODE_IP:$NODE_PORT |
| 10 | {{- else if contains "LoadBalancer" .Values.service.type }} |
| 11 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. |
| 12 | You can watch the status of by running 'kubectl get svc -w {{ template "prometheus-pushgateway.fullname" . }}' |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 13 | export SERVICE_IP=$(kubectl get svc --namespace {{ template "prometheus-pushgateway.namespace" . }} {{ template "prometheus-pushgateway.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 14 | echo http://$SERVICE_IP:{{ .Values.service.port }} |
| 15 | {{- else if contains "ClusterIP" .Values.service.type }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 16 | export POD_NAME=$(kubectl get pods --namespace {{ template "prometheus-pushgateway.namespace" . }} -l "app.kubernetes.io/name={{ template "prometheus-pushgateway.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") |
| 17 | kubectl port-forward $POD_NAME 9091 |
| 18 | echo "Visit http://127.0.0.1:9091 to use your application" |
| 19 | {{- end }} |