Skip to content

Commit 042e2fd

Browse files
committed
reorganize test app
1 parent a735727 commit 042e2fd

File tree

5 files changed

+17
-26
lines changed

5 files changed

+17
-26
lines changed

README.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,26 +104,9 @@ name: "app-postgres"
104104
105105
testApp:
106106
enabled: true
107-
108-
cnpgCluster:
109-
# -- enable this to deploy the official CNPG cluster helm chart dep
110-
# All other values here are passed directly to the their chart. See:
111-
# https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/values.yaml
112-
enabled: true
113-
# -- see: https://cloudnative-pg.io/docs/1.28/certificates#client-certificate
114-
certificates:
115-
## examples if using our certificates features of this chart.
116-
## NOTE: app-postgres should be replaced with whatever you set Values.name to
117-
serverTLSSecret: "app-postgres-server-cert"
118-
serverCASecret: "app-postgres-server-ca-key-pair"
119-
clientCASecret: "app-postgres-client-ca-key-pair"
120-
replicationTLSSecret: "app-postgres-client-cert"
121-
122-
cluster:
123-
initdb:
124-
# -- replace this with your database name
125-
database: app
126-
# -- replace this with your database username
127-
owner: app
107+
# -- replace this with your database name
108+
database: app
109+
# -- replace this with your database username
110+
owner: app
128111
```
129112
This will create a very basic Deployment of `ghcr.io/cloudnative-pg/webtest` [as described in the official docs](https://cloudnative-pg.io/docs/1.28/ssl_connections#testing-the-connection-via-a-tls-certificate) that attempts to connect to your postgres cluster using full mTLS.

charts/cloudnative-pg-cluster/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: cnpg-cluster
33
description: Create postgres tenant clusters managed by the CNPG Operator
44
type: application
5-
version: 1.0.2
5+
version: 1.1.0
66

77
dependencies:
88
- name: cluster

charts/cloudnative-pg-cluster/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cnpg-cluster
22

3-
![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
3+
![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
44

55
Create postgres tenant clusters managed by the CNPG Operator
66

@@ -46,7 +46,9 @@ Create postgres tenant clusters managed by the CNPG Operator
4646
| cnpgCluster.type | string | `"postgresql"` | |
4747
| cnpgCluster.version.postgresql | string | `"16"` | |
4848
| name | string | `"app-postgres"` | name to use for templating certs |
49+
| testApp.database | string | `"app"` | this is required for testing the application. please change to your database name in your postgresql clsuter |
4950
| testApp.enabled | bool | `false` | |
51+
| testApp.owner | string | `"app"` | this is required for testing the application. please change to your database's username in your postgresql clsuter |
5052

5153
----------------------------------------------
5254
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

charts/cloudnative-pg-cluster/templates/test-app.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ spec:
3030
sslcert=/etc/secrets/app/tls.crt
3131
sslrootcert=/etc/secrets/ca/ca.crt
3232
host={{ .Values.name }}-rw.{{ .Release.Namespace }}.svc
33-
dbname={{ .Values.cnpgCluster.cluster.initdb.database }}
34-
user={{ .Values.cnpgCluster.cluster.initdb.owner }}
33+
dbname={{ .Values.testApp.database }}
34+
user={{ .Values.testApp.owner }}
3535
sslmode=verify-full
3636
- name: SQL_QUERY
3737
value: SELECT 1
@@ -50,6 +50,6 @@ spec:
5050
defaultMode: 0600
5151
- name: secret-volume-app
5252
secret:
53-
secretName: "{{ .Values.name }}-{{ .Values.cnpgCluster.cluster.initdb.owner }}-cert"
53+
secretName: "{{ .Values.name }}-{{ .Values.testApp.owner }}-cert"
5454
defaultMode: 0600
5555
{{- end }}

charts/cloudnative-pg-cluster/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ testApp:
4040
# Populates user and DB from the Initdb owner and database values
4141
# Requires server, client, and user certificate generation to be enabled.
4242
enabled: false
43+
# -- this is required for testing the application.
44+
# please change to your database's username in your postgresql clsuter
45+
owner: app
46+
# -- this is required for testing the application.
47+
# please change to your database name in your postgresql clsuter
48+
database: app
4349

4450
cnpgCluster:
4551
# -- enable this to deploy the official CNPG cluster helm chart dep

0 commit comments

Comments
 (0)