Skip to content

Commit 806f135

Browse files
committed
charts/redpanda: use new sidecar --selector flag
This commit builds upon a previous commit that added the `--selector` flag to the sidecar. It updates the chart to appropriate set this new flag and adds acceptance tests to assert the functionality works as expected. This commit is separate as the v2.x.x branches need to release the updated sidecar before it can be used. (cherry picked from commit 13aeda8)
1 parent 045adcf commit 806f135

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1788
-408
lines changed

.buildkite/testsuite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ steps:
9393
automatic:
9494
limit: 3
9595
soft_fail: false
96-
timeout_in_minutes: 90
96+
timeout_in_minutes: 150
9797
- continue_on_failure: true
9898
wait: null
9999
- agents:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
project: charts/redpanda
2+
kind: Deprecated
3+
body: '- `statefulset.sideCars.controllers.createRBAC` is deprecated and no longer respected. In most cases, setting this field to `false` would result in a broken deployment. RBAC may be controlled via `rbac.enabled` or per controller via `statefulset.sideCars.controllers.{pvcUnbinder,brokerDecommissioner}.enabled`.'
4+
time: 2025-10-21T14:38:34.206376-04:00
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
project: charts/redpanda
2+
kind: Deprecated
3+
body: '`statefulset.sideCars.controllers.run` has been unused for many releases and is now deprecated. Individual controllers may be enabled/disabled by setting their enabled field: `statefulset.sideCars.pvcUnbinder.enabled`, `statefulset.sideCars.brokerDecommissioner.enabled`.'
4+
time: 2025-10-21T14:44:13.331483-04:00

Taskfile.yml

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,16 @@ tasks:
170170
vars:
171171
CLI_ARGS: '' # Don't forward CLI args to build:image
172172
- task: build:charts
173+
vars:
174+
RUN: '{{ default `"^TestIntegration"` .RUN }}'
173175
cmds:
174176
- task: charts:kind-cluster
175177
- kind load docker-image localhost/redpanda-operator:dev
176178
- task: test:unit
177179
vars:
178180
GO_TEST_RUNNER:
179181
ref: .GO_TEST_RUNNER
180-
CLI_ARGS: '{{.CLI_ARGS}} -p=1 -run "^TestIntegration" -timeout 60m -tags integration'
182+
CLI_ARGS: '{{.CLI_ARGS}} -p=1 -run {{.RUN}} -timeout 60m -tags integration'
181183

