Skip to content
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

Helm nightly release #345

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ genschema/genschema.xml
gotohelm/gotohelm.xml
pkg/pkg.xml

helm-operator-release/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is no longer required

2 changes: 1 addition & 1 deletion charts/connectors/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ kubeVersion: "^1.21.0-0"

icon: https://images.ctfassets.net/paqvtpyf8rwu/3cYHw5UzhXCbKuR24GDFGO/73fb682e6157d11c10d5b2b5da1d5af0/skate-stand-panda.svg
sources:
- https://github.com/redpanda-data/helm-charts
- https://github.com/redpanda-data/redpanda-operator/tree/main/charts/connectors
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/links: |
Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/n

## Source Code

* <https://github.com/redpanda-data/helm-charts>
* <https://github.com/redpanda-data/redpanda-operator/tree/main/charts/connectors>

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion charts/console/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ kubeVersion: ">= 1.25.0-0"

icon: https://images.ctfassets.net/paqvtpyf8rwu/3cYHw5UzhXCbKuR24GDFGO/73fb682e6157d11c10d5b2b5da1d5af0/skate-stand-panda.svg
sources:
- https://github.com/redpanda-data/helm-charts
- https://github.com/redpanda-data/redpanda-operator/tree/main/charts/console
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/links: |
Expand Down
2 changes: 1 addition & 1 deletion charts/console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/n

## Source Code

* <https://github.com/redpanda-data/helm-charts>
* <https://github.com/redpanda-data/redpanda-operator/tree/main/charts/console>

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion charts/operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ appVersion: v2.3.5-24.3.2
kubeVersion: ">= 1.25.0-0"

sources:
- https://github.com/redpanda-data/helm-charts
- https://github.com/redpanda-data/redpanda-operator/tree/main/charts/operator
icon: https://go.redpanda.com/hubfs/Redpandas/operator-panda.png
maintainers:
- name: redpanda-data
Expand Down
2 changes: 1 addition & 1 deletion charts/operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/n

## Source Code

* <https://github.com/redpanda-data/helm-charts>
* <https://github.com/redpanda-data/redpanda-operator/tree/main/charts/operator>

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion charts/redpanda/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dependencies:

icon: https://images.ctfassets.net/paqvtpyf8rwu/3cYHw5UzhXCbKuR24GDFGO/73fb682e6157d11c10d5b2b5da1d5af0/skate-stand-panda.svg
sources:
- https://github.com/redpanda-data/helm-charts
- https://github.com/redpanda-data/redpanda-operator/tree/main/charts/redpanda
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/links: |
Expand Down
2 changes: 1 addition & 1 deletion charts/redpanda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/n

## Source Code

* <https://github.com/redpanda-data/helm-charts>
* <https://github.com/redpanda-data/redpanda-operator/tree/main/charts/redpanda>

## Requirements

Expand Down
171 changes: 168 additions & 3 deletions go.work.sum

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ USER 65532:65532
COPY manager-${TARGETOS}-${TARGETARCH} /manager
COPY redpanda-operator-${TARGETOS}-${TARGETARCH} /redpanda-operator
ENTRYPOINT ["/redpanda-operator", "run"]

# To ease the transition while we bundle the operator and the configurator into
# a single image, we continue to maintain a configurator image that's a clone
# of the operator image with a different ENTRYPOINT.
FROM manager AS configurator
# For backwards compatibility with deployments that specify the
# entrypoint/command.
COPY configurator-${TARGETOS}-${TARGETARCH} /configurator
ENTRYPOINT ["/redpanda-operator", "configure"]
11 changes: 0 additions & 11 deletions operator/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Image URL to use all building/pushing image targets
OPERATOR_IMG_LATEST ?= "localhost/redpanda-operator:dev"
CONFIGURATOR_IMG_LATEST ?= "localhost/configurator:dev"

