Skip to content

Commit 9061225

Browse files
committed
Update Postgresql chart to use common-v1
Add CircleCI as maintainers fix default image
1 parent 51d45d3 commit 9061225

38 files changed

+2526
-521
lines changed

helm/postgresql/.helmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
*.swp
1515
*.bak
1616
*.tmp
17-
*.orig
1817
*~
1918
# Various IDEs
2019
.project
2120
.idea/
2221
*.tmproj
23-
.vscode/

helm/postgresql/Chart.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
2-
- name: common-v2
3-
repository: file://../common/v2
4-
version: 2.31.4
5-
digest: sha256:7f47630a08e03779ad72d7613bdea7f6af05fcb9f5183f9aa9303ba061adb877
6-
generated: "2025-08-25T15:38:54.195548497-03:00"
2+
- name: common-v1
3+
repository: file://../common/v1
4+
version: 1.17.1
5+
digest: sha256:906d371323f7b27f3964245b797eb933d04dd6ed867e9b3d2c9facb5fc27d6c5
6+
generated: "2025-08-27T17:05:41.888479-05:00"

helm/postgresql/Chart.yaml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
# Copyright VMware, Inc.
2-
# SPDX-License-Identifier: APACHE-2.0
3-
# Modifications copyright (C) 2025 Circle Internet Services, Inc.
4-
51
annotations:
62
category: Database
7-
licenses: Apache-2.0
8-
images: |
9-
- name: os-shell
10-
image: docker.io/bitnami/os-shell:11-debian-11-r43
11-
- name: postgres-exporter
12-
image: docker.io/bitnami/postgres-exporter:0.13.2-debian-11-r25
13-
- name: postgresql
14-
image: docker.io/bitnami/postgresql:15.4.0-debian-11-r10
153
apiVersion: v2
16-
appVersion: 15.4.0
4+
appVersion: 14.3.0
175
dependencies:
18-
- name: common-v2
19-
repository: "file://../common/v2"
20-
tags:
21-
- bitnami-common
22-
version: 2.x.x
6+
- name: common-v1
7+
repository: "file://../common/v1"
8+
tags:
9+
- bitnami-common
10+
version: 1.x.x
2311
description: PostgreSQL (Postgres) is an open source object-relational database known for reliability and data integrity. ACID-compliant, it supports foreign keys, joins, views, triggers and stored procedures.
2412
home: https://github.com/circleci/server-docker-images
2513
icon: https://bitnami.com/assets/stacks/postgresql/img/postgresql-stack-220x234.png
@@ -37,5 +25,6 @@ maintainers:
3725
url: https://github.com/bitnami/charts
3826
name: postgresql
3927
sources:
40-
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql
41-
version: 12.10.3
28+
- https://github.com/bitnami/bitnami-docker-postgresql
29+
- https://www.postgresql.org/
30+
version: 11.6.0
Lines changed: 87 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,89 @@
1-
1. Get the application URL by running these commands:
2-
{{- if .Values.ingress.enabled }}
3-
{{- range $host := .Values.ingress.hosts }}
4-
{{- range .paths }}
5-
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6-
{{- end }}
1+
CHART NAME: {{ .Chart.Name }}
2+
CHART VERSION: {{ .Chart.Version }}
3+
APP VERSION: {{ .Chart.AppVersion }}
4+
5+
** Please be patient while the chart is being deployed **
6+
7+
{{- if .Values.diagnosticMode.enabled }}
8+
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
9+
10+
command: {{- include "common-v1.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
11+
args: {{- include "common-v1.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
12+
13+
Get the list of pods by executing:
14+
15+
kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}
16+
17+
Access the pod you want to debug by executing
18+
19+
kubectl exec --namespace {{ .Release.Namespace }} -ti <NAME OF THE POD> -- /opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash
20+
21+
In order to replicate the container startup scripts execute this command:
22+
23+
/opt/bitnami/scripts/postgresql/entrypoint.sh /opt/bitnami/scripts/postgresql/run.sh
24+
25+
{{- else }}
26+
27+
PostgreSQL can be accessed via port {{ include "postgresql.service.port" . }} on the following DNS names from within your cluster:
28+
29+
{{ include "postgresql.primary.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - Read/Write connection
30+
31+
{{- if eq .Values.architecture "replication" }}
32+
33+
{{ include "postgresql.readReplica.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - Read only connection
34+
735
{{- end }}
8-
{{- else if contains "NodePort" .Values.service.type }}
9-
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "postgresql.fullname" . }})
10-
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11-
echo http://$NODE_IP:$NODE_PORT
12-
{{- else if contains "LoadBalancer" .Values.service.type }}
13-
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14-
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "postgresql.fullname" . }}'
15-
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "postgresql.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16-
echo http://$SERVICE_IP:{{ .Values.service.port }}
17-
{{- else if contains "ClusterIP" .Values.service.type }}
18-
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "postgresql.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19-
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20-
echo "Visit http://127.0.0.1:8080 to use your application"
21-
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
36+
37+
{{- $customUser := include "postgresql.username" . }}
38+
{{- if and (not (empty $customUser)) (ne $customUser "postgres") .Values.auth.enablePostgresUser }}
39+
40+
To get the password for "postgres" run:
41+
42+
export POSTGRES_ADMIN_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "postgresql.secretName" . }} -o jsonpath="{.data.postgres-password}" | base64 -d)
43+
44+
To get the password for "{{ $customUser }}" run:
45+
46+
export POSTGRES_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "postgresql.secretName" . }} -o jsonpath="{.data.password}" | base64 -d)
47+
48+
{{- else }}
49+
50+
To get the password for "{{ default "postgres" $customUser }}" run:
51+
52+
export POSTGRES_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "postgresql.secretName" . }} -o jsonpath="{.data.{{ ternary "password" "postgres-password" (and (not (empty $customUser)) (ne $customUser "postgres")) }}}" | base64 -d)
53+
2254
{{- end }}
55+
56+
To connect to your database run the following command:
57+
58+
kubectl run {{ include "common-v1.names.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} --image {{ include "postgresql.image" . }} --env="PGPASSWORD=$POSTGRES_PASSWORD" \
59+
--command -- psql --host {{ include "postgresql.primary.fullname" . }} -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.database" . }} {{ include "postgresql.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.service.port" . }}
60+
61+
> NOTE: If you access the container using bash, make sure that you execute "/opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash" in order to avoid the error "psql: local user with ID {{ .Values.primary.containerSecurityContext.runAsUser }}} does not exist"
62+
63+
To connect to your database from outside the cluster execute the following commands:
64+
65+
{{- if contains "NodePort" .Values.primary.service.type }}
66+
67+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
68+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "postgresql.primary.fullname" . }})
69+
PGPASSWORD="$POSTGRES_PASSWORD" psql --host $NODE_IP --port $NODE_PORT -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.database" . }} {{ include "postgresql.database" . }}{{- else }} postgres{{- end }}
70+
71+
{{- else if contains "LoadBalancer" .Values.primary.service.type }}
72+
73+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
74+
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "postgresql.primary.fullname" . }}'
75+
76+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "postgresql.primary.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
77+
PGPASSWORD="$POSTGRES_PASSWORD" psql --host $SERVICE_IP --port {{ include "postgresql.service.port" . }} -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.database" . }} {{ include "postgresql.database" . }}{{- else }} postgres{{- end }}
78+
79+
{{- else if contains "ClusterIP" .Values.primary.service.type }}
80+
81+
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "postgresql.primary.fullname" . }} {{ include "postgresql.service.port" . }}:{{ include "postgresql.service.port" . }} &
82+
PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.database" . }} {{ include "postgresql.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.service.port" . }}
83+
84+
{{- end }}
85+
{{- end }}
86+
87+
{{- include "postgresql.validateValues" . -}}
88+
{{- include "common-v1.warnings.rollingTag" .Values.image -}}
89+
{{- include "common-v1.warnings.rollingTag" .Values.volumePermissions.image }}

0 commit comments

Comments
 (0)