diff --git a/docs-site/content/kagent/main/examples/a2a-agents.md b/docs-site/content/kagent/main/examples/a2a-agents.md index 3955e6a5..c53ad8cf 100644 --- a/docs-site/content/kagent/main/examples/a2a-agents.md +++ b/docs-site/content/kagent/main/examples/a2a-agents.md @@ -348,7 +348,7 @@ Build the receiver around these rules: * 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. * A delivery can arrive more than once, or out of order. Treat `GetTask` as the source of truth for the task's current state. -* 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. +* 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. * kagent does not expose delivery status, so nothing reports whether a delivery failed. 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`. | `maxConcurrency` | `10` | The number of deliveries that each controller replica sends at once. Setting `1` sends them one at a time. | | `sendTimeout` | `5s` | How long one HTTP attempt can take before it counts as failed. | | `recoveryInterval` | `60s` | How often an idle controller scans for deliveries that a missed wake-up left pending. | +| `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`. | ### Secure callback deliveries @@ -390,7 +391,9 @@ kagent does not generate its own signing key, so you are responsible for creatin --set config.push.issuer=https://kagent.example ``` - 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. + 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. + + 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. 4. Confirm that the controller publishes a verification key. Before you set the Secret, this path returns `404`. ```bash diff --git a/docs-site/content/kagent/main/operations/operational-considerations.md b/docs-site/content/kagent/main/operations/operational-considerations.md index 066080f3..97928d19 100644 --- a/docs-site/content/kagent/main/operations/operational-considerations.md +++ b/docs-site/content/kagent/main/operations/operational-considerations.md @@ -269,6 +269,7 @@ To sign callbacks, generate one unencrypted PKCS#8 Ed25519 key and store it in a config: push: issuer: https://kagent.example.com + signingKeyActivationDelay: 300s ``` `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 | ------- | ----------- | | `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`. | | `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. | + | `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. | ```bash helm upgrade kagent \ @@ -289,7 +291,9 @@ To sign callbacks, generate one unencrypted PKCS#8 Ed25519 key and store it in a 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. -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. +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. + +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. ## Tune push notification delivery