HELM_CONTROLLER_VERSION ?= v0.37.2
SOURCE_CONTROLLER_VERSION ?= v1.2.3
Expand Down Expand Up @@ -48,11 +47,6 @@ test: manifests generate fmt
manager: manifests generate fmt
go build -o bin/manager cmd/main.go

# Build manager binary
.PHONY: configurator
configurator: manifests generate fmt
go build -o bin/configurator cmd/configurator/main.go

.PHONY: build
build: manager configurator

Expand Down Expand Up @@ -112,11 +106,6 @@ docker-build:
echo "~~~ Building operator image :docker:"
cd .. && task k8s:build-operator-images

# Build the docker image
docker-build-configurator:
echo "~~~ Building configurator image :docker:"
cd .. && task k8s:build-operator-images

# Preload controller image to kind cluster
push-to-kind: kind-create certmanager-install
kind load docker-image ${OPERATOR_IMG_LATEST}
Expand Down
3 changes: 1 addition & 2 deletions operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ Install cert manager
make certmanager-install
```

Build docker images for manager and configurator
Build docker images for manager

```bash
make docker-build
make docker-build-configurator
```

Deploy operator to kind
Expand Down
3 changes: 0 additions & 3 deletions operator/config/e2e-tests/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ images:
- name: vectorized/redpanda-operator
newName: localhost/redpanda-operator
newTag: dev
- name: vectorized/configurator
newName: localhost/configurator
newTag: dev
resources:
- ../default
patches:
Expand Down
2 changes: 1 addition & 1 deletion operator/config/e2e-tests/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--webhook-enabled=true"
- "--configurator-base-image=localhost/configurator"
- "--configurator-base-image=localhost/redpanda-operator"
- "--configurator-tag=dev"
- "--configurator-image-pull-policy=Never"
- "--superusers-prefix=__redpanda_system__"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ var _ = BeforeSuite(func(suiteCtx SpecContext) {
AdminAPIClientFactory: testAdminAPIFactory,
DecommissionWaitInterval: 100 * time.Millisecond,
}).WithClusterDomain("cluster.local").WithConfiguratorSettings(resources.ConfiguratorSettings{
ConfiguratorBaseImage: "vectorized/configurator",
ConfiguratorBaseImage: "redpanda-data/redpanda-operator",
ConfiguratorTag: "latest",
ImagePullPolicy: "Always",
}).SetupWithManager(k8sManager)
Expand Down
1 change: 0 additions & 1 deletion operator/kuttl-test-with-flags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: TestSuite
startKIND: true
kindContainers:
- localhost/redpanda-operator:dev
- localhost/configurator:dev
- localhost/redpanda:dev
testDirs:
- ./tests/e2e-with-flags
Expand Down
1 change: 0 additions & 1 deletion operator/kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: TestSuite
startKIND: true
kindContainers:
- localhost/redpanda-operator:dev
- localhost/configurator:dev
- localhost/redpanda:dev
testDirs:
- ./tests/e2e
Expand Down
1 change: 0 additions & 1 deletion operator/kuttl-unstable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ skipDelete: true
skipClusterDelete: true
kindContainers:
- localhost/redpanda-operator:dev
- localhost/configurator:dev
- localhost/redpanda:dev
testDirs:
- ./tests/e2e-unstable
Expand Down
2 changes: 1 addition & 1 deletion operator/pkg/resources/resource_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestEnsure_StatefulSet(t *testing.T) {
TestAdminTLSConfigProvider{},
"",
res.ConfiguratorSettings{
ConfiguratorBaseImage: "vectorized/configurator",
ConfiguratorBaseImage: "redpanda-data/redpanda-operator",
ConfiguratorTag: "latest",
ImagePullPolicy: "Always",
},
Expand Down
8 changes: 4 additions & 4 deletions operator/pkg/resources/statefulset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestEnsure(t *testing.T) {
TestAdminTLSConfigProvider{},
"",
resources.ConfiguratorSettings{
ConfiguratorBaseImage: "vectorized/configurator",
ConfiguratorBaseImage: "redpanda-data/redpanda-operator",
ConfiguratorTag: "latest",
ImagePullPolicy: "Always",
},
Expand Down Expand Up @@ -279,7 +279,7 @@ func defaultNodePoolstsFromCluster(pandaCluster *vectorizedv1alpha1.Cluster) *ap
Spec: corev1.PodSpec{
InitContainers: []corev1.Container{{
Name: "redpanda-configurator",
Image: "vectorized/configurator:latest",
Image: "vectorized/redpanda-operator:latest",
Resources: corev1.ResourceRequirements{
Limits: pandaCluster.Spec.Resources.Limits,
Requests: pandaCluster.Spec.Resources.Requests,
Expand Down Expand Up @@ -377,7 +377,7 @@ func stsFromCluster(pandaCluster *vectorizedv1alpha1.Cluster) *appsv1.StatefulSe
Spec: corev1.PodSpec{
InitContainers: []corev1.Container{{
Name: "redpanda-configurator",
Image: "vectorized/configurator:latest",
Image: "vectorized/redpanda-operator:latest",
Resources: corev1.ResourceRequirements{
Limits: pandaCluster.Spec.NodePools[0].Resources.Limits,
Requests: pandaCluster.Spec.NodePools[0].Resources.Requests,
Expand Down Expand Up @@ -641,7 +641,7 @@ func TestCurrentVersion(t *testing.T) {
TestAdminTLSConfigProvider{},
"",
resources.ConfiguratorSettings{
ConfiguratorBaseImage: "vectorized/configurator",
ConfiguratorBaseImage: "redpanda-data/redpanda-operator",
ConfiguratorTag: "latest",
ImagePullPolicy: "Always",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
- "--metrics-bind-address=127.0.0.1:8080"
- "--leader-elect"
- "--webhook-enabled=true"
- "--configurator-base-image=vectorized/configurator"
- "--configurator-base-image=redpanda-data/redpanda-operator" # The redpanda-operator in version 22.1.3 does not have common entrypoint to host operator and configurator. Regardless e2e-unstable is not executed in CI
- "--configurator-tag=v22.1.3"
- "--configurator-image-pull-policy=IfNotPresent"
imagePullPolicy: IfNotPresent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ spec:
spec:
initContainers:
- name: redpanda-configurator
image: "vectorized/configurator:v22.1.3"
image: "redpanda-data/redpanda-operator:v22.1.3"
containers:
- name: redpanda
image: "vectorized/redpanda:v22.1.3"
image: "redpanda-data/redpanda:v22.1.3"
status:
readyReplicas: 2
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
spec:
initContainers:
- name: redpanda-configurator
image: "localhost/configurator:dev"
image: "localhost/redpanda-operator:dev"
containers:
- name: redpanda
image: "vectorized/redpanda:v22.1.3"
Expand All @@ -21,7 +21,7 @@ metadata:
spec:
initContainers:
- name: redpanda-configurator
image: "localhost/configurator:dev"
image: "localhost/redpanda-operator:dev"
status:
phase: "Running"
---
Expand All @@ -32,7 +32,7 @@ metadata:
spec:
initContainers:
- name: redpanda-configurator
image: "localhost/configurator:dev"
image: "localhost/redpanda-operator:dev"
status:
phase: "Running"
---
Expand Down
1 change: 1 addition & 0 deletions taskfiles/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ tasks:
- task: :goreleaser:build-operator-binaries
- task: :k8s:build-and-push-operator-container-image
# Package and push Operator helm chart to Dockerhub
- task: :k8s:package-and-publish-operator-chart

assert-no-diffs:
desc: "Fail on any unexpected diffs to generated files (CI only)"
Expand Down
56 changes: 25 additions & 31 deletions taskfiles/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ tasks:
--tag localhost/redpanda-operator:dev
--load
./dist
- docker buildx build
--platform linux/{{ARCH}}
--file operator/Dockerfile
--target=configurator
--tag localhost/configurator:dev
--load
./dist

fetch-latest-redpanda:
desc: fetch the latest redpanda release and tag it localhost/redpanda:dev
Expand Down Expand Up @@ -209,15 +202,6 @@ tasks:
fi
fi
echo $repo
CONFIGURATOR_REPO:
sh: |
repo="configurator"
if {{regexMatch `^v0\.0\.0-\d{8}git[a-f0-9]{7}$` .TAG_NAME}}; then
if [[ '{{.BRANCH_NAME}}' != 'dev' ]]; then
repo="configurator-internal"
fi
fi
echo $repo
cmds:
- |
if [[ "{{.IS_INTERNAL}}" == "false" && "{{.IS_OPERATOR}}" == "false" ]]; then
Expand All @@ -234,14 +218,6 @@ tasks:
--tag docker.io/redpandadata/{{.OPERATOR_REPO}}:{{.TAG_NAME}}
--push
./dist
- docker buildx build
--platform linux/arm64,linux/amd64
--file operator/Dockerfile
--target configurator
--tag docker.io/vectorized/{{.CONFIGURATOR_REPO}}:{{.TAG_NAME}}
--tag docker.io/redpandadata/{{.CONFIGURATOR_REPO}}:{{.TAG_NAME}}
--push
./dist
# re-enable as part of https://github.com/redpanda-data/cloudv2/issues/3267
# - cmd: docker login docker.cloudsmith.io --username {{.CLOUDSMITH_USERNAME}} --password {{.CLOUDSMITH_API_KEY}}
# silent: true
Expand All @@ -252,13 +228,6 @@ tasks:
# --tag {{.CLOUDSMITH_REPO}}:{{.TAG_NAME}}
# --push
# ./dist
# - docker buildx build
# --platform linux/arm64,linux/amd64
# --file operator/Dockerfile
# --target configurator
# --tag {{.CLOUDSMITH_REPO}}:{{.TAG_NAME}}
# --push
# ./dist
preconditions:
- test -n "$DOCKERHUB_USER"
- test -n "$DOCKERHUB_TOKEN"
Expand All @@ -270,3 +239,28 @@ tasks:
cmds:
- 'echo "~~~ Creating operator v2 helm e2e tests :k8s:"'
- ./hack/v2-helm-setup.sh

package-and-publish-operator-chart:
vars:
TMP_PATH:
sh: mktemp --directory --tmpdir "helm-package-XXXXXXXXXX"
cmds:
- defer: 'rm -r {{.TMP_PATH}}'
- defer: 'helm registry logout registry-1.docker.io'
- helm registry login registry-1.docker.io -u {{.DOCKERHUB_USER}} --password {{.DOCKERHUB_TOKEN}}
- cp -r charts/operator/ {{.TMP_PATH}}
# The Chart.yaml name needs to match with docker hub OCI registry, so that helm push correctly
# finds OCI registry.
# Reference
# https://hub.docker.com/r/redpandadata/redpanda-operator-nightly
- yq -i '.name = "redpanda-operator-nightly"' {{.TMP_PATH}}/operator/Chart.yaml
# The version has suffix -helm-chart to overcome docker hub limitation of the oci artifact types
# Reference
# https://forums.docker.com/t/tag-overlap-in-oci-artifacts/131453
# For usage of operator artifact please go to specific reference like the one below
# https://hub.docker.com/layers/redpandadata/redpanda-operator-nightly/v0.0.0-20250104git4a5a076-helm-chart/images/sha256-ffaea8752b6bd00a26589a168830a87d498106e470f11af0f08267bc13fbd078
- helm package {{.TMP_PATH}}/operator --version "{{.TAG_NAME}}-helm-chart" --destination {{.TMP_PATH}} --dependency-update
- helm push `ls {{.TMP_PATH}}/redpanda-operator-nightly*.tgz` oci://registry-1.docker.io/redpandadata
preconditions:
- test -n "$DOCKERHUB_USER"
- test -n "$DOCKERHUB_TOKEN"