Skip to content

Commit 6f9ac38

Browse files
github-actions[bot]actions-userRachael-Graham
authored
[Automated] Draft docs (kagent): controller/push: hot reload signing keys with staged activation (#750)
* [Automated] Draft docs (kagent): controller/push: hot reload signing keys with staged activation Signed-off-by: GitHub Action <action@github.com> * conventions Signed-off-by: Rachael Graham <rachael.graham@solo.io> --------- Signed-off-by: GitHub Action <action@github.com> Signed-off-by: Rachael Graham <rachael.graham@solo.io> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Rachael Graham <rachael.graham@solo.io>
1 parent 2856a4a commit 6f9ac38

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎docs-site/content/kagent/main/examples/a2a-agents.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ Build the receiver around these rules:
348348

349349
* Any `2xx` response acknowledges a delivery. Every other response counts as a failed attempt, and a redirect is one of them, so register the final callback URL.
350350
* A delivery can arrive more than once, or out of order. Treat `GetTask` as the source of truth for the task's current state.
351-
* kagent makes up to ten attempts for each state that a task publishes, and the count carries across controller restarts. After the last attempt, kagent drops that delivery but keeps the callback registered, so the next state still reaches the receiver.
351+
* The controller makes up to 20 attempts for each state that a task publishes, and the count carries across controller restarts. Retry waits start at 5 seconds and double to a maximum of 60 seconds. After the last attempt, the controller drops that delivery but keeps the callback registered, so the next state still reaches the receiver.
352352
* kagent does not expose delivery status, so nothing reports whether a delivery failed.
353353

354354
To tune delivery, configure the following Helm values under `config.push`.
@@ -358,6 +358,7 @@ To tune delivery, configure the following Helm values under `config.push`.
358358
| `maxConcurrency` | `10` | The number of deliveries that each controller replica sends at once. Setting `1` sends them one at a time. |
359359
| `sendTimeout` | `5s` | How long one HTTP attempt can take before it counts as failed. |
360360
| `recoveryInterval` | `60s` | How often an idle controller scans for deliveries that a missed wake-up left pending. |
361+
| `signingKeyActivationDelay` | `300s` | How long the controller publishes a replacement signing key before it signs callbacks with the replacement key. Use a value that covers the interval at which the receiver refreshes its cached JSON Web Key Set (JWKS). The maximum is `86400s`. |
361362

362363
### Secure callback deliveries
363364

@@ -390,7 +391,9 @@ kagent does not generate its own signing key, so you are responsible for creatin
390391
--set config.push.issuer=https://kagent.example
391392
```
392393

393-
The issuer that a receiver trusts must match the host that it fetches the JSON Web Key Set (JWKS) from. When you omit `config.push.issuer`, Helm derives it from `ui.externalUrl` and then from the in-cluster A2A gateway URL. Either fallback can point to a host that does not serve the JWKS.
394+
The issuer that a receiver trusts must match the host that it fetches the JWKS from. When you omit `config.push.issuer`, Helm derives it from `ui.externalUrl` and then from the in-cluster A2A gateway URL. Either fallback can point to a host that does not serve the JWKS.
395+
396+
To rotate a key without interrupting signed deliveries, update the Secret, and set `config.push.signingKeyActivationDelay` to a value that covers the JWKS cache refresh of your receivers. The controller reloads the mounted key file every 15 seconds, publishes the replacement public key before it signs callbacks with the key, and adds a fixed 30-second buffer to the configured delay.
394397

395398
4. Confirm that the controller publishes a verification key. Before you set the Secret, this path returns `404`.
396399
```bash

‎docs-site/content/kagent/main/operations/operational-considerations.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ To sign callbacks, generate one unencrypted PKCS#8 Ed25519 key and store it in a
269269
config:
270270
push:
271271
issuer: https://kagent.example.com
272+
signingKeyActivationDelay: 300s
272273
```
273274

274275
`controller.push.signing` configures the Kubernetes packaging of the key, and `config.push` configures the controller.
@@ -277,6 +278,7 @@ To sign callbacks, generate one unencrypted PKCS#8 Ed25519 key and store it in a
277278
| ------- | ----------- |
278279
| `controller.push.signing.secretName` | The Secret that holds `private-key.pem`. Leave it empty to send push notifications without JSON Web Token (JWT) authentication. Helm references a Secret that you create, and neither generates nor rotates signing keys. If you set this field, the chart mounts the key and sets `config.push.signingPrivateKeyFile` to `/etc/kagent/secrets/push-private-key.pem`. |
279280
| `config.push.issuer` | The stable URL that webhook receivers trust as the JWT issuer. If you omit the key, the chart derives the issuer from `ui.externalUrl`, and then from the in-cluster A2A gateway URL. An empty string is rejected, because the controller requires an absolute `http://` or `https://` URL. |
281+
| `config.push.signingKeyActivationDelay` | How long the controller publishes a replacement public key before it signs callbacks with the replacement key. The default is `300s`, and the maximum is `86400s`. Add enough time for receivers to refresh their JWKS cache. The controller also adds a fixed 30-second buffer before signing with the replacement key. |
280282

281283
```bash
282284
helm upgrade kagent \
@@ -289,7 +291,9 @@ To sign callbacks, generate one unencrypted PKCS#8 Ed25519 key and store it in a
289291

290292
When a signing key is configured, each callback attempt carries a newly issued five-minute Ed25519 JWT in an `Authorization: Bearer` header, and the `/.well-known/jwks.json` endpoint publishes the matching public key.
291293

292-
Every controller replica must load the same key. After you rotate the key, restart all controller pods together, because replicas that run on different keys publish different JSON Web Key Sets.
294+
Every controller replica must load the same key. The controller reopens the mounted key file every 15 seconds, so a Secret or Container Storage Interface (CSI) rotation does not need a controller restart. The JWKS endpoint publishes the replacement public key as soon as a replica reloads the key, but the replica keeps signing with the previous key until `config.push.signingKeyActivationDelay` plus the 30-second buffer passes. After activation, the previous public key stays in the JWKS until the five-minute tokens that it signed expire, plus 30 seconds of clock skew.
295+
296+
Restarting the controller loses key history. After a restart, the controller immediately signs with the key that is mounted in the pod and publishes only that key.
293297

294298
## Tune push notification delivery
295299

0 commit comments

Comments
 (0)