Skip to content

Commit 04d7cb1

Browse files
committed
Publish docker images and helm chart also to Github Container Registry
1 parent 8d0edd2 commit 04d7cb1

36 files changed

+244
-227
lines changed

.github/workflows/build-push-docker.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/build-push-kafka-docker.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: build-publish-operator-docker-and-chart
2+
3+
on:
4+
push:
5+
tags-ignore:
6+
- 'kafka-*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
# GitHub Container Registry
14+
GHCR_REGISTRY: ghcr.io
15+
# github.repository as <account>/<repo>
16+
GHCR_IMAGE_NAME: ${{ github.repository }}
17+
# Docker Hub image name
18+
DOCKERHUB_IMAGE: adobe/kafka-operator
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v5
29+
- name: Get tag name
30+
id: vars
31+
run: echo "tag=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
32+
# Login against Docker Hub
33+
- name: Login to DockerHub Registry
34+
uses: docker/login-action@v3
35+
with:
36+
username: ${{ secrets.DOCKER_USERNAME }}
37+
password: ${{ secrets.DOCKER_PASSWORD }}
38+
# Login against GitHub Container Registry
39+
- name: Log into GitHub Container Registry ${{ env.GHCR_REGISTRY }}
40+
uses: docker/login-action@v3
41+
with:
42+
registry: ${{ env.GHCR_REGISTRY }}
43+
username: ${{ github.actor }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
- name: Set Release Date
46+
run: |
47+
echo "BUILT_AT=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@v3
50+
# Extract metadata (tags, labels) for Docker
51+
- name: Extract Docker metadata
52+
id: meta
53+
uses: docker/metadata-action@v5
54+
with:
55+
images: |
56+
${{ env.DOCKERHUB_IMAGE }}
57+
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}
58+
tags: |
59+
type=ref,event=tag
60+
- name: Build and push operator docker image
61+
uses: docker/build-push-action@v6
62+
with:
63+
context: .
64+
file: ./Dockerfile
65+
build-args: |
66+
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
67+
BUILT_AT=${{ env.BUILT_AT }}
68+
GIT_SHA=${{ github.sha }}
69+
tags: ${{ steps.meta.outputs.tags }}
70+
labels: ${{ steps.meta.outputs.labels }}
71+
push: ${{ startsWith(github.ref, 'refs/tags/') }}
72+
# Update Helm Chart version
73+
- name: Update Chart.yaml version
74+
run: |
75+
sed -i "s/^version:.*/version: \"${{ steps.vars.outputs.tag }}\"/" charts/kafka-operator/Chart.yaml
76+
sed -i "s/^appVersion:.*/appVersion: \"${{ steps.vars.outputs.tag }}\"/" charts/kafka-operator/Chart.yaml
77+
# Push Helm Chart to GitHub Container Registry
78+
- name: Push Helm Chart to GHCR
79+
uses: appany/[email protected]
80+
with:
81+
name: chart
82+
repository: ${{ github.repository_owner }}
83+
tag: ${{ steps.vars.outputs.tag }}
84+
path: charts/kafka-operator
85+
registry: ${{ env.GHCR_REGISTRY }}
86+
registry_username: ${{ github.actor }}
87+
registry_password: ${{ secrets.GITHUB_TOKEN }}
88+
update_dependencies: 'true'
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: build-publish-kafka-docker-image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'kafka-*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
# GitHub Container Registry
14+
GHCR_REGISTRY: ghcr.io
15+
# github.repository as <account>/<repo>
16+
GHCR_IMAGE_NAME: ${{ github.repository }}/kafka
17+
# Docker Hub image name
18+
DOCKERHUB_IMAGE: adobe/kafka
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
packages: write
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v5
29+
# Login against Docker Hub
30+
- name: Login to DockerHub Registry
31+
if: startsWith(github.ref, 'refs/tags/')
32+
uses: docker/login-action@v3
33+
with:
34+
username: ${{ secrets.DOCKER_USERNAME }}
35+
password: ${{ secrets.DOCKER_PASSWORD }}
36+
# Login against GitHub Container Registry
37+
- name: Log into GitHub Container Registry ${{ env.GHCR_REGISTRY }}
38+
if: startsWith(github.ref, 'refs/tags/')
39+
uses: docker/login-action@v3
40+
with:
41+
registry: ${{ env.GHCR_REGISTRY }}
42+
username: ${{ github.actor }}
43+
password: ${{ secrets.GITHUB_TOKEN }}
44+
- name: Set Release Date
45+
run: |
46+
echo "BUILT_AT=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
47+
- name: Set up QEMU
48+
uses: docker/setup-qemu-action@v3
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v3
51+
- name: Extract Docker metadata
52+
id: meta
53+
uses: docker/metadata-action@v5
54+
with:
55+
images: |
56+
${{ env.DOCKERHUB_IMAGE }}
57+
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}
58+
tags: |
59+
type=match,pattern=kafka-(.*),group=1
60+
- name: Build and push
61+
uses: docker/build-push-action@v6
62+
with:
63+
context: docker/kafka
64+
platforms: linux/amd64,linux/arm64
65+
push: ${{ startsWith(github.ref, 'refs/tags/') }}
66+
tags: ${{ steps.meta.outputs.tags }}
67+
labels: ${{ steps.meta.outputs.labels }}
68+
build-args: |
69+
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
70+
BUILT_AT=${{ env.BUILT_AT }}
71+
COMMIT=${{ github.sha }}

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ zookeeper-operator-54444dbd9d-2tccj 1/1 Running 0 28m
101101

