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
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 certificates used to establish secure connections. The general pattern of the commands is:
79
-
71
+
The script offers functionality to retrieve a specific secret, as well as the capability to list all available secrets within the system:
80
72
```bash
81
-
kubectl create secret generic <DB>-ssl \
82
-
--namespace=rdi \
83
-
--from-file=<FILE-NAME>=<FILE-PATH>
73
+
# Get specific secret
74
+
scripts/rdi-secret.sh set<SECRET-KEY>
75
+
76
+
# List all secrets
77
+
scripts/rdi-secret.sh list
84
78
```
85
79
86
-
When you create these secrets, ensure that all certificates and keys are in `PEM` format. The only exception to this is that for PostgreSQL, the private key in the `source-db-ssl` secret (the `client.key` file) must be in `DER` format. If you have a key in `PEM` format, you must convert it to `DER` before creating the `source-db-ssl` secret using the command:
80
+
When you create secrets for TLS or mTLS, ensure that all certificates and keys are in `PEM` format. The only exception to this is that for PostgreSQL, the private key `SOURCE_DB_KEY` secret (the `client.key` file) must be in `DER` format. If you have a key in `PEM` format, you must convert it to `DER` before creating the `SOURCE_DB_KEY` secret using the command:
This command assumes that the private key is not encrypted. See the [`openssl` documentation](https://docs.openssl.org/master/) to learn how to convert an encrypted private key.
93
-
87
+
94
88
The specific command lines for source secrets are as follows:
scripts/rdi-secret.sh set TARGET_DB_USERNAME yourUsername
128
+
scripts/rdi-secret.sh set TARGET_DB_PASSWORD yourPassword
129
+
# Verify that the secrets are created/updated
130
+
scripts/rdi-secret.sh get TARGET_DB_USERNAME
131
+
scripts/rdi-secret.sh get TARGET_DB_PASSWORD
173
132
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, so you *must* use the values shown in the example above. You should only change the certificate paths when you create the `source-db-ssl` and `target-db-ssl` secrets.
133
+
# With source TLS
134
+
scripts/rdi-secret.sh set TARGET_DB_USERNAME yourUsername
135
+
scripts/rdi-secret.sh set TARGET_DB_PASSWORD yourPassword
136
+
scripts/rdi-secret.sh set TARGET_DB_CACERT /path/to/myca.crt
137
+
# Verify that the secrets are created/updated
138
+
scripts/rdi-secret.sh get TARGET_DB_USERNAME
139
+
scripts/rdi-secret.sh get TARGET_DB_PASSWORD
140
+
scripts/rdi-secret.sh get TARGET_DB_CACERT
141
+
142
+
# With source mTLS
143
+
scripts/rdi-secret.sh set TARGET_DB_USERNAME yourUsername
144
+
scripts/rdi-secret.sh set TARGET_DB_PASSWORD yourPassword
145
+
scripts/rdi-secret.sh set TARGET_DB_CACERT /path/to/myca.crt
146
+
scripts/rdi-secret.sh set TARGET_DB_CERT /path/to/myclient.crt
147
+
scripts/rdi-secret.sh set TARGET_DB_KEY /path/to/myclient.key
148
+
scripts/rdi-secret.sh set TARGET_DB_KEY_PASSWORD yourKeyPassword # add this only if TARGET_DB_KEY is password-protected
0 commit comments