Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions charts/kates-platform/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: kates-platform
description: Umbrella chart for the full Kates platform — Kafka, Kates, and supporting infrastructure
icon: https://raw.githubusercontent.com/bmscomp/kates/main/docs/assets/charts/kates-platform.svg
type: application
# Patch: the umbrella packs kates 0.19.5 (the CNPG JDBC URL's 30 s socket timeout).
version: 0.9.5
# Minor: the umbrella packs kates 0.20.0 (rbac.directChaos grants what NODE_DRAIN needs).
version: 0.10.0
appVersion: "1.0.0"
keywords:
- kafka
Expand Down Expand Up @@ -41,6 +41,8 @@ dependencies:
condition: connect-cluster.enabled
annotations:
artifacthub.io/changes: |
- kind: changed
description: "Packs kates 0.20.0: rbac.directChaos also grants patch on nodes and create on pods/eviction, for NODE_DRAIN on the kubernetes chaos provider. The default role is unchanged."
- kind: changed
description: "Packs kates 0.19.5: with cnpg.enabled, the JDBC URL's socketTimeout is 30 s, the backend's own. Templates are otherwise unchanged."
- kind: changed
Expand Down
6 changes: 4 additions & 2 deletions charts/kates/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: kates
description: Kates — Kafka Advanced Testing & Engineering Suite
type: application
# Patch: with cnpg.enabled, the JDBC URL's socket timeout is 30 s, as the backend's own.
version: 0.19.5
# Minor: rbac.directChaos grants patch on nodes and create on pods/eviction, for NODE_DRAIN.
version: 0.20.0
# The non-blocking health endpoints this chart's probes now point at come from
# a BUILD-TIME property (quarkus.messaging.health.enabled=false), so they only
# exist in the image built from this branch. Keep appVersion and
Expand All @@ -27,6 +27,8 @@ annotations:
artifacthub.io/category: integration-delivery
artifacthub.io/license: Apache-2.0
artifacthub.io/changes: |
- kind: added
description: "rbac.directChaos also grants patch on nodes and create on pods/eviction: on the kubernetes chaos provider, NODE_DRAIN cordons a node, evicts its pods and uncordons it. MEMORY_STRESS and DISK_FILL run there too, through pods/ephemeralcontainers, which it already granted. They need a Kates image that has them; the default role is unchanged"
- kind: changed
description: "With cnpg.enabled, the JDBC URL's socketTimeout is 30 s instead of 60 s, the backend's own: a request against an unreachable database is answered 503 within about 30 s. Templates are otherwise unchanged."
- kind: changed
Expand Down
6 changes: 4 additions & 2 deletions charts/kates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,13 @@ With the default chaos provider, `litmus-crd`, Kates creates and watches `ChaosE
| Resource | Verbs | Used by |
|----------|-------|---------|
| `apps` `statefulsets/scale` | `get`, `update` | On a Kafka that Strimzi does not manage: `SCALE_DOWN`, its rollback and orphan recovery set replicas |
| `pods/ephemeralcontainers` | `update` | `CPU_STRESS` and `IO_STRESS` add a stress container to the target pod |
| `pods/ephemeralcontainers` | `update` | `CPU_STRESS`, `MEMORY_STRESS` and `IO_STRESS` add a stress container to the target pod; `DISK_FILL` adds one that fills its data volume |
| `nodes` | `patch` | `NODE_DRAIN` cordons the node and uncordons it when the duration ends; orphan recovery uncordons a node a drain left cordoned |
| `pods/eviction` | `create` | `NODE_DRAIN` evicts the pods on the node, in every namespace, through the Eviction API |

`NETWORK_PARTITION` needs none of these, on either backend: Kates creates its deny-all NetworkPolicy itself, and cleanup, rollback and startup orphan recovery delete it, so the default role grants `create`, `delete` and `deletecollection` on `networkpolicies`. `ROLLING_RESTART` needs none of them either, and neither does `SCALE_DOWN` on a Strimzi cluster. On a Strimzi cluster `ROLLING_RESTART` annotates the Kafka pods for the Strimzi Cluster Operator to roll, and on a plain StatefulSet, such as `charts/legacy-kafka`, it restarts the StatefulSet. `SCALE_DOWN` lowers `spec.replicas` of a KafkaNodePool. Both run on either backend, so the default role grants `patch` on pods, on StatefulSets and on `kafkanodepools`. On a Kafka that Strimzi does not manage, `SCALE_DOWN` also patches the StatefulSet, to record its original replica count.

These rules are cluster-wide, like the rest of the role, and `pods/ephemeralcontainers` lets Kates start a container in any pod. Leave them off unless you use the direct backend. It is selected with `chaos.provider`:
These rules are cluster-wide, like the rest of the role, `pods/ephemeralcontainers` lets Kates start a container in any pod, and `nodes` `patch` with `pods/eviction` lets it drain any node. Leave them off unless you use the direct backend. It is selected with `chaos.provider`:

```yaml
chaos:
Expand Down
12 changes: 10 additions & 2 deletions charts/kates/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,23 @@ rules:
every experiment as its own litmus-admin service account, so a Litmus
install needs none of them. On a Kafka that Strimzi does not manage,
SCALE_DOWN sets replicas through the StatefulSet's scale subresource (its
PATCH on the StatefulSet is granted above, for ROLLING_RESTART); CPU_STRESS
and IO_STRESS add a container through pods/ephemeralcontainers.
PATCH on the StatefulSet is granted above, for ROLLING_RESTART); CPU_STRESS,
MEMORY_STRESS, IO_STRESS and DISK_FILL add a container through
pods/ephemeralcontainers; NODE_DRAIN cordons and uncordons a node (patch)
and evicts its pods in every namespace through pods/eviction.
*/}}
- apiGroups: ["apps"]
resources: ["statefulsets/scale"]
verbs: ["get", "update"]
- apiGroups: [""]
resources: ["pods/ephemeralcontainers"]
verbs: ["update"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["patch"]
- apiGroups: [""]
resources: ["pods/eviction"]
verbs: ["create"]
{{- end }}
{{- with .Values.rbac.extraRules }}
{{- toYaml . | nindent 2 }}
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/mcp_tools_chaos.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ var mcpCaveatsChaos = []mcpCaveat{
"CompletableFuture.delayedExecutor(spec.delayBeforeSec(), TimeUnit.SECONDS, executor.get());",
"long startNanos = System.nanoTime();", "buildChaosEngine(spec, engineName, experimentName)",
"onInject.accept(startNanos);", ".resource(engine)"),
mcpAnchoredRef(mcpJava+"chaos/KubernetesChaosProvider.java:170-182",
mcpAnchoredRef(mcpJava+"chaos/KubernetesChaosProvider.java:178-190",
"Thread.sleep(spec.delayBeforeSec() * 1000L);", "onInject.accept(startNanos);",
"applyDisruption(spec, engineName, marks);"),
mcpAnchoredRef(mcpJava+"chaos/PodTargets.java:58,69-75",
Expand Down Expand Up @@ -316,7 +316,7 @@ var mcpCaveatsChaos = []mcpCaveat{
"starts while another runs a plan marks that plan's report too, until the plan ends and stores its " +
"outcome.",
Refs: []string{
mcpJava + "disruption/DisruptionOrphanReconciler.java:71-75,80-109,116-166,334-368",
mcpJava + "disruption/DisruptionOrphanReconciler.java:71-75,80-109,116-168,387-421",
mcpJava + "disruption/DisruptionReportRepository.java:35-60,93-102",
mcpJava + "disruption/DisruptionPersistence.java:26-37",
mcpJava + "disruption/DisruptionLauncher.java:114-121,129-144",
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/mcp_tools_runs_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func mcpActivityTestsSince(ctx context.Context, call *mcpCall, since time.Time,
// are injected for part of its run, or one whose backend process stopped
// before it ended and has not started again to mark it INTERRUPTED
// (DisruptionLauncher.java:95-123, DisruptionReportRepository.java:35-43,
// DisruptionOrphanReconciler.java:359-393).
// DisruptionOrphanReconciler.java:412-446).
func mcpActivityDisruptionsSince(ctx context.Context, call *mcpCall, since time.Time, page mcpActivityPage) (mcpActivityDisruptions, error) {
out := mcpActivityDisruptions{StoredAsRunning: []mcpActivityDisruptionRow{}, Since: []mcpActivityDisruptionRow{}}
for p := 0; p < mcpActivityMaxPages; p++ {
Expand Down Expand Up @@ -486,7 +486,7 @@ var mcpCaveatsRunsActivity = []mcpCaveat{
mcpJava + "disruption/DisruptionLauncher.java:114-144",
mcpJava + "disruption/DisruptionPersistence.java:16-37",
mcpJava + "disruption/DisruptionReportRepository.java:20-43",
mcpJava + "disruption/DisruptionOrphanReconciler.java:334-368",
mcpJava + "disruption/DisruptionOrphanReconciler.java:387-421",
mcpJava + "disruption/DisruptionTemplateResource.java:70-72",
mcpJava + "disruption/DisruptionScheduler.java:112-124",
mcpJava + "disruption/DisruptionReportEntity.java:39-47",
Expand Down
2 changes: 1 addition & 1 deletion cli/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ that sets a field its run doesn't read, or that the API would refuse.
| `networkLatencyMs` | int | Added latency ms (`NETWORK_LATENCY`) |
| `targetTopic` | string | A disruption plan aims a fault at the leader of this topic's `targetPartition`. A resilience run doesn't, but a `DNS_ERROR` on `litmus-crd` takes it as `TARGET_HOSTNAMES`. It has to be a Kafka topic name: letters, digits, `.`, `_` or `-` |
| `targetPartition` | int | Partition of `targetTopic`, in a disruption plan only |
| `envOverrides` | map | Env vars for the Litmus experiment (`litmus-crd` only). Only `TARGET_NODE` or `NODE_LABEL`, which pick the node a `NODE_DRAIN` drains instead of the pod `targetLabel` picks; any other variable is refused |
| `envOverrides` | map | Only `TARGET_NODE` or `NODE_LABEL`, which pick the node a `NODE_DRAIN` drains instead of the pod `targetLabel` picks, on either chaos provider; any other variable is refused |

### `probes` field reference

Expand Down
Loading
Loading