Skip to content

Commit 1d62f9d

Browse files
committed
RDSC-3469 Improve documentation for PostgreSQL with mTLS
1 parent a6a6086 commit 1d62f9d

File tree

1 file changed

+22
-3
lines changed
  • content/integrate/redis-data-integration/data-pipelines

1 file changed

+22
-3
lines changed

content/integrate/redis-data-integration/data-pipelines/deploy.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ redis-di set-secret SOURCE_DB_USERNAME myUserName
6565

6666
Use
6767
[`kubectl create secret generic`](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_create/kubectl_create_secret_generic/)
68-
to set secrets for a K8s/Helm deployment. The general pattern of the commands is
68+
to set secrets for a K8s/Helm deployment. The general pattern of the commands is:
6969

7070
```bash
7171
kubectl create secret generic <DB> \
@@ -74,6 +74,23 @@ kubectl create secret generic <DB> \
7474
```
7575

7676
Where `<DB>` is either `source-db` for source secrets or `target-db` for target secrets.
77+
78+
If you use TLS or mTLS for either the source or target databases, you also need to create the `source-db-ssl` and / or `target-db-ssl` K8s secrets that contain the actual certificates used to establish secure connections. The general pattern of the commands is:
79+
80+
```bash
81+
kubectl create secret generic <DB>-ssl \
82+
--namespace=rdi \
83+
--from-file=<FILE-NAME>=<FILE-PATH>
84+
```
85+
86+
All certificates and keys used when creating the above secrets must be in PEM format, with one exception: for PostgreSQL, the private key in the `source-db-ssl` secret (the `client.key` file) must be in DER format. Only in this case, if you have a key in PEM format, first convert it to DER before creating the `source-db-ssl` secret using the command:
87+
88+
```bash
89+
openssl pkcs8 -topk8 -inform PEM -outform DER -in /path/to/myclient.key -out /path/to/myclient.pk8 -nocrypt
90+
```
91+
92+
The above command assumes that the private key is not encrypted. For converting an encrypted private key, refer to the `openssl` documentation.
93+
7794
The specific command lines for source secrets are as follows:
7895

7996
```bash
@@ -102,7 +119,7 @@ kubectl create secret generic source-db --namespace=rdi \
102119
--from-literal=SOURCE_DB_USERNAME=yourUsername \
103120
--from-literal=SOURCE_DB_PASSWORD=yourPassword \
104121
--from-literal=SOURCE_DB_CACERT=/etc/certificates/source_db/ca.crt \
105-
--from-literal=SOURCE_DB_CERT=/etc/certificates/source_db/client.crt \
122+
--from-literal=SOURCE_DB_CERT=/etc/certificates/source_db/client.crt \
106123
--from-literal=SOURCE_DB_KEY=/etc/certificates/source_db/client.key \
107124
--from-literal=SOURCE_DB_KEY_PASSWORD=yourKeyPassword \ # add this only if SOURCE_DB_KEY is password-protected
108125
--save-config --dry-run=client -o yaml | kubectl apply -f -
@@ -142,7 +159,7 @@ kubectl create secret generic target-db --namespace=rdi \
142159
--from-literal=TARGET_DB_USERNAME=yourUsername \
143160
--from-literal=TARGET_DB_PASSWORD=yourPassword \
144161
--from-literal=TARGET_DB_CACERT=/etc/certificates/target_db/ca.crt \
145-
--from-literal=TARGET_DB_CERT=/etc/certificates/target_db/client.crt \
162+
--from-literal=TARGET_DB_CERT=/etc/certificates/target_db/client.crt \
146163
--from-literal=TARGET_DB_KEY=/etc/certificates/target_db/client.key \
147164
--from-literal=TARGET_DB_KEY_PASSWORD=yourKeyPassword \ # add this only if TARGET_DB_KEY is password-protected
148165
--save-config --dry-run=client -o yaml | kubectl apply -f -
@@ -154,6 +171,8 @@ kubectl create secret generic target-db-ssl --namespace=rdi \
154171
--save-config --dry-run=client -o yaml | kubectl apply -f -
155172
```
156173

174+
Note that the certificate paths contained in the secrets `SOURCE_DB_CACERT`, `SOURCE_DB_CERT`, and `SOURCE_DB_KEY` (for the source database) and `TARGET_DB_CACERT`, `TARGET_DB_CERT`, and `TARGET_DB_KEY` (for the target database) are internal to RDI and therefore their values specified in the above commands **must not be changed**. Only change the certificate paths when creating the `source-db-ssl` and `target-db-ssl` secrets.
175+
157176
## Deploy a pipeline
158177

159178
When you have created your configuration, including the [jobs]({{< relref "/integrate/redis-data-integration/data-pipelines/data-pipelines#job-files" >}}), they are

0 commit comments

Comments
 (0)