-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
operator v1: add KUTTL test for deleting a nodepool
- Loading branch information
Showing
8 changed files
with
230 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
operator/tests/e2e-with-flags/nodepools-delete/00-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
kubectl wait --for=condition=ClusterConfigured=True cluster/nodepool-cluster --timeout 300s --namespace $NAMESPACE | ||
kubectl wait --for=condition=OperatorQuiescent=True cluster/nodepool-cluster --timeout 300s --namespace $NAMESPACE | ||
--- | ||
apiVersion: redpanda.vectorized.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: nodepools-delete | ||
status: | ||
readyReplicas: 3 | ||
replicas: 3 | ||
currentReplicas: 3 | ||
upgrading: false | ||
restarting: false | ||
nodePools: | ||
first: | ||
currentReplicas: 3 | ||
readyReplicas: 3 | ||
replicas: 3 | ||
restarting: false | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
collectors: | ||
- command: ../../../hack/get-redpanda-info.sh |
29 changes: 29 additions & 0 deletions
29
operator/tests/e2e-with-flags/nodepools-delete/00-one-nodepool.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: redpanda.vectorized.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: nodepools-delete | ||
spec: | ||
image: "localhost/redpanda" | ||
version: "dev" | ||
nodePools: | ||
- name: first | ||
replicas: 3 | ||
resources: | ||
requests: | ||
cpu: "100m" | ||
memory: 256Mi | ||
limits: | ||
cpu: "100m" | ||
memory: 256Mi | ||
configuration: | ||
rpcServer: | ||
port: 33145 | ||
kafkaApi: | ||
- port: 9092 | ||
adminApi: | ||
- port: 9644 | ||
developerMode: true | ||
additionalCommandlineArguments: | ||
dump-memory-diagnostics-on-alloc-failure-kind: all | ||
abort-on-seastar-bad-alloc: '' | ||
resources: {} |
38 changes: 38 additions & 0 deletions
38
operator/tests/e2e-with-flags/nodepools-delete/01-add-second-pool.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
apiVersion: redpanda.vectorized.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: nodepools-delete | ||
spec: | ||
image: "localhost/redpanda" | ||
version: "dev" | ||
nodePools: | ||
- name: first | ||
replicas: 3 | ||
resources: | ||
requests: | ||
cpu: "100m" | ||
memory: 256Mi | ||
limits: | ||
cpu: "100m" | ||
memory: 256Mi | ||
- name: second | ||
replicas: 3 | ||
resources: | ||
requests: | ||
cpu: "101m" | ||
memory: 257Mi | ||
limits: | ||
cpu: "101m" | ||
memory: 257Mi | ||
configuration: | ||
rpcServer: | ||
port: 33145 | ||
kafkaApi: | ||
- port: 9092 | ||
adminApi: | ||
- port: 9644 | ||
developerMode: true | ||
additionalCommandlineArguments: | ||
dump-memory-diagnostics-on-alloc-failure-kind: all | ||
abort-on-seastar-bad-alloc: '' | ||
resources: {} |
28 changes: 28 additions & 0 deletions
28
operator/tests/e2e-with-flags/nodepools-delete/01-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
kubectl wait --for=condition=ClusterConfigured=True cluster/nodepools-delete --timeout 300s --namespace $NAMESPACE | ||
kubectl wait --for=condition=OperatorQuiescent=True cluster/nodepools-delete --timeout 300s --namespace $NAMESPACE | ||
--- | ||
apiVersion: redpanda.vectorized.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: nodepools-delete | ||
status: | ||
nodePools: | ||
first: | ||
currentReplicas: 3 | ||
readyReplicas: 3 | ||
replicas: 3 | ||
restarting: false | ||
second: | ||
currentReplicas: 3 | ||
readyReplicas: 3 | ||
replicas: 3 | ||
restarting: false | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
collectors: | ||
- command: ../../../hack/get-redpanda-info.sh |
40 changes: 40 additions & 0 deletions
40
operator/tests/e2e-with-flags/nodepools-delete/02-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
kubectl wait --for=delete pod/nodepools-delete-first-2 --timeout 300s --namespace $NAMESPACE | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
kubectl wait --for=delete pod/nodepools-delete-first-1 --timeout 300s --namespace $NAMESPACE | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
kubectl wait --for=delete pod/nodepools-delete-first-0 --timeout 300s --namespace $NAMESPACE | ||
--- | ||
apiVersion: redpanda.vectorized.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: nodepools-delete | ||
status: | ||
readyReplicas: 3 | ||
replicas: 3 | ||
currentReplicas: 3 | ||
upgrading: false | ||
restarting: false | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: | | ||
kubectl wait --for=condition=ClusterConfigured=True cluster/nodepools-delete --timeout 300s --namespace $NAMESPACE | ||
kubectl wait --for=condition=OperatorQuiescent=True cluster/nodepools-delete --timeout 300s --namespace $NAMESPACE | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
collectors: | ||
- command: ../../../hack/get-redpanda-info.sh |
32 changes: 32 additions & 0 deletions
32
operator/tests/e2e-with-flags/nodepools-delete/02-delete-first-nodepool.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Actually delete nodepool, not just scale to zero. | ||
# WITHOUT scaling to zero first. | ||
# Ensure that it goes 3->2->1-0->gone. | ||
apiVersion: redpanda.vectorized.io/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: nodepools-delete | ||
spec: | ||
image: "localhost/redpanda" | ||
version: "dev" | ||
nodePools: | ||
- name: second | ||
replicas: 3 | ||
resources: | ||
requests: | ||
cpu: "101m" | ||
memory: 257Mi | ||
limits: | ||
cpu: "101m" | ||
memory: 257Mi | ||
configuration: | ||
rpcServer: | ||
port: 33145 | ||
kafkaApi: | ||
- port: 9092 | ||
adminApi: | ||
- port: 9644 | ||
developerMode: true | ||
additionalCommandlineArguments: | ||
dump-memory-diagnostics-on-alloc-failure-kind: all | ||
abort-on-seastar-bad-alloc: '' | ||
resources: {} |
4 changes: 4 additions & 0 deletions
4
operator/tests/e2e-with-flags/nodepools-delete/03-assert.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
collectors: | ||
- command: ../../../hack/get-redpanda-info.sh |
31 changes: 31 additions & 0 deletions
31
operator/tests/e2e-with-flags/nodepools-delete/03-clean.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
delete: | ||
- apiVersion: redpanda.vectorized.io/v1alpha1 | ||
kind: Cluster | ||
name: nodepools-delete | ||
namespace: redpanda-system | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
name: datadir-nodepools-delete-0 | ||
namespace: redpanda-system | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
name: datadir-nodepools-delete-1 | ||
namespace: redpanda-system | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
name: datadir-nodepools-delete-2 | ||
namespace: redpanda-system | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
name: datadir-nodepools-delete-3 | ||
namespace: redpanda-system | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
name: datadir-nodepools-delete-4 | ||
namespace: redpanda-system | ||
- apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
name: datadir-nodepools-delete-5 | ||
namespace: redpanda-system |