Skip to content

Commit 5fbd0eb

Browse files
committed
update operations test
1 parent a5a700f commit 5fbd0eb

5 files changed

Lines changed: 69 additions & 3 deletions

File tree

tests/templates/kuttl/operations-kraft/60-assert.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ kind: StatefulSet
1717
metadata:
1818
name: test-kafka-controller-default
1919
status:
20-
readyReplicas: 1
21-
replicas: 1
20+
readyReplicas: 5
21+
replicas: 5

tests/templates/kuttl/operations-kraft/60-scale-controller-down.yaml.j2 renamed to tests/templates/kuttl/operations-kraft/60-scale-controller-up.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
2626
roleGroups:
2727
default:
28-
replicas: 1
28+
replicas: 5
2929
brokers:
3030
config:
3131
logging:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
timeout: 300
5+
commands:
6+
- script: kubectl -n $NAMESPACE wait --for=condition=available kafkaclusters.kafka.stackable.tech/test-kafka --timeout 301s
7+
---
8+
apiVersion: apps/v1
9+
kind: StatefulSet
10+
metadata:
11+
name: test-kafka-broker-default
12+
status:
13+
readyReplicas: 3
14+
replicas: 3
15+
apiVersion: apps/v1
16+
kind: StatefulSet
17+
metadata:
18+
name: test-kafka-controller-default
19+
status:
20+
readyReplicas: 3
21+
replicas: 3
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestStep
4+
timeout: 300
5+
---
6+
apiVersion: kafka.stackable.tech/v1alpha1
7+
kind: KafkaCluster
8+
metadata:
9+
name: test-kafka
10+
spec:
11+
image:
12+
{% if test_scenario['values']['kafka-kraft'].find(",") > 0 %}
13+
custom: "{{ test_scenario['values']['kafka-kraft'].split(',')[1] }}"
14+
productVersion: "{{ test_scenario['values']['kafka-kraft'].split(',')[0] }}"
15+
{% else %}
16+
productVersion: "{{ test_scenario['values']['kafka-kraft'] }}"
17+
{% endif %}
18+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
19+
clusterConfig:
20+
vectorAggregatorConfigMapName: vector-aggregator-discovery
21+
{% endif %}
22+
controllers:
23+
config:
24+
logging:
25+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
26+
roleGroups:
27+
default:
28+
replicas: 3
29+
brokers:
30+
config:
31+
logging:
32+
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
33+
roleGroups:
34+
default:
35+
replicas: 3
36+
clusterOperation:
37+
stopped: false
38+
reconciliationPaused: false

tests/templates/kuttl/operations-kraft/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ Tests Kraft cluster operations:
44
- Cluster stop/pause/restart
55
- Scale brokers up/down
66
- Scale controllers up/down
7+
8+
TODO:
9+
10+
- Scaling controllers from 3 -> 1 doesn't work.
11+
Both brokers and controllers try to communicate with old controllers.
12+
This is why, the last step scales from 5 -> 3 controllers.
13+
This at least, leaves the cluster in a working state.

0 commit comments

Comments
 (0)