-
Notifications
You must be signed in to change notification settings - Fork 15
charts/redpanda: use new sidecar --selector flag #1151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| project: charts/redpanda | ||
| kind: Deprecated | ||
| 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`.' | ||
| time: 2025-10-21T14:38:34.206376-04:00 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| project: charts/redpanda | ||
| kind: Deprecated | ||
| 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`.' | ||
| time: 2025-10-21T14:44:13.331483-04:00 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| @operator:none | ||
| Feature: Redpanda Helm Chart | ||
|
|
||
| Scenario: Tolerating Node Failure | ||
| Given I helm install "redpanda" "../charts/redpanda/chart" with values: | ||
| ```yaml | ||
| nameOverride: foobar | ||
| fullnameOverride: bazquux | ||
|
|
||
| statefulset: | ||
| sideCars: | ||
| image: | ||
| tag: dev | ||
| repository: localhost/redpanda-operator | ||
| pvcUnbinder: | ||
| enabled: true | ||
| unbindAfter: 15s | ||
| brokerDecommissioner: | ||
| enabled: true | ||
| decommissionAfter: 15s | ||
| ``` | ||
| When I stop the Node running Pod "bazquux-2" | ||
| And Pod "bazquux-2" is eventually Pending | ||
| Then Pod "bazquux-2" will eventually be Running | ||
| And kubectl exec -it "bazquux-0" "rpk redpanda admin brokers list | sed -E 's/\s+/ /gm' | cut -d ' ' -f 1,6" will eventually output: | ||
| ``` | ||
| ID MEMBERSHIP | ||
| 0 active | ||
| 1 active | ||
| 3 active | ||
| ``` | ||
| 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: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| ``` | ||
| ID MEMBERSHIP | ||
| 0 active | ||
| 1 active | ||
| 3 active | ||
| 2 - | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,40 +12,45 @@ package steps | |
| import ( | ||
| "context" | ||
| "fmt" | ||
| "strings" | ||
|
|
||
| "github.com/cucumber/godog" | ||
| "github.com/stretchr/testify/require" | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/client-go/rest" | ||
| "sigs.k8s.io/yaml" | ||
|
|
||
| framework "github.com/redpanda-data/redpanda-operator/harpoon" | ||
| "github.com/redpanda-data/redpanda-operator/pkg/helm" | ||
| ) | ||
|
|
||
| // The unused parameter is meant to specify a Helm chart place (remote or local in the file system). | ||
| func iInstallHelmRelease(ctx context.Context, t framework.TestingT, helmReleaseName, _ string, values *godog.DocString) { | ||
| func iHelmInstall(ctx context.Context, t framework.TestingT, name, chart, version string, values *godog.DocString) { | ||
| // We don't really reference anything other than the redpanda repo, so just | ||
| // handle repos as a naive check here. | ||
| if strings.HasPrefix(chart, "redpanda/") { | ||
| t.AddHelmRepo(ctx, "redpanda", "https://charts.redpanda.com") | ||
| } | ||
|
|
||
| var valuesMap map[string]any | ||
| require.NoError(t, yaml.Unmarshal([]byte(values.Content), &valuesMap)) | ||
|
|
||
| helmClient, err := helm.New(helm.Options{ | ||
| KubeConfig: rest.CopyConfig(t.RestConfig()), | ||
| t.InstallHelmChart(ctx, chart, helm.InstallOptions{ | ||
| Name: name, | ||
| Version: version, | ||
| Values: valuesMap, | ||
| Namespace: t.Namespace(), | ||
| }) | ||
| require.NoError(t, err) | ||
|
|
||
| require.NoError(t, helmClient.RepoAdd(ctx, "console", "https://charts.redpanda.com")) | ||
| } | ||
|
|
||
| path := "../charts/redpanda/chart" | ||
| require.NoError(t, helmClient.DependencyBuild(ctx, path)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current tests are failing due to removal of this line (since you collapsed this helper, you'll probably want to conditionally run this when passed a chart that has a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm considering that to be a build step and I've added a helm dep build call to the task. Some integration tests should be depending on it too and I think it's an accidental race that makes it work at the moment. |
||
| func iHelmUpgrade(ctx context.Context, t framework.TestingT, name, chart, version string, values *godog.DocString) { | ||
| var valuesMap map[string]any | ||
| require.NoError(t, yaml.Unmarshal([]byte(values.Content), &valuesMap)) | ||
|
|
||
| t.Logf("installing chart %q", path) | ||
| _, err = helmClient.Install(ctx, path, helm.InstallOptions{ | ||
| Name: helmReleaseName, | ||
| Namespace: t.Namespace(), | ||
| t.UpgradeHelmChart(ctx, name, chart, helm.UpgradeOptions{ | ||
| Version: version, | ||
| Values: valuesMap, | ||
| Namespace: t.Namespace(), | ||
| }) | ||
| require.NoError(t, err) | ||
| } | ||
|
|
||
| func iDeleteHelmReleaseSecret(ctx context.Context, t framework.TestingT, helmReleaseName string) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: It's not all chart only redpanda, but I think this is the place where we should add any additional helm dep invocation.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 redpanda is the only chart any with deps, so technically it is all charts.
I named all charts so this gets added onto rather if we ever end up adding new deps.This is exactly what you said.