Skip to content

Commit

Permalink
k8s: Chnage any 2 node test cluster into 3
Browse files Browse the repository at this point in the history
Turns out if cluster has only 2 nodes it the maintanace mode can not be enabled
on any node within cluster. Draning is constantly returned and never finished.
This change bumps any test to have 3 node cluster.
  • Loading branch information
Rafal Korepta committed Jan 4, 2023
1 parent 817571e commit eae69eb
Show file tree
Hide file tree
Showing 31 changed files with 490 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Cluster
metadata:
name: centralized-configuration-tls
status:
replicas: 2
replicas: 3
restarting: false
conditions:
- type: ClusterConfigured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
image: "localhost/redpanda"
version: "dev"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Cluster
metadata:
name: centralized-configuration-tls
status:
replicas: 2
replicas: 3
restarting: false
conditions:
- type: ClusterConfigured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
image: "localhost/redpanda"
version: "dev"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Cluster
metadata:
name: centralized-configuration-tls
status:
replicas: 2
replicas: 3
restarting: false
conditions:
- type: ClusterConfigured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
image: "localhost/redpanda"
version: "dev"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Cluster
metadata:
name: centralized-configuration-tls
status:
replicas: 2
replicas: 3
restarting: false
conditions:
- type: ClusterConfigured
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
image: "localhost/redpanda"
version: "dev"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: centralized-configuration-upgrade
status:
readyReplicas: 2
readyReplicas: 3
---

apiVersion: kuttl.dev/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
image: "vectorized/redpanda"
version: "v22.1.10"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: centralized-configuration-upgrade
status:
readyReplicas: 2
readyReplicas: 3
---

apiVersion: v1
Expand All @@ -30,6 +30,18 @@ status:
phase: "Running"
---

apiVersion: v1
kind: Pod
metadata:
name: centralized-configuration-upgrade-2
spec:
containers:
- name: redpanda
image: "vectorized/redpanda:v22.1.10"
status:
phase: "Running"
---

apiVersion: kuttl.dev/v1beta1
kind: TestAssert
collectors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
image: "vectorized/redpanda"
version: "v22.1.10"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
image: "vectorized/redpanda"
version: "v22.2.8"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
25 changes: 8 additions & 17 deletions src/go/k8s/tests/e2e/update-image-and-node-port/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,7 @@ kind: StatefulSet
metadata:
name: update-image-cluster-and-node-port
status:
readyReplicas: 2

---

apiVersion: kuttl.dev/v1beta1
kind: TestAssert
collectors:
- type: pod
pod: update-image-cluster-and-node-port-0

---

apiVersion: kuttl.dev/v1beta1
kind: TestAssert
collectors:
- type: pod
pod: update-image-cluster-and-node-port-1
readyReplicas: 3

---

Expand Down Expand Up @@ -59,3 +43,10 @@ metadata:
name: update-image-cluster-and-node-port
status:
version: "v22.1.10"
readyReplicas: 3
replicas: 3
upgrading: false
restarting: false
conditions:
- type: ClusterConfigured
status: "True"
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ metadata:
spec:
image: "vectorized/redpanda"
version: "v22.1.10"
replicas: 2
replicas: 3
resources:
requests:
cpu: 100m
Expand Down
36 changes: 35 additions & 1 deletion src/go/k8s/tests/e2e/update-image-and-node-port/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: update-image-cluster-and-node-port
status:
readyReplicas: 2
readyReplicas: 3

---

Expand Down Expand Up @@ -61,6 +61,33 @@ status:

---

apiVersion: v1
kind: Pod
metadata:
name: update-image-cluster-and-node-port-2
spec:
containers:
- name: redpanda
image: "vectorized/redpanda:v22.2.8"
volumeMounts:
- mountPath: /etc/redpanda
name: config-dir
- mountPath: /scripts
name: hook-scripts-dir
- mountPath: /etc/redpanda/.bootstrap.yaml
name: configmap-dir
subPath: .bootstrap.yaml
- mountPath: /var/lib/redpanda/data
name: datadir
- mountPath: /var/lib/shadow-index-cache
name: shadow-index-cache
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
status:
phase: "Running"

---

apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -97,3 +124,10 @@ metadata:
name: update-image-cluster-and-node-port
status:
version: "v22.2.8"
readyReplicas: 3
replicas: 3
upgrading: false
restarting: false
conditions:
- type: ClusterConfigured
status: "True"
22 changes: 21 additions & 1 deletion src/go/k8s/tests/e2e/update-image-and-node-port/02-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: update-image-cluster-and-node-port
status:
readyReplicas: 2
readyReplicas: 3

---

Expand Down Expand Up @@ -33,6 +33,19 @@ status:

---

apiVersion: v1
kind: Pod
metadata:
name: update-image-cluster-and-node-port-2
spec:
containers:
- name: redpanda
image: vectorized/redpanda:v22.3.4
status:
phase: "Running"

---

apiVersion: kuttl.dev/v1beta1
kind: TestAssert
collectors:
Expand All @@ -48,3 +61,10 @@ metadata:
name: update-image-cluster-and-node-port
status:
version: v22.3.4
readyReplicas: 3
replicas: 3
upgrading: false
restarting: false
conditions:
- type: ClusterConfigured
status: "True"
22 changes: 21 additions & 1 deletion src/go/k8s/tests/e2e/update-image-and-node-port/03-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: update-image-cluster-and-node-port
status:
readyReplicas: 2
readyReplicas: 3

---

Expand Down Expand Up @@ -33,6 +33,19 @@ status:

---

apiVersion: v1
kind: Pod
metadata:
name: update-image-cluster-and-node-port-2
spec:
containers:
- name: redpanda
image: "localhost/redpanda:dev"
status:
phase: "Running"

---

apiVersion: kuttl.dev/v1beta1
kind: TestAssert
collectors:
Expand All @@ -48,3 +61,10 @@ metadata:
name: update-image-cluster-and-node-port
status:
version: "dev"
readyReplicas: 3
replicas: 3
upgrading: false
restarting: false
conditions:
- type: ClusterConfigured
status: "True"
40 changes: 39 additions & 1 deletion src/go/k8s/tests/e2e/update-image-and-node-port/04-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: StatefulSet
metadata:
name: update-image-cluster-and-node-port
status:
readyReplicas: 2
readyReplicas: 3

---

Expand Down Expand Up @@ -53,6 +53,28 @@ spec:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true

---

apiVersion: v1
kind: Pod
metadata:
name: update-image-cluster-and-node-port-2
spec:
containers:
- name: redpanda
image: "localhost/redpanda:dev"
volumeMounts:
- mountPath: /etc/redpanda
name: config-dir
- mountPath: /scripts
name: hook-scripts-dir
- mountPath: /etc/redpanda/.bootstrap.yaml
name: configmap-dir
subPath: .bootstrap.yaml
- mountPath: /var/lib/redpanda/data
name: datadir
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
readOnly: true
status:
phase: "Running"

Expand All @@ -64,3 +86,19 @@ collectors:
- type: pod
selector: app.kubernetes.io/name=redpanda
tail: -1

---

apiVersion: redpanda.vectorized.io/v1alpha1
kind: Cluster
metadata:
name: update-image-cluster-and-node-port
status:
version: "dev"
readyReplicas: 3
replicas: 3
upgrading: false
restarting: false
conditions:
- type: ClusterConfigured
status: "True"
Loading

0 comments on commit eae69eb

Please sign in to comment.