Add standalone R3 RIC platform helm charts and deployment scripts.
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / charts / postgresql / templates / NOTES.txt
1 {{- if contains .Values.service.type "LoadBalancer" }}
2 {{- if not .Values.postgresqlPassword }}
3 -------------------------------------------------------------------------------
4  WARNING
5
6     By specifying "serviceType=LoadBalancer" and not specifying "postgresqlPassword"
7     you have most likely exposed the PostgreSQL service externally without any
8     authentication mechanism.
9
10     For security reasons, we strongly suggest that you switch to "ClusterIP" or
11     "NodePort". As an alternative, you can also specify a valid password on the
12     "postgresqlPassword" parameter.
13
14 -------------------------------------------------------------------------------
15 {{- end }}
16 {{- end }}
17
18 ** Please be patient while the chart is being deployed **
19
20 PostgreSQL can be accessed via port 5432 on the following DNS name from within your cluster:
21
22     {{ template "postgresql.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - Read/Write connection
23 {{- if .Values.replication.enabled }}
24     {{ template "postgresql.fullname" . }}-read.{{ .Release.Namespace }}.svc.cluster.local - Read only connection
25 {{- end }}
26 To get the password for "{{ .Values.postgresqlUsername }}" run:
27
28     export POSTGRESQL_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ if .Values.existingSecret }}{{ .Values.existingSecret }}{{ else }}{{ template "postgresql.fullname" . }}{{ end }} -o jsonpath="{.data.postgresql-password}" | base64 --decode)
29
30 To connect to your database run the following command:
31
32     kubectl run {{ template "postgresql.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} --image bitnami/postgresql --env="PGPASSWORD=$POSTGRESQL_PASSWORD" {{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
33    --labels="{{ template "postgresql.fullname" . }}-client=true" {{- end }} --command -- psql --host {{ template "postgresql.fullname" . }} -U {{ .Values.postgresqlUsername }}
34
35 {{ if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
36 Note: Since NetworkPolicy is enabled, only pods with label {{ template "postgresql.fullname" . }}-client=true" will be able to connect to this PostgreSQL cluster.
37 {{- end }}
38
39 To connect to your database from outside the cluster execute the following commands:
40
41 {{- if contains "NodePort" .Values.service.type }}
42
43     export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
44     export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "postgresql.fullname" . }})
45     {{ if .Values.postgresqlPassword }}PGPASSWORD="{{ .Values.postgresqlPassword}}" {{ end }}psql --host $NODE_IP --port $NODE_PORT -U {{ .Values.postgresqlUsername }}
46
47 {{- else if contains "LoadBalancer" .Values.service.type }}
48
49   NOTE: It may take a few minutes for the LoadBalancer IP to be available.
50         Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "postgresql.fullname" . }}'
51
52     export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "postgresql.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
53     {{ if .Values.postgresqlPassword }}PGPASSWORD="{{ .Values.postgresqlPassword}}" {{ end }}psql --host $SERVICE_IP --port {{ .Values.service.port }} -U {{ .Values.postgresqlUsername }}
54
55 {{- else if contains "ClusterIP" .Values.service.type }}
56
57     kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "postgresql.fullname" . }} 5432:5432 &
58     {{ if .Values.postgresqlPassword }}PGPASSWORD="{{ .Values.postgresqlPassword}}" {{ end }}psql --host 127.0.0.1 -U {{ .Values.postgresqlUsername }}
59
60 {{- end }}