| 123456789101112131415161718192021222324252627282930313233343536373839 |
- 1. Get the application URL by running these commands:
- {{- if .Values.httpRoute.enabled }}
- {{- if .Values.httpRoute.hostnames }}
- export APP_HOSTNAME={{ .Values.httpRoute.hostnames | first }}
- {{- else }}
- 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}")
- {{- end }}
- echo "Visit http://$APP_HOSTNAME/ to use the frontend ({{ .Values.components.frontend.image.repository }})"
- echo "Visit http://$APP_HOSTNAME/api to reach the backend ({{ .Values.components.backend.image.repository }})"
- NOTE: Your HTTPRoute depends on the listener configuration of your gateway and your HTTPRoute rules.
- The rules can be set for path, method, header and query parameters.
- 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'
- {{- else if .Values.ingress.enabled }}
- {{- range $host := .Values.ingress.hosts }}
- {{- range .paths }}
- http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
- {{- end }}
- {{- end }}
- {{- else }}
- export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=frontend" -o jsonpath="{.items[0].metadata.name}")
- export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
- echo "Visit http://127.0.0.1:8080 to use your frontend"
- kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
- {{- end }}
- {{- if .Values.components.postgres }}
- 2. Connect to PostgreSQL ({{ .Values.components.postgres.image.repository }}:{{ .Values.components.postgres.image.tag }}):
- - In-cluster: host={{ include "chart.componentFullname" (dict "root" . "name" "postgres") }} port={{ .Values.components.postgres.service.port }}
- {{- if eq .Values.components.postgres.service.type "NodePort" }}
- - From host: host=<any node IP> port={{ .Values.components.postgres.service.nodePort }} (requires --service-node-port-range to include {{ .Values.components.postgres.service.nodePort }})
- {{- end }}
- - Database: {{ (index .Values.components.postgres.env 2).value }}
- - Default schema: aex_sch (set via search_path on the application role)
- Pull the credentials directly from the secret:
- kubectl --namespace {{ .Release.Namespace }} get secret {{ include "chart.componentFullname" (dict "root" . "name" "postgres") }} -o jsonpath='{.data.username}' | base64 -d
- kubectl --namespace {{ .Release.Namespace }} get secret {{ include "chart.componentFullname" (dict "root" . "name" "postgres") }} -o jsonpath='{.data.password}' | base64 -d
- {{- end }}
|