You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docker-environment.md
+69-1Lines changed: 69 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,16 @@ users:
39
39
40
40
## 2. Create PostgreSQL Connection and Secret
41
41
42
-
For the `postgresql` Dev Service, you can generate the necessary Custom Resources to test the Operator:
42
+
For the `postgresql` Dev Service, you can generate the necessary Custom Resources to test the Operator.
43
+
44
+
A `ClusterConnection` requires admin credentials, which can be provided in one of two ways:
45
+
46
+
-**`adminSecretRef`** — references a Kubernetes `basic-auth` Secret (username + password).
47
+
-**`adminSecretFileRef`** — references a JSON file mounted into the operator pod (e.g. from AWS Secrets Manager).
48
+
49
+
Exactly one of these must be specified.
50
+
51
+
### Using a Kubernetes Secret (`adminSecretRef`)
43
52
44
53
1. From the Dev UI, get the `postgresql` Dev Service properties (username, password, host, port).
45
54
2. Convert the `postgresql` Dev Service properties to a **Basic Auth Secret** and a **ClusterConnection** CR instance.
@@ -79,6 +88,65 @@ spec:
79
88
database: postgres
80
89
```
81
90
91
+
### Using a file reference (`adminSecretFileRef`)
92
+
93
+
Instead of a Kubernetes Secret, you can mount a JSON credentials file into the operator pod and reference its path. This is useful when credentials are managed externally (e.g. AWS Secrets Manager).
94
+
95
+
#### File format
96
+
97
+
The file must contain JSON with the following fields:
98
+
99
+
```json
100
+
{
101
+
"username": "root",
102
+
"password": "password"
103
+
}
104
+
```
105
+
106
+
- `password`— **required**
107
+
- `username`— optional (can be omitted)
108
+
109
+
#### Mount the credentials file
110
+
111
+
The file must be accessible inside the operator pod at the path specified in `adminSecretFileRef.path`. Mount it using a Volume and VolumeMount on the operator Deployment:
112
+
113
+
```yaml
114
+
apiVersion: apps/v1
115
+
kind: Deployment
116
+
metadata:
117
+
name: postgresql-operator
118
+
spec:
119
+
template:
120
+
spec:
121
+
containers:
122
+
- name: operator
123
+
volumeMounts:
124
+
- name: db-credentials
125
+
mountPath: /mnt/secrets
126
+
readOnly: true
127
+
volumes:
128
+
- name: db-credentials
129
+
secret:
130
+
secretName: db-credentials-secret
131
+
```
132
+
133
+
> **Note:** The volume source can be any type that provides a file (e.g. a Kubernetes Secret, a CSI volume from AWS Secrets Manager, or a ConfigMap for testing).
0 commit comments