102102
### Install Koperator
103103

104-
You can deploy Koperator using a Helm chart. Complete the following steps.
104+
You can deploy Koperator using a Helm chart from GitHub Container Registry (OCI). Complete the following steps.
105105

106106
1. Install the Koperator `CustomResourceDefinition` resources (adjust the version number to the Koperator release you want to install). This is performed in a separate step to allow you to uninstall and reinstall Koperator without deleting your already installed custom resources.
107107

@@ -112,10 +112,30 @@ kubectl apply -f https://raw.githubusercontent.com/adobe/koperator/refs/heads/ma
112112
kubectl apply -f https://raw.githubusercontent.com/adobe/koperator/refs/heads/master/config/base/crds/kafka.banzaicloud.io_kafkausers.yaml
113113
```
114114

115-
1. Install Koperator into the `kafka` namespace:
115+
2. Install Koperator into the `kafka` namespace using the OCI Helm chart from GitHub Container Registry:
116+
117+
> 📦 **View available versions**: [ghcr.io/adobe/koperator/chart](https://github.com/adobe/koperator/pkgs/container/koperator/chart)
118+
119+
```sh
120+
# Install the latest release
121+
helm install kafka-operator oci://ghcr.io/adobe/koperator/chart --namespace=kafka --create-namespace
122+
123+
# Or install a specific version (replace with desired version)
124+
helm install kafka-operator oci://ghcr.io/adobe/koperator/chart --version 0.28.0-adobe-20250911 --namespace=kafka --create-namespace
125+
```
126+
127+
#### Pull and inspect the chart before installation
116128

117129
```sh
118-
helm install kafka-operator --repo https://kubernetes-charts.banzaicloud.com kafka-operator --namespace=kafka --create-namespace
130+
# Pull the chart locally
131+
helm pull oci://ghcr.io/adobe/koperator/chart --version 0.28.0-adobe-20250911
132+
133+
# Extract and inspect
134+
tar -xzf chart-0.28.0-adobe-20250911.tgz
135+
helm template kafka-operator ./chart/
136+
137+
# Install from local chart
138+
helm install kafka-operator ./chart/ --namespace=kafka --create-namespace
119139
```
120140

121141
1. Create the Kafka cluster using the `KafkaCluster` custom resource. The quick start uses a minimal custom resource, but there are other examples in the same directory.

api/v1beta1/kafkacluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const (
5656
DefaultCruiseControlImage = "ghcr.io/banzaicloud/cruise-control:2.5.123"
5757

5858
// DefaultKafkaImage is the default Kafka image used when users don't specify it in KafkaClusterSpec.ClusterImage
59-
DefaultKafkaImage = "ghcr.io/banzaicloud/kafka:2.13-3.4.1"
59+
DefaultKafkaImage = "ghcr.io/adobe/kafka:2.13-3.9.1"
6060

6161
// ControllerNodeProcessRole represents the node is a controller node
6262
ControllerNodeProcessRole = "controller"
@@ -126,7 +126,7 @@ const (
126126
defaultKafkaClusterK8sClusterDomain = "cluster.local"
127127

128128
// KafkaBroker.spec.container["kafka"].image
129-
defaultKafkaImage = "ghcr.io/banzaicloud/kafka:2.13-3.4.1"
129+
defaultKafkaImage = "ghcr.io/adobe/kafka:2.13-3.9.1"
130130

131131
/* Istio Ingress Config */
132132

charts/kafka-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: kafka-operator
33
version: 0.26.0-dev.0
44
description: kafka-operator manages Kafka deployments on Kubernetes
55
sources:
6-
- https://github.com/banzaicloud/koperator
6+
- https://github.com/adobe/koperator
77
appVersion: v0.26.0-dev.0

charts/kafka-operator/README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
11
# Koperator chart
22

3-
The [Koperator](https://github.com/banzaicloud/koperator) is a Kubernetes operator to deploy and manage [Apache Kafka](https://kafka.apache.org) resources for a Kubernetes cluster.
3+
The [Koperator](https://github.com/adobe/koperator) is a Kubernetes operator to deploy and manage [Apache Kafka](https://kafka.apache.org) resources for a Kubernetes cluster.
44

55
## Prerequisites
66

77
- Kubernetes 1.15.0+
8+
- Helm 3.8+ (for OCI registry support)
89

910
## Installing the chart
1011

1112
Before installing the chart, you must first install the Koperator CustomResourceDefinition resources.
1213
This is performed in a separate step to allow you to easily uninstall and reinstall Koperator without deleting your installed custom resources.
1314

14-
```
15-
kubectl create --validate=false -f https://github.com/banzaicloud/koperator/releases/download/v0.25.1/kafka-operator.crds.yaml
15+
```bash
16+
kubectl apply -f https://raw.githubusercontent.com/adobe/koperator/refs/heads/master/config/base/crds/kafka.banzaicloud.io_cruisecontroloperations.yaml
17+
kubectl apply -f https://raw.githubusercontent.com/adobe/koperator/refs/heads/master/config/base/crds/kafka.banzaicloud.io_kafkaclusters.yaml
18+
kubectl apply -f https://raw.githubusercontent.com/adobe/koperator/refs/heads/master/config/base/crds/kafka.banzaicloud.io_kafkatopics.yaml
19+
kubectl apply -f https://raw.githubusercontent.com/adobe/koperator/refs/heads/master/config/base/crds/kafka.banzaicloud.io_kafkausers.yaml
1620
```
1721

