Skip to content

Commit 5d9281c

Browse files
yanmxaclaude
andcommitted
🐛 Add server-cert Secret validation and clarify namespace in TLS docs
- Add lookup/fail guard for server-cert Secret in superlink.yaml to fail fast when the Secret is missing (mirrors existing CA Secret validation) - Update TLS docs to clarify namespace assumptions and guide users to pass matching --namespace when overriding superlink.namespace Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Meng Yan <myan@redhat.com>
1 parent 7a4262a commit 5d9281c

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

flower-addon/charts/flower-addon/templates/superlink.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{{- if .Values.superlink.enabled }}
2+
{{- if .Values.tls.enabled }}
3+
{{- $serverSecret := (lookup "v1" "Secret" .Values.superlink.namespace .Values.tls.serverCert.secretName) }}
4+
{{- if not $serverSecret }}
5+
{{- fail (printf "TLS enabled but Secret '%s/%s' not found. Run hack/generate-certs.sh first." .Values.superlink.namespace .Values.tls.serverCert.secretName) }}
6+
{{- end }}
7+
{{- end }}
28
apiVersion: apps/v1
39
kind: Deployment
410
metadata:

flower-addon/docs/enable-tls.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ cd flower-addon
1616
./hack/generate-certs.sh --hub-ip <HUB_NODE_IP>
1717
```
1818

19-
This creates two Kubernetes Secrets in `flower-system`:
20-
- `flower-tls-ca` — CA certificate and key
19+
This creates two Kubernetes Secrets in `flower-system` (default namespace). If you override `superlink.namespace` in Helm values, pass the same namespace here:
20+
21+
```bash
22+
./hack/generate-certs.sh --hub-ip <HUB_NODE_IP> --namespace <YOUR_NAMESPACE>
23+
```
24+
25+
- `flower-tls-ca` — CA certificate and key (used to verify server identity)
2126
- `flower-superlink-tls` — SuperLink server certificate, key, and CA cert
2227

2328
The server certificate SANs include:
@@ -51,6 +56,7 @@ root-certificates = "/path/to/ca.crt"
5156
Extract the CA cert from the cluster:
5257

5358
```bash
59+
# Use the same namespace as your SuperLink deployment (default: flower-system)
5460
kubectl get secret flower-tls-ca -n flower-system -o jsonpath='{.data.ca\.crt}' | base64 -d > ca.crt
5561
```
5662

0 commit comments

Comments
 (0)