Skip to content

Commit 32e0dcb

Browse files
authored
Merge pull request #147 from Obmondo/fix/buzz-ingress-defaults
fix(buzz): correct chart defaults that break real deployments
2 parents b6ff1db + ed08069 commit 32e0dcb

2 files changed

Lines changed: 63 additions & 14 deletions

File tree

argocd-helm-charts/buzz/README.md

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,30 @@ it is unusable under ArgoCD.
5757
| `REDIS_URL` | at `replicaCount > 1` | `redis://buzz-redis:6379` |
5858
| `BUZZ_S3_ACCESS_KEY` | yes in practice | Access key for the bucket |
5959
| `BUZZ_S3_SECRET_KEY` | yes in practice | Secret key for the bucket |
60-
| `BUZZ_RELAY_PRIVATE_KEY` | no | 64-char hex relay identity. Generated on first install if absent — **back it up**, rotating it changes the relay's identity |
60+
| `BUZZ_RELAY_PRIVATE_KEY` | in practice yes | 64-char hex relay identity — see below |
6161
| `BUZZ_GIT_HOOK_HMAC_SECRET` | at `replicaCount > 1` | 32+ random characters |
6262

6363
`<password>` is the same one sealed into `buzz-pgsql-credentials`.
6464

65+
`BUZZ_RELAY_PRIVATE_KEY` is optional to the relay but should always be set here. Upstream generates
66+
one on first install, but only into the Secret the chart manages itself; with `existingSecret` set
67+
that Secret is never rendered, so nothing generates the key and **the relay takes a new identity on
68+
every restart**. Seal one and treat it as a backup — changing it changes who the relay is, and
69+
federation peers will not recognise it.
70+
71+
```sh
72+
openssl rand -hex 32 # BUZZ_RELAY_PRIVATE_KEY
73+
openssl rand -hex 24 # BUZZ_GIT_HOOK_HMAC_SECRET
74+
```
75+
6576
```sh
6677
kubectl create secret generic buzz-secrets \
6778
--namespace buzz \
6879
--from-literal=DATABASE_URL='postgres://buzz:<password>@buzz-pgsql-rw:5432/buzz' \
6980
--from-literal=REDIS_URL='redis://buzz-redis:6379' \
7081
--from-literal=BUZZ_S3_ACCESS_KEY='<access-key>' \
7182
--from-literal=BUZZ_S3_SECRET_KEY='<secret-key>' \
83+
--from-literal=BUZZ_RELAY_PRIVATE_KEY='<64-hex>' \
7284
--dry-run=client -o yaml | kubeseal -o yaml > buzz-secrets.yaml
7385
```
7486

@@ -86,6 +98,26 @@ tracks a newer chart version.
8698

8799
The bucket must not be folded into `buzz.s3.endpoint`; the two are passed separately.
88100

101+
## Ingress
102+
103+
`buzz.ingress.className` and `buzz.ingress.annotations` are deliberately empty. Helm merges annotation
104+
maps, so a default here would appear on every install and could not be removed downstream — set both
105+
per cluster.
106+
107+
Relay traffic is long-lived WebSockets. On NGINX raise the timeouts, or connections drop after the
108+
60s default:
109+
110+
```yaml
111+
buzz:
112+
ingress:
113+
className: nginx
114+
annotations:
115+
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
116+
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
117+
```
118+
119+
Traefik proxies WebSockets without extra configuration.
120+
89121
## Relay membership
90122
91123
`buzz.relay.requireRelayMembership` is `false` here, which runs an open relay and needs no operator
@@ -98,7 +130,25 @@ operator's 64-char lowercase hex Nostr pubkey; the chart refuses to render witho
98130
fails rendering otherwise. Git state lives in object storage, so `ReadWriteOnce` volumes stay correct
99131
at any replica count — no ReadWriteMany storage is needed.
100132

133+
## Git storage
134+
135+
`persistence.git.enabled` is `false`, so git working space is an emptyDir. That is deliberate.
136+
137+
The upstream Deployment hardcodes `strategy.rollingUpdate.maxUnavailable: 0` and exposes no value to
138+
change it, so a rollout requires the replacement pod to be running before the old one exits. A
139+
ReadWriteOnce volume — which is what most block storage classes give you, rook-ceph-block included —
140+
cannot attach to two nodes at once, so **every rollout deadlocks on `Multi-Attach`** and the
141+
Deployment never converges.
142+
143+
Nothing durable is lost. Git objects are rehydrated from object storage on each request and
144+
repo-name uniqueness lives in Postgres, which is why upstream dropped its ReadWriteMany requirement.
145+
The only cost is a cold cache after a restart.
146+
147+
Enable the PVC only with a ReadWriteMany storage class, where both pods can hold the volume during a
148+
rollout.
149+
101150
## Backups
102151

103-
Losing any of these is data loss: `BUZZ_RELAY_PRIVATE_KEY`, the PostgreSQL database, the S3 bucket,
104-
and the git PVC. Enable `global.postgresql.backups` / `logicalbackup` for the database.
152+
Losing any of these is data loss: `BUZZ_RELAY_PRIVATE_KEY`, the PostgreSQL database, and the S3
153+
bucket. Enable `global.postgresql.backups` / `logicalbackup` for the database. Git state lives in the
154+
bucket, not on disk, so the relay's local storage needs no backup.

argocd-helm-charts/buzz/values.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,22 @@ buzz:
7373
endpoint: https://buckets.example.com
7474
bucket: buzz-media
7575

76-
# Git repo state is object-store-backed, so ReadWriteOnce is enough at any
77-
# replica count.
76+
# emptyDir by default: the upstream Deployment hardcodes maxUnavailable: 0, so
77+
# a rollout needs the new pod running before the old one exits, which a
78+
# ReadWriteOnce volume can never satisfy — every rollout deadlocks on
79+
# Multi-Attach. Nothing durable lives here. See README.md before enabling.
7880
persistence:
7981
git:
80-
enabled: true
81-
accessMode: ReadWriteOnce
82+
enabled: false
8283
size: 10Gi
83-
# storageClass: ""
8484

85+
# Class and annotations are left to the cluster: Helm merges annotation maps,
86+
# so anything set here leaks into every install and cannot be removed
87+
# downstream. See README.md for the NGINX WebSocket timeouts.
8588
ingress:
8689
enabled: true
87-
className: nginx
88-
annotations:
89-
cert-manager.io/cluster-issuer: letsencrypt
90-
# Relay connections are long-lived WebSockets; the 60s default cuts them.
91-
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
92-
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
90+
className: ""
91+
annotations: {}
9392
tls:
9493
- hosts:
9594
- buzz.example.com

0 commit comments

Comments
 (0)