From c114dcadfb0ddbd0c8648d49ed88db000cf0f7cf Mon Sep 17 00:00:00 2001 From: wayne Date: Thu, 5 Sep 2024 17:30:33 -0600 Subject: [PATCH] fix(clustered): document the use of special symbols PostgeSQL connection strings (#5591) * fix(clustered): document the use of special symbols PostgeSQL connection strings * docs: style fixup Co-authored-by: Scott Anderson * docs: style fixup Co-authored-by: Scott Anderson --------- Co-authored-by: Jason Stirnaman Co-authored-by: Scott Anderson --- .../install/configure-cluster/directly.md | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/content/influxdb/clustered/install/configure-cluster/directly.md b/content/influxdb/clustered/install/configure-cluster/directly.md index 7282cc615..dc11b643d 100644 --- a/content/influxdb/clustered/install/configure-cluster/directly.md +++ b/content/influxdb/clustered/install/configure-cluster/directly.md @@ -544,9 +544,39 @@ We recommend storing sensitive credentials, such as your PostgreSQL-compatible D as secrets in your Kubernetes cluster. {{% /note %}} -- `spec.package.spec.catalog.dsn.valueFrom.secretKeyRef` - - `.name`: Secret name - - `.key`: Key in the secret that contains the DSN +{{% warn %}} +#### Percent-encode special symbols in PostgreSQL DSNs + +Special symbols in PostgreSQL DSNs should be percent-encoded to ensure they +are parsed correctly by InfluxDB Clustered. This is important to consider when +using DSNs containing auto-generated passwords which may include special +symbols to make passwords more secure. + +For example, the following DSN used in InfluxDB Clustered: + +```txt +postgresql://postgres:meow#meow@my-fancy.cloud-database.party:5432/postgres +``` + +Would result in an error similar to: + +```txt +Catalog DSN error: A catalog error occurred: unhandled external error: error with configuration: invalid port number +``` + +To fix this, percent-encode special symbols in the connection string: + +```txt +postgresql://postgres:meow%23meow@my-fancy.cloud-database.party:5432/postgres +``` + +For more information, see the [PostgreSQL Connection URI +docs](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING-URIS). +{{% /warn %}} + +- [ ] `spec.package.spec.catalog.dsn.valueFrom.secretKeyRef` + - [ ] `.name`: Secret name + - [ ] `.key`: Key in the secret that contains the DSN {{% code-placeholders "SECRET_(NAME|KEY)" %}}