182184
test:acceptance:
183185
desc: "Run all acceptance tests (~90m)"
@@ -191,16 +193,6 @@ tasks:
191193
RUN: '{{ default `"^TestAcceptance"` .RUN }}'
192194
GO_TEST_RUNNER: '{{default "go test" .GO_TEST_RUNNER}}'
193195
cmds:
194-
- defer: 'k3d cluster delete harpoon'
195-
- |
196-
k3d cluster create harpoon \
197-
--agents=5 --timeout=3m --image=rancher/k3s:v1.29.6-k3s2 \
198-
--k3s-arg --kube-controller-manager-arg=node-monitor-grace-period=10s@server:* \
199-
--k3s-arg --kube-apiserver-arg=default-not-ready-toleration-seconds=10@server:* \
200-
--k3s-arg --kube-apiserver-arg=default-unreachable-toleration-seconds=10@server:* \
201-
--k3s-arg --disable=traefik@server:* \
202-
--verbose
203-
- task: test:import-images
204196
- task: test:unit
205197
vars:
206198
GO_TEST_RUNNER:
@@ -238,31 +230,3 @@ tasks:
238230
cmds:
239231
- for: {var: IMAGES}
240232
cmd: docker inspect {{.ITEM}} > /dev/null || docker pull {{.ITEM}}
241-
242-
test:import-images:
243-
vars:
244-
DEFAULT_TEST_CERTMANAGER_VERSION: v1.14.2
245-
DEFAULT_TEST_REDPANDA_REPO: docker.redpanda.com/redpandadata/redpanda
246-
DEFAULT_TEST_REDPANDA_VERSION: v25.1.1
247-
DEFAULT_TEST_UPGRADE_REDPANDA_REPO: docker.redpanda.com/redpandadata/redpanda
248-
DEFAULT_TEST_UPGRADE_REDPANDA_VERSION: v24.3.11
249-
DEFAULT_TEST_UPGRADE_OPERATOR_VERSION: v2.3.9-24.3.11
250-
TEST_CERTMANAGER_VERSION: '{{ .TEST_CERTMANAGER_VERSION | default .DEFAULT_TEST_CERTMANAGER_VERSION }}'
251-
TEST_REDPANDA_REPO: '{{ .TEST_REDPANDA_REPO | default .DEFAULT_TEST_REDPANDA_REPO }}'
252-
TEST_REDPANDA_VERSION: '{{ .TEST_REDPANDA_VERSION | default .DEFAULT_TEST_REDPANDA_VERSION }}'
253-
TEST_UPGRADE_REDPANDA_REPO: '{{ .TEST_UPGRADE_REDPANDA_REPO | default .DEFAULT_TEST_UPGRADE_REDPANDA_REPO }}'
254-
TEST_UPGRADE_REDPANDA_VERSION: '{{ .TEST_UPGRADE_REDPANDA_VERSION | default .DEFAULT_TEST_UPGRADE_REDPANDA_VERSION }}'
255-
TEST_UPGRADE_OPERATOR_VERSION: '{{ .TEST_UPGRADE_OPERATOR_VERSION | default .DEFAULT_TEST_UPGRADE_OPERATOR_VERSION }}'
256-
IMAGES:
257-
- quay.io/jetstack/cert-manager-controller:{{.TEST_CERTMANAGER_VERSION}}
258-
- quay.io/jetstack/cert-manager-cainjector:{{.TEST_CERTMANAGER_VERSION}}
259-
- quay.io/jetstack/cert-manager-startupapicheck:{{.TEST_CERTMANAGER_VERSION}}
260-
- quay.io/jetstack/cert-manager-webhook:{{.TEST_CERTMANAGER_VERSION}}
261-
- '{{.TEST_REDPANDA_REPO}}:{{.TEST_REDPANDA_VERSION}}'
262-
- '{{.DEFAULT_TEST_UPGRADE_REDPANDA_REPO}}:{{.TEST_UPGRADE_REDPANDA_VERSION}}'
263-
- docker.redpanda.com/redpandadata/redpanda-operator:{{.TEST_UPGRADE_OPERATOR_VERSION}}
264-
- localhost/redpanda-operator:dev
265-
266-
cmds:
267-
- for: {var: IMAGES}
268-
cmd: k3d image import {{.ITEM}} -c harpoon
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
@operator:none
2+
Feature: Redpanda Helm Chart
3+
4+
Scenario: Tolerating Node Failure
5+
Given I helm install "redpanda" "../charts/redpanda" with values:
6+
```yaml
7+
nameOverride: foobar
8+
fullnameOverride: bazquux
9+
10+
statefulset:
11+
sideCars:
12+
image:
13+
tag: dev
14+
repository: localhost/redpanda-operator
15+
pvcUnbinder:
16+
enabled: true
17+
unbindAfter: 15s
18+
brokerDecommissioner:
19+
enabled: true
20+
decommissionAfter: 15s
21+
```
22+
When I stop the Node running Pod "bazquux-2"
23+
And Pod "bazquux-2" is eventually Pending
24+
Then Pod "bazquux-2" will eventually be Running
25+
And kubectl exec -it "bazquux-0" "rpk redpanda admin brokers list | sed -E 's/\s+/ /gm' | cut -d ' ' -f 1,6" will eventually output:
26+
```
27+
ID MEMBERSHIP
28+
0 active
29+
1 active
30+
3 active
31+
```
32+
And kubectl exec -it "bazquux-0" "rpk redpanda admin brokers list --include-decommissioned | sed -E 's/\s+/ /gm' | cut -d ' ' -f 1,6" will eventually output:
33+
```
34+
ID MEMBERSHIP
35+
0 active
36+
1 active
37+
3 active
38+
2 -
39+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Feature: Helm chart to Redpanda Operator migration
2+
3+
@skip:gke @skip:aks @skip:eks
4+
Scenario: Migrate from a Helm chart release to a Redpanda custom resource
5+
Given I helm install "redpanda-migration-example" "../charts/redpanda" with values:
6+
"""
7+
# tag::helm-values[]
8+
fullnameOverride: name-override
9+
# end::helm-values[]
10+
# Without the below values, the operator would have to modify the cluster after the migration.
11+
# As this is test specific because we use a local version of the operator, this block is excluded from the helm-values tag above.
12+
statefulset:
13+
sideCars:
14+
image:
15+
repository: localhost/redpanda-operator
16+
tag: dev
17+
"""
18+
When I apply Kubernetes manifest:
19+
"""
20+
# tag::redpanda-custom-resource-manifest[]
21+
---
22+
apiVersion: cluster.redpanda.com/v1alpha2
23+
kind: Redpanda
24+
metadata:
25+
name: redpanda-migration-example
26+
spec:
27+
# This manifest is a copy of Redpanda release Helm values
28+
clusterSpec:
29+
fullnameOverride: name-override
30+
# end::redpanda-custom-resource-manifest[]
31+
"""
32+
Then cluster "redpanda-migration-example" is available
33+
And the cluster "redpanda-migration-example" is healthy

0 commit comments

Comments
 (0)