Skip to content

Commit 7a26828

Browse files
docs improvement
1 parent 3797541 commit 7a26828

4 files changed

Lines changed: 34 additions & 34 deletions

File tree

docs/deploy-guide/components/nautobot-worker.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ The ExternalSecret on the site cluster combines these into a single
173173
`tls.key`, and `ca.crt`. This secret is mounted into worker pods at
174174
`/etc/nautobot/mtls/`.
175175

176-
Note: if your secrets provider stores PEM data with `\r\n` line endings,
177-
the ExternalSecret template must strip carriage returns
178-
(`| replace "\r" ""`) or OpenSSL will fail to parse the certificates.
176+
Note: if your secrets provider stores PEM data with `\r\n` line endings
177+
or concatenates multiple PEM blocks in a single field, use the
178+
[`filterPEM`](https://external-secrets.io/latest/guides/templating/#filter-pem-blocks)
179+
template function to extract specific block types. `filterPEM` handles
180+
carriage-return stripping automatically.
179181

180182
## Adding a New Site
181183

@@ -298,16 +300,9 @@ spec:
298300
engineVersion: v2
299301
type: kubernetes.io/tls
300302
data:
301-
tls.crt: >-
302-
{{ .client_password
303-
| regexFind "-----BEGIN CERTIFICATE-----[\\s\\S]*?-----END CERTIFICATE-----"
304-
| replace "\r" "" }}
305-
tls.key: >-
306-
{{ .client_password
307-
| regexFind "-----BEGIN EC PRIVATE KEY-----[\\s\\S]*?-----END EC PRIVATE KEY-----"
308-
| replace "\r" "" }}
309-
ca.crt: >-
310-
{{ .ca_password | replace "\r" "" }}
303+
tls.crt: '{{ .client_password | filterPEM "CERTIFICATE" }}'
304+
tls.key: '{{ .client_password | filterPEM "EC PRIVATE KEY" }}'
305+
ca.crt: '{{ .ca_password | filterPEM "CERTIFICATE" }}'
311306
dataFrom:
312307
- extract:
313308
key: "<client-cert-credential-id>"
@@ -325,9 +320,10 @@ spec:
325320
326321
{% endraw %}
327322
328-
The `replace "\r" ""` strips carriage returns that some secrets
329-
providers add to PEM data. Without this, OpenSSL will fail to parse
330-
the certificates.
323+
The [`filterPEM`](https://external-secrets.io/latest/guides/templating/#filter-pem-blocks)
324+
function extracts PEM blocks by type and strips carriage returns
325+
automatically. Pass the PEM block type without the `BEGIN`/`END`
326+
markers (e.g. `"CERTIFICATE"`, `"EC PRIVATE KEY"`, `"PRIVATE KEY"`).
331327

332328
### Step 4: Create the kustomization
333329

@@ -534,8 +530,11 @@ operator guide.
534530

535531
- **PEM data with carriage returns.** Some secrets providers store text
536532
with `\r\n` line endings. PEM certificates with `\r` characters will
537-
fail OpenSSL parsing with `[SSL] PEM lib`. The ExternalSecret template
538-
must strip carriage returns using `| replace "\r" ""`.
533+
fail OpenSSL parsing with `[SSL] PEM lib`. Use the
534+
[`filterPEM`](https://external-secrets.io/latest/guides/templating/#filter-pem-blocks)
535+
template function to extract PEM blocks by type -- it handles
536+
carriage-return stripping automatically. Avoid manual `regexFind` +
537+
`replace "\r" ""` patterns.
539538

540539
- **ExternalSecret format depends on your secrets provider.** The
541540
ExternalSecret for the mTLS client cert on site clusters must produce

docs/operator-guide/nautobot-celery-queues.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,8 @@ To confirm a site worker is consuming from the correct queue:
209209

210210
```bash
211211
# Check the CELERY_TASK_QUEUES env var in the running pod
212-
kubectl get deploy -n nautobot \
213-
-l app.kubernetes.io/component=nautobot-celery-rax-dev \
214-
-o jsonpath='{.items[0].spec.template.spec.containers[0].env}' \
215-
| python3 -m json.tool | grep -A1 CELERY_TASK_QUEUES
212+
kubectl -n nautobot get deploy nautobot-worker-celery-rax-dev \
213+
-o jsonpath='{.spec.template.spec.containers[0].env[?(@.name=="CELERY_TASK_QUEUES")].value}'
216214
217215
# Check worker logs for the queue binding
218216
kubectl logs -n nautobot \

docs/operator-guide/nautobot-mtls-certificate-renewal.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ Check certificate status on the global cluster:
9999

100100
```bash
101101
# List all mTLS client certificates and their expiry
102-
kubectl get certificate -n nautobot -o custom-columns=\
103-
NAME:.metadata.name,\
104-
READY:.status.conditions[0].status,\
105-
EXPIRY:.status.notAfter,\
106-
RENEWAL:.status.renewalTime
102+
kubectl get certificate -n nautobot -o custom-columns='NAME:.metadata.name,READY:.status.conditions[0].status,EXPIRY:.status.notAfter,RENEWAL:.status.renewalTime'
107103
108104
# Check a specific site's certificate
109105
kubectl describe certificate nautobot-mtls-client-<site> -n nautobot

docs/operator-guide/nautobot.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,24 @@ Then force a CNPG reconcile (see above).
156156
### Restarting CNPG Pods
157157

158158
If the CNPG pods have not picked up updated certificate secrets (e.g.
159-
`client-ca.crt` still shows the old CA), restart them one at a time:
159+
`client-ca.crt` still shows the old CA), use the `cnpg` kubectl plugin
160+
to perform a rolling restart:
160161

161162
```bash
162-
kubectl delete pod -n nautobot nautobot-cluster-2
163-
# wait for ready
164-
kubectl delete pod -n nautobot nautobot-cluster-3
165-
# wait for ready
166-
kubectl delete pod -n nautobot nautobot-cluster-1
163+
kubectl cnpg restart nautobot-cluster -n nautobot
164+
```
165+
166+
This performs a rolling restart of all instances, handling replica/primary
167+
ordering automatically and waiting for each pod to be ready before
168+
proceeding.
169+
170+
If you only need pods to reload configuration (e.g. updated `pg_hba`
171+
or PostgreSQL parameters) without a full restart:
172+
173+
```bash
174+
kubectl cnpg reload nautobot-cluster -n nautobot
167175
```
168176

169-
Start with replicas, then the primary, to minimize downtime.
170177

171178
### pg_hba Behavior
172179

0 commit comments

Comments
 (0)