Skip to content

Commit

Permalink
Set explicitly entry point for configurator
Browse files Browse the repository at this point in the history
From 27/08/2024 the operator container can be used as configurator. With this
change any user of the Cluster custom resource can now use single container
without specifing arguments for configurator.

Reference
a897ad3
#211
0868b61
#322
  • Loading branch information
RafalKorepta committed Jan 3, 2025
1 parent fdfe86e commit 5cc8003
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ builds:
- amd64
- arm64
ldflags:
- -X "github.com/redpanda-data/redpanda-operator/operator/cmd/version.version={{.Version}}"
- -X "github.com/redpanda-data/redpanda-operator/operator/cmd/version.Version={{.Version}}"
- -X "github.com/redpanda-data/redpanda-operator/operator/cmd/version.commit={{.Commit}}"
- -X "github.com/redpanda-data/redpanda-operator/operator/cmd/version.buildDate={{.Date}}"

Expand Down
2 changes: 0 additions & 2 deletions charts/operator/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ func operatorArguments(dot *helmette.Dot) []string {
"--health-probe-bind-address=:8081",
"--metrics-bind-address=127.0.0.1:8080",
"--leader-elect",
fmt.Sprintf("--configurator-tag=%s", configuratorTag(dot)),
fmt.Sprintf("--configurator-base-image=%s", values.Configurator.Repository),
fmt.Sprintf("--webhook-enabled=%t", isWebhookEnabled(dot)),
}

Expand Down
5 changes: 3 additions & 2 deletions operator/cmd/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (

redpandav1alpha2 "github.com/redpanda-data/redpanda-operator/operator/api/redpanda/v1alpha2"
vectorizedv1alpha1 "github.com/redpanda-data/redpanda-operator/operator/api/vectorized/v1alpha1"
"github.com/redpanda-data/redpanda-operator/operator/cmd/version"
"github.com/redpanda-data/redpanda-operator/operator/internal/controller"
"github.com/redpanda-data/redpanda-operator/operator/internal/controller/flux"
redpandacontrollers "github.com/redpanda-data/redpanda-operator/operator/internal/controller/redpanda"
Expand All @@ -54,7 +55,7 @@ func (r RedpandaController) toString() string {
}

const (
defaultConfiguratorContainerImage = "vectorized/configurator"
defaultConfiguratorContainerImage = "docker.redpanda.com/redpandadata/redpanda-operator"

AllControllers = RedpandaController("all")
NodeController = RedpandaController("nodeWatcher")
Expand Down Expand Up @@ -177,7 +178,7 @@ func Command() *cobra.Command {
"Enabling this will ensure there is only one active controller manager.")
cmd.Flags().BoolVar(&webhookEnabled, "webhook-enabled", false, "Enable webhook Manager")
cmd.Flags().StringVar(&configuratorBaseImage, "configurator-base-image", defaultConfiguratorContainerImage, "Set the configurator base image")
cmd.Flags().StringVar(&configuratorTag, "configurator-tag", "latest", "Set the configurator tag")
cmd.Flags().StringVar(&configuratorTag, "configurator-tag", version.Version, "Set the configurator tag")
cmd.Flags().StringVar(&configuratorImagePullPolicy, "configurator-image-pull-policy", "Always", "Set the configurator image pull policy")
cmd.Flags().DurationVar(&decommissionWaitInterval, "decommission-wait-interval", 8*time.Second, "Set the time to wait for a node decommission to happen in the cluster")
cmd.Flags().DurationVar(&metricsTimeout, "metrics-timeout", 8*time.Second, "Set the timeout for a checking metrics Admin API endpoint. If set to 0, then the 2 seconds default will be used")
Expand Down
6 changes: 3 additions & 3 deletions operator/cmd/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
var (
// these variables are set via ldflags in our goreleaser build.

version string
Version string
commit string
buildDate string
)
Expand All @@ -31,7 +31,7 @@ func init() {
Name: "build_info",
Help: "A gauge always set to 1 that provides build information as labels.",
ConstLabels: prometheus.Labels{
"version": version,
"version": Version,
"commit": commit,
"go_version": runtime.Version(),
},
Expand All @@ -47,7 +47,7 @@ func Command() *cobra.Command {
Use: "version",
Short: "print build information",
Run: func(cmd *cobra.Command, args []string) {
cmd.Printf("Version: %s\n", version)
cmd.Printf("Version: %s\n", Version)
cmd.Printf("Commit: %s\n", commit)
cmd.Printf("Go Version: %s\n", runtime.Version())
cmd.Printf("Build Date: %s\n", buildDate)
Expand Down
2 changes: 2 additions & 0 deletions operator/pkg/resources/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ func (r *StatefulSetResource) obj(
{
Name: configuratorContainerName,
Image: r.fullConfiguratorImage(),
Command: []string{"/redpanda-operator"},
Args: []string{"configure"},
ImagePullPolicy: r.configuratorSettings.ImagePullPolicy,
Env: append([]corev1.EnvVar{
{
Expand Down

0 comments on commit 5cc8003

Please sign in to comment.