From 99e0ed2d2d28c9af65e03e3948860f6da69ce754 Mon Sep 17 00:00:00 2001 From: Rafal Korepta Date: Fri, 3 Jan 2025 11:48:44 +0100 Subject: [PATCH] Set explicitly entry point for configurator 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 https://github.com/redpanda-data/redpanda-operator/commit/a897ad358fe1db4977b7bf699bb29aef0a432684 https://github.com/redpanda-data/redpanda-operator/pull/211 https://github.com/redpanda-data/redpanda-operator/commit/0868b613699ac83925a8ed5caec47d48d61e98e2 https://github.com/redpanda-data/redpanda-operator/pull/322 --- .goreleaser.yaml | 2 +- charts/operator/deployment.go | 11 - charts/operator/templates/_deployment.go.tpl | 18 +- .../testdata/template-cases.golden.txtar | 212 ------------------ operator/cmd/run/run.go | 5 +- operator/cmd/version/version.go | 6 +- operator/pkg/resources/statefulset.go | 2 + 7 files changed, 10 insertions(+), 246 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 731356d56..4f072c7c8 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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}}" diff --git a/charts/operator/deployment.go b/charts/operator/deployment.go index 642a6c1e8..dad7396a2 100644 --- a/charts/operator/deployment.go +++ b/charts/operator/deployment.go @@ -235,15 +235,6 @@ func containerImage(dot *helmette.Dot) string { return fmt.Sprintf("%s:%s", values.Image.Repository, tag) } -func configuratorTag(dot *helmette.Dot) string { - values := helmette.Unwrap[Values](dot.Values) - - if !helmette.Empty(values.Configurator.Tag) { - return *values.Configurator.Tag - } - return dot.Chart.AppVersion -} - func isWebhookEnabled(dot *helmette.Dot) bool { values := helmette.Unwrap[Values](dot.Values) @@ -366,8 +357,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)), } diff --git a/charts/operator/templates/_deployment.go.tpl b/charts/operator/templates/_deployment.go.tpl index 292e76bdf..6801f31e0 100644 --- a/charts/operator/templates/_deployment.go.tpl +++ b/charts/operator/templates/_deployment.go.tpl @@ -101,22 +101,6 @@ {{- end -}} {{- end -}} -{{- define "operator.configuratorTag" -}} -{{- $dot := (index .a 0) -}} -{{- range $_ := (list 1) -}} -{{- $_is_returning := false -}} -{{- $values := $dot.Values.AsMap -}} -{{- if (not (empty $values.configurator.tag)) -}} -{{- $_is_returning = true -}} -{{- (dict "r" $values.configurator.tag) | toJson -}} -{{- break -}} -{{- end -}} -{{- $_is_returning = true -}} -{{- (dict "r" $dot.Chart.AppVersion) | toJson -}} -{{- break -}} -{{- end -}} -{{- end -}} - {{- define "operator.isWebhookEnabled" -}} {{- $dot := (index .a 0) -}} {{- range $_ := (list 1) -}} @@ -194,7 +178,7 @@ {{- range $_ := (list 1) -}} {{- $_is_returning := false -}} {{- $values := $dot.Values.AsMap -}} -{{- $args := (list "--health-probe-bind-address=:8081" "--metrics-bind-address=127.0.0.1:8080" "--leader-elect" (printf "--configurator-tag=%s" (get (fromJson (include "operator.configuratorTag" (dict "a" (list $dot) ))) "r")) (printf "--configurator-base-image=%s" $values.configurator.repository) (printf "--webhook-enabled=%t" (get (fromJson (include "operator.isWebhookEnabled" (dict "a" (list $dot) ))) "r"))) -}} +{{- $args := (list "--health-probe-bind-address=:8081" "--metrics-bind-address=127.0.0.1:8080" "--leader-elect" (printf "--webhook-enabled=%t" (get (fromJson (include "operator.isWebhookEnabled" (dict "a" (list $dot) ))) "r"))) -}} {{- if (eq $values.scope "Namespace") -}} {{- $args = (concat (default (list ) $args) (list (printf "--namespace=%s" $dot.Release.Namespace) (printf "--log-level=%s" $values.logLevel))) -}} {{- end -}} diff --git a/charts/operator/testdata/template-cases.golden.txtar b/charts/operator/testdata/template-cases.golden.txtar index 079e2cbfe..3b3d70564 100644 --- a/charts/operator/testdata/template-cases.golden.txtar +++ b/charts/operator/testdata/template-cases.golden.txtar @@ -819,8 +819,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=a35 @@ -2023,8 +2021,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=TNizkRf0 @@ -3227,8 +3223,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=Ae @@ -4394,8 +4388,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=aLtxl8mj4on - - --configurator-base-image=2mS7jVj - --webhook-enabled=false - --namespace=default - --log-level=CcZY @@ -5589,8 +5581,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=q - - --configurator-base-image=qylxfyVep - --webhook-enabled=false - --namespace=default - --log-level=a4SuUdq @@ -6793,8 +6783,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=rFQZDVjIXR - - --configurator-base-image=5kJs - --webhook-enabled=false - --namespace=default - --log-level=eM @@ -7985,8 +7973,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=cd8o - - --configurator-base-image=fq - --webhook-enabled=false - --namespace=default - --log-level=OdrK @@ -8475,8 +8461,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=8 - - --configurator-base-image=HCFVII - --webhook-enabled=false - --namespace=default - --log-level=Y @@ -9703,8 +9687,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Ya - - --configurator-base-image=JB7S - --webhook-enabled=false - --namespace=default - --log-level=gT @@ -10887,8 +10869,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=qAWS9PK8BH - - --configurator-base-image= - --webhook-enabled=false - --namespace=default - --log-level=Qgv @@ -12182,8 +12162,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=dqEg @@ -13405,8 +13383,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=aWy1AZjYl @@ -14560,8 +14536,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=rci - - --configurator-base-image=Vgkp - --webhook-enabled=false - --namespace=default - --log-level=HhY5pV @@ -15798,8 +15772,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Q8X86Dd4 - - --configurator-base-image=R4X - --webhook-enabled=false - --namespace=default - --log-level=DCM8 @@ -16288,8 +16260,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=985Fv - - --configurator-base-image=SIqvouhk - --webhook-enabled=false - --namespace=default - --log-level=6TGvv @@ -17501,8 +17471,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=z - - --configurator-base-image=ix - --webhook-enabled=false - --namespace=default - --log-level=vOvAQKBh @@ -18047,8 +18015,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=mU @@ -19354,8 +19320,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=GE732ps - - --configurator-base-image=VeOah65M - --webhook-enabled=false - --namespace=default - --log-level=BpnfO @@ -20687,8 +20651,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=dX - - --configurator-base-image= - --webhook-enabled=false - --namespace=default - --log-level=pMbmKX @@ -21944,8 +21906,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=5ruW @@ -25304,8 +25264,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=CO0i - - --configurator-base-image=My52JbgFH - --webhook-enabled=false - --namespace=default - --log-level=wt4uT @@ -32665,8 +32623,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=qz - - --configurator-base-image=SB - --webhook-enabled=false - --namespace=default - --log-level=PgU9SwD @@ -38142,8 +38098,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=kbx - - --configurator-base-image=bYrt - --webhook-enabled=false - --namespace=default - --log-level=zoF @@ -39683,8 +39637,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=cVDIGtHX - - --configurator-base-image=5bwwdif - --webhook-enabled=false - --namespace=default - --log-level=S3 @@ -43112,8 +43064,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=T - - --configurator-base-image=jAzhm8 - --webhook-enabled=false - --namespace=default - --log-level=mcE2xz8 @@ -49936,8 +49886,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=OIQ5gS0B7 - - --configurator-base-image=ds43yo - --webhook-enabled=false - --namespace=default - --log-level=NaLO9z @@ -57439,8 +57387,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=4FEQ - - --configurator-base-image=5 - --webhook-enabled=false - --namespace=default - --log-level=xLHAob @@ -65085,8 +65031,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Mn2B - - --configurator-base-image=dS6V2tB - --webhook-enabled=false - --namespace=default - --log-level=GusePZR7AB @@ -71839,8 +71783,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=rxdGd - - --configurator-base-image=Xvk0 - --webhook-enabled=false - --namespace=default - --log-level=EQ @@ -77322,8 +77264,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=EFz5N30qGu - - --configurator-base-image=7Bd9JWQN - --webhook-enabled=false - --namespace=default - --log-level=hPrI1P @@ -80243,8 +80183,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=GBeCz7 - - --configurator-base-image=9Zc - --webhook-enabled=false - --namespace=default - --log-level=v1480 @@ -87981,8 +87919,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=n370vHCve - - --configurator-base-image=Jdits - --webhook-enabled=false - --namespace=default - --log-level=XxZ @@ -94761,8 +94697,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=OQrf - - --configurator-base-image=Ue5Fu - --webhook-enabled=false - --namespace=default - --log-level=G3wz @@ -102476,8 +102410,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=ReF - - --configurator-base-image=icGnBq - --webhook-enabled=false - --namespace=default - --log-level=KMFMJqF @@ -107283,8 +107215,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=HYYDjvqk - - --configurator-base-image=6hgLCx0 - --webhook-enabled=false - --namespace=default - --log-level=SzbHWgTpbD2 @@ -108063,8 +107993,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=avvCdi - - --configurator-base-image=6th8 - --webhook-enabled=false - --namespace=default - --log-level=iAMFhZ @@ -108941,8 +108869,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=TmuL - - --configurator-base-image=QuAVGFsZA - --webhook-enabled=false - --namespace=default - --log-level=W @@ -111791,8 +111717,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=39 - - --configurator-base-image=WydrqY - --webhook-enabled=false - --namespace=default - --log-level=GyEj @@ -117412,8 +117336,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=SFmG - - --configurator-base-image=yeiTB - --webhook-enabled=false - --namespace=default - --log-level=WFheHptfh @@ -120266,8 +120188,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=6HtJ - - --configurator-base-image=0A2fruI4 - --webhook-enabled=false - --namespace=default - --log-level= @@ -127007,8 +126927,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=GIU2Md - - --configurator-base-image=UXdPwvSZ - --webhook-enabled=false - --namespace=default - --log-level=yGdn @@ -132630,8 +132548,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=CLku - - --configurator-base-image=irGTr5F - --webhook-enabled=false - --namespace=default - --log-level=K @@ -136360,8 +136276,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=hoVK - - --configurator-base-image=zIo - --webhook-enabled=false - --namespace=default - --log-level=10rTK @@ -141198,8 +141112,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=m9I - - --configurator-base-image=gkh - --webhook-enabled=false - --namespace=default - --log-level=D3sVjB0WumuG @@ -142931,8 +142843,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=RHZEr - - --configurator-base-image=r2G - --webhook-enabled=false - --namespace=default - --log-level= @@ -143838,8 +143748,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=vGmntvGsh - - --configurator-base-image=sULUtH7pgG - --webhook-enabled=false - --namespace=default - --log-level=YQXlr @@ -146693,8 +146601,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Rftg9dr5s - - --configurator-base-image=P6o - --webhook-enabled=false - --namespace=default - --log-level=TwQtVGrOeJf @@ -152373,8 +152279,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=YhoOhzvU - - --configurator-base-image=xR1lLio - --webhook-enabled=false - --namespace=default - --log-level=EFXhBX @@ -153957,8 +153861,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Z - - --configurator-base-image=xdP7BVI - --webhook-enabled=false - --namespace=default - --log-level=ozF @@ -157576,8 +157478,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=7seGa7 - - --configurator-base-image=vFWm - --webhook-enabled=false - --namespace=default - --log-level=bVWCG @@ -162740,8 +162640,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true command: - /manager @@ -163734,8 +163632,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true - l4dHBtic0cX0cs7 - "" @@ -164742,8 +164638,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true command: - /manager @@ -165769,8 +165663,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=NxHJa - - --configurator-base-image=fLlxU - --webhook-enabled=true command: - /manager @@ -166803,8 +166695,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true command: - /manager @@ -167824,8 +167714,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=hV4 - - --configurator-base-image=MIvY - --webhook-enabled=true - D4rks - p7p @@ -168350,8 +168238,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true command: - /manager @@ -170941,8 +170827,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true - JOd - JV6w @@ -176078,8 +175962,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=bCO - - --configurator-base-image=wcPh - --webhook-enabled=true command: - /manager @@ -177107,8 +176989,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true command: - /manager @@ -180399,8 +180279,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=z8v - - --configurator-base-image=X4w - --webhook-enabled=true - 8TZ - c @@ -187548,8 +187426,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=pAdA - - --configurator-base-image=Gex - --webhook-enabled=true command: - /manager @@ -194901,8 +194777,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=bqmx - - --configurator-base-image=gSJu - --webhook-enabled=true command: - /manager @@ -200050,8 +199924,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=VE1ZUh - - --configurator-base-image=AwnPT - --webhook-enabled=true - r4LII - m5622dBz6A @@ -203252,8 +203124,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=SZZCm - - --configurator-base-image=uZ - --webhook-enabled=true - "" - QL9X @@ -207916,8 +207786,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=AEIpr - - --configurator-base-image=Da16 - --webhook-enabled=true - Q9 - JLCZc @@ -210638,8 +210506,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=cUh - - --configurator-base-image=Fj6 - --webhook-enabled=true command: - /manager @@ -215848,8 +215714,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=wYqc46voI - - --configurator-base-image=M13Dy - --webhook-enabled=true command: - /manager @@ -216569,8 +216433,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=5 - - --configurator-base-image=C - --webhook-enabled=true - dWzxr3xXRM - vEF @@ -217312,8 +217174,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=6rkgWXaEB - - --configurator-base-image=ksTl8 - --webhook-enabled=true - oxdTcKZmy5 command: @@ -220793,8 +220653,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=vJ7 - - --configurator-base-image=9Rb - --webhook-enabled=true - ReK6Upw - 7Pu0AA @@ -226225,8 +226083,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=QyF - - --configurator-base-image=bCw - --webhook-enabled=true - LlHz1 - 4qYzSV @@ -227141,8 +226997,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=KXzW7VQx - - --configurator-base-image=5mS - --webhook-enabled=true - zTsg - Sv @@ -230078,8 +229932,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=hWeB - - --configurator-base-image=jHzYL - --webhook-enabled=true - 5orCeu - v7kr @@ -234979,8 +234831,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=iu - - --configurator-base-image=pz - --webhook-enabled=true - "n" - H7B3A1m @@ -236241,8 +236091,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Z1EHm - - --configurator-base-image=4DvRvwzyZ - --webhook-enabled=true - eyxGhI - 9YL @@ -239934,8 +239782,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=wptDl - - --configurator-base-image=27 - --webhook-enabled=true command: - /manager @@ -245362,8 +245208,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=ixH5fOI - - --configurator-base-image=5FXeK8wPPEPP - --webhook-enabled=true command: - /manager @@ -246733,8 +246577,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=ycEPWURvibMP - - --configurator-base-image=uejsMOMQ - --webhook-enabled=true - Sb4JTueXASpBtQ - og @@ -249669,8 +249511,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=GPD3 - - --configurator-base-image=R1fmRa5pO - --webhook-enabled=true command: - /manager @@ -255085,8 +254925,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=RBGlA - - --configurator-base-image=f9SNC - --webhook-enabled=true command: - /manager @@ -258645,8 +258483,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=71Y - - --configurator-base-image=RG - --webhook-enabled=true - Gc3q48w - JNFXPzkrj @@ -263417,8 +263253,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Zudyt - - --configurator-base-image=YrPdj - --webhook-enabled=true command: - /manager @@ -266880,8 +266714,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=X - - --configurator-base-image=hIpWz - --webhook-enabled=true - QpxE2 command: @@ -272360,8 +272192,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=5 - - --configurator-base-image=1 - --webhook-enabled=true - bv4LbFjFG - X5vvak7u @@ -273685,8 +273515,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=EdEKzO - - --configurator-base-image=DBGiL8 - --webhook-enabled=true - amoUVan command: @@ -274502,8 +274330,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=989m - - --configurator-base-image= - --webhook-enabled=true command: - /manager @@ -275830,8 +275656,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=g86c45 - - --configurator-base-image=ISPO8ej - --webhook-enabled=true command: - /manager @@ -277300,8 +277124,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=Un4Drc - - --configurator-base-image=fyvgMtAt - --webhook-enabled=true command: - /manager @@ -278135,8 +277957,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=tQ0N9 - - --configurator-base-image=PMqAtv - --webhook-enabled=true command: - /manager @@ -279515,8 +279335,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=dDdKxN - - --configurator-base-image=etz0b1wkR64 - --webhook-enabled=true command: - /manager @@ -283124,8 +282942,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=RoOM - - --configurator-base-image=ch9EL - --webhook-enabled=true - oMtn - Q @@ -288100,8 +287916,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=ZZ - - --configurator-base-image=ULC - --webhook-enabled=true - IoP - oEPSF @@ -289473,8 +289287,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=RZavde - - --configurator-base-image=jLPC2Jo - --webhook-enabled=true - "" - 2BwL4Tf6d @@ -292966,8 +292778,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=iDx03 - - --configurator-base-image=sf - --webhook-enabled=true - 7G3Tgu - Oh @@ -300428,8 +300238,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=F5 - - --configurator-base-image=Yq2e7 - --webhook-enabled=true command: - /manager @@ -307348,8 +307156,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=O0pp - - --configurator-base-image=lGaxjauRAp - --webhook-enabled=true command: - /manager @@ -314874,8 +314680,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=FZjCXEUZ - - --configurator-base-image=p - --webhook-enabled=true - l9a - Arx @@ -319814,8 +319618,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=iDm0saNRo2 - - --configurator-base-image=u93kO - --webhook-enabled=true - P - WM7Be @@ -323370,8 +323172,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=ZhJg2 - - --configurator-base-image=jDCXh23 - --webhook-enabled=true command: - /manager @@ -328704,8 +328504,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=info @@ -329848,8 +329646,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=info @@ -331009,8 +330805,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=info @@ -332153,8 +331947,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=info @@ -333123,8 +332915,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=true command: - /manager @@ -334272,8 +334062,6 @@ spec: - --health-probe-bind-address=:8081 - --metrics-bind-address=127.0.0.1:8080 - --leader-elect - - --configurator-tag=v2.3.4-24.3.2 - - --configurator-base-image=docker.redpanda.com/redpandadata/configurator - --webhook-enabled=false - --namespace=default - --log-level=info diff --git a/operator/cmd/run/run.go b/operator/cmd/run/run.go index a94b931ee..e06e13001 100644 --- a/operator/cmd/run/run.go +++ b/operator/cmd/run/run.go @@ -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" @@ -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") @@ -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") diff --git a/operator/cmd/version/version.go b/operator/cmd/version/version.go index 83aa27bf5..930072d15 100644 --- a/operator/cmd/version/version.go +++ b/operator/cmd/version/version.go @@ -20,7 +20,7 @@ import ( var ( // these variables are set via ldflags in our goreleaser build. - version string + Version string commit string buildDate string ) @@ -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(), }, @@ -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) diff --git a/operator/pkg/resources/statefulset.go b/operator/pkg/resources/statefulset.go index 999e36623..de35322b4 100644 --- a/operator/pkg/resources/statefulset.go +++ b/operator/pkg/resources/statefulset.go @@ -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{ {