18-
To install the chart:
22+
To install the chart from the OCI registry:
1923

20-
```
21-
$ helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com
22-
$ helm install kafka-operator --create-namespace --namespace=kafka banzaicloud-stable/kafka-operator
24+
> 📦 **View available versions**: [ghcr.io/adobe/koperator/chart](https://github.com/adobe/koperator/pkgs/container/koperator/chart)
25+
26+
```bash
27+
# Install the latest release
28+
helm install kafka-operator oci://ghcr.io/adobe/koperator/chart --namespace=kafka --create-namespace
29+
30+
# Or install a specific version
31+
helm install kafka-operator oci://ghcr.io/adobe/koperator/chart --version 0.28.0-adobe-20250911 --namespace=kafka --create-namespace
2332
```
2433

25-
To install the operator using an already installed cert-manager
34+
To install the operator using an already installed cert-manager:
2635
```bash
27-
$ helm install kafka-operator --set certManager.namespace=<your cert manager namespace> --namespace=kafka --create-namespace banzaicloud-stable/kafka-operator
36+
helm install kafka-operator oci://ghcr.io/adobe/koperator/chart --set certManager.namespace=<your cert manager namespace> --namespace=kafka --create-namespace
2837
```
2938

3039
## Upgrading the chart
@@ -33,7 +42,11 @@ To upgrade the chart since the helm 3 limitation you have to set a value as well
3342
If this value is not set your CRDs might be deleted.
3443

3544
```bash
36-
helm upgrade kafka-operator --set --namespace=kafka banzaicloud-stable/kafka-operator
45+
# Upgrade to latest version
46+
helm upgrade kafka-operator oci://ghcr.io/adobe/koperator/chart --namespace=kafka
47+
48+
# Upgrade to specific version
49+
helm upgrade kafka-operator oci://ghcr.io/adobe/koperator/chart --version 0.28.0-adobe-20250911 --namespace=kafka
3750
```
3851

3952
## Uninstalling the Chart
@@ -52,8 +65,8 @@ The following table lists the configurable parameters of the Banzaicloud Kafka O
5265

5366
Parameter | Description | Default
5467
--------- | ----------- | -------
55-
`operator.image.repository` | Operator container image repository | `ghcr.io/banzaicloud/kafka-operator`
56-
`operator.image.tag` | Operator container image tag | `v0.26.0-dev.0`
68+
`operator.image.repository` | Operator container image repository | `ghcr.io/adobe/koperator`
69+
`operator.image.tag` | Operator container image tag | `0.28.0-adobe-20250911`
5770
`operator.image.pullPolicy` | Operator container image pull policy | `IfNotPresent`
5871
`operator.serviceAccount.name` | ServiceAccount used by the operator pod | `kafka-operator`
5972
`operator.serviceAccount.create` | If true, create the `operator.serviceAccount.name` service account | `true`

0 commit comments

Comments
 (0)