Skip to content

Commit 783dd35

Browse files
Merge branch 'improvement/ZENKO-5196/use-generated-kafka-image-ci' into w/2.14/improvement/ZENKO-5196/use-generated-kafka-image-ci
2 parents 90d69c5 + 2322a73 commit 783dd35

File tree

12 files changed

+109
-31
lines changed

12 files changed

+109
-31
lines changed

.github/scripts/end2end/configs/notification_destinations.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
apiVersion: zenko.io/v1alpha2
3030
kind: ZenkoNotificationTarget
3131
metadata:
32-
name: ${NOTIF_AUTH_DEST_NAME}
32+
name: ${NOTIF_PLAIN_DEST_NAME}
3333
labels:
3434
app.kubernetes.io/instance: ${ZENKO_NAME}
3535
spec:
@@ -41,3 +41,22 @@ spec:
4141
plain:
4242
username: ${NOTIF_AUTH_DEST_USERNAME}
4343
password: ${NOTIF_AUTH_DEST_PASSWORD}
44+
45+
---
46+
47+
apiVersion: zenko.io/v1alpha2
48+
kind: ZenkoNotificationTarget
49+
metadata:
50+
name: ${NOTIF_SCRAM_DEST_NAME}
51+
labels:
52+
app.kubernetes.io/instance: ${ZENKO_NAME}
53+
spec:
54+
type: kafka
55+
host: ${NOTIF_KAFKA_AUTH_HOST}
56+
port: ${NOTIF_KAFKA_SCRAM_PORT}
57+
destinationTopic: ${NOTIF_SCRAM_DEST_TOPIC}
58+
auth: scram
59+
scram:
60+
username: ${NOTIF_SCRAM_DEST_USERNAME}
61+
password: ${NOTIF_SCRAM_DEST_PASSWORD}
62+
mechanism: SHA-512

.github/scripts/end2end/configure-e2e-ctst.sh

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#!/bin/bash
22
set -exu
33

4+
# Get kafka image name and tag
5+
KAFKA_REGISTRY_NAME=$(yq eval ".kafka.sourceRegistry" ../../../solution/deps.yaml)
6+
KAFKA_IMAGE_NAME=$(yq eval ".kafka.image" ../../../solution/deps.yaml)
7+
KAFKA_IMAGE_TAG=$(yq eval ".kafka.tag" ../../../solution/deps.yaml)
8+
KAFKA_IMAGE=$KAFKA_REGISTRY_NAME/$KAFKA_IMAGE_NAME:$KAFKA_IMAGE_TAG
9+
BUILD_TREE_HASH=$(git rev-parse HEAD:solution/kafka)
10+
411
# Setup test environment variables
512
export ZENKO_NAME=${1:-"end2end"}
613
# Getting kafka host from backbeat's config
@@ -14,8 +21,9 @@ export NOTIF_KAFKA_PORT=${KAFKA_HOST_PORT#*:}
1421
export NOTIF_KAFKA_AUTH_HOST="${ZENKO_NAME}-base-queue-auth-0"
1522
export NOTIF_KAFKA_AUTH_HOST_PORT="$NOTIF_KAFKA_AUTH_HOST:$NOTIF_KAFKA_PORT"
1623
export NOTIF_KAFKA_AUTH_PORT=9094
24+
export NOTIF_KAFKA_SCRAM_PORT=9095
1725

18-
# Add an extra SASL_PLAIN Kafka listener, to support testing authenticated Kafka for bucket notifications
26+
# Add extra SASL_PLAIN & SASL_SCRAM Kafka listeners, to support testing authenticated Kafka for bucket notifications
1927
kubectl get zookeepercluster "${ZENKO_NAME}-base-quorum" -o json | jq '.
2028
| .metadata |= {namespace, name: "\(.name)-auth" }
2129
| del(.spec.labels)
@@ -30,10 +38,16 @@ kubectl wait --for=jsonpath='{.status.readyReplicas}'=1 --timeout 10m zookeeperc
3038
kubectl get kafkacluster "${ZENKO_NAME}-base-queue" -o json | jq '.
3139
| .metadata |= {namespace, name: "\(.name)-auth" }
3240
| del(.status)
33-
| .spec.listenersConfig.internalListeners |= . + [{containerPort: 9094, name: "auth", type: "sasl_plaintext", usedForInnerBrokerCommunication: false}]
41+
| .spec.listenersConfig.internalListeners |= . + [
42+
{containerPort: 9094, name: "auth", type: "sasl_plaintext", usedForInnerBrokerCommunication: false},
43+
{containerPort: 9095, name: "scram", type: "sasl_plaintext", usedForInnerBrokerCommunication: false}
44+
]
3445
| .spec.readOnlyConfig |= (. + "
35-
sasl.enabled.mechanisms=PLAIN
46+
sasl.enabled.mechanisms=PLAIN,SCRAM-SHA-512
47+
listener.name.auth.sasl.enabled.mechanisms=PLAIN
3648
listener.name.auth.plain.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username=\"'"$NOTIF_AUTH_DEST_USERNAME"'\" password=\"'"$NOTIF_AUTH_DEST_PASSWORD"'\" user_'"$NOTIF_AUTH_DEST_USERNAME"'=\"'"$NOTIF_AUTH_DEST_PASSWORD"'\";
49+
listener.name.scram.sasl.enabled.mechanisms=SCRAM-SHA-512
50+
listener.name.scram.scram-sha-512.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username=\"'"$NOTIF_SCRAM_DEST_USERNAME"'\" password=\"'"$NOTIF_SCRAM_DEST_PASSWORD"'\" user_'"$NOTIF_SCRAM_DEST_USERNAME"'=\"'"$NOTIF_SCRAM_DEST_PASSWORD"'\";
3751
")
3852
| del(.spec.brokerConfigGroups.default.storageConfigs[].pvcSpec)
3953
| .spec.brokerConfigGroups.default.storageConfigs[].emptyDir |= {medium: "Memory"}
@@ -42,6 +56,19 @@ listener.name.auth.plain.sasl.jaas.config=org.apache.kafka.common.security.plain
4256
' | kubectl apply -f -
4357
kubectl wait --for=jsonpath='{.status.state}'=ClusterRunning --timeout 10m kafkacluster "${ZENKO_NAME}-base-queue-auth"
4458

59+
# Create SCRAM credentials for the SCRAM listener
60+
kubectl run kafka-config \
61+
--image=$KAFKA_IMAGE-$BUILD_TREE_HASH \
62+
--pod-running-timeout=5m \
63+
--rm \
64+
--restart=Never \
65+
--attach=True \
66+
--command -- bash -c \
67+
"kafka-configs.sh --bootstrap-server $NOTIF_KAFKA_AUTH_HOST_PORT \
68+
--alter --add-config 'SCRAM-SHA-512=[password=$NOTIF_SCRAM_DEST_PASSWORD]' \
69+
--entity-type users \
70+
--entity-name $NOTIF_SCRAM_DEST_USERNAME"
71+
4572
UUID=$(kubectl get secret -l app.kubernetes.io/name=backbeat-config,app.kubernetes.io/instance=end2end \
4673
-o jsonpath='{.items[0].data.config\.json}' | base64 -di | jq .extensions.replication.topic)
4774
UUID=${UUID%.*}
@@ -57,12 +84,6 @@ kubectl wait --for condition=DeploymentInProgress=true --timeout 10m zenko/${ZEN
5784
kubectl wait --for condition=DeploymentFailure=false --timeout 10m zenko/${ZENKO_NAME}
5885
kubectl wait --for condition=DeploymentInProgress=false --timeout 10m zenko/${ZENKO_NAME}
5986

60-
# Get kafka image name and tag
61-
KAFKA_REGISTRY_NAME=$(yq eval ".kafka.sourceRegistry" ../../../solution/deps.yaml)
62-
KAFKA_IMAGE_NAME=$(yq eval ".kafka.image" ../../../solution/deps.yaml)
63-
KAFKA_IMAGE_TAG=$(yq eval ".kafka.tag" ../../../solution/deps.yaml)
64-
KAFKA_IMAGE=$KAFKA_REGISTRY_NAME/$KAFKA_IMAGE_NAME:$KAFKA_IMAGE_TAG
65-
6687
# Cold location topic
6788
AZURE_ARCHIVE_STATUS_TOPIC="${UUID}.cold-status-e2e-azure-archive"
6889
AZURE_ARCHIVE_STATUS_TOPIC_2_NV="${UUID}.cold-status-e2e-azure-archive-2-non-versioned"
@@ -71,7 +92,7 @@ AZURE_ARCHIVE_STATUS_TOPIC_2_S="${UUID}.cold-status-e2e-azure-archive-2-suspende
7192

7293
# Creating bucket notification topic in kafka
7394
kubectl run kafka-topics \
74-
--image=$KAFKA_IMAGE \
95+
--image=$KAFKA_IMAGE-$BUILD_TREE_HASH \
7596
--pod-running-timeout=5m \
7697
--rm \
7798
--restart=Never \
@@ -80,6 +101,7 @@ kubectl run kafka-topics \
80101
"kafka-topics.sh --create --topic $NOTIF_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \
81102
kafka-topics.sh --create --topic $NOTIF_ALT_DEST_TOPIC --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \
82103
kafka-topics.sh --create --topic $NOTIF_AUTH_DEST_TOPIC --bootstrap-server $NOTIF_KAFKA_AUTH_HOST_PORT --if-not-exists ; \
104+
kafka-topics.sh --create --topic $NOTIF_SCRAM_DEST_TOPIC --bootstrap-server $NOTIF_KAFKA_AUTH_HOST_PORT --if-not-exists ; \
83105
kafka-topics.sh --create --topic $AZURE_ARCHIVE_STATUS_TOPIC --partitions 10 --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \
84106
kafka-topics.sh --create --topic $AZURE_ARCHIVE_STATUS_TOPIC_2_NV --partitions 10 --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \
85107
kafka-topics.sh --create --topic $AZURE_ARCHIVE_STATUS_TOPIC_2_V --partitions 10 --bootstrap-server $KAFKA_HOST_PORT --if-not-exists ; \

.github/scripts/end2end/configure-e2e.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ KAFKA_IMAGE=$KAFKA_REGISTRY_NAME/$KAFKA_IMAGE_NAME:$KAFKA_IMAGE_TAG
5555
KAFKA_HOST_PORT=$(kubectl get secret -l app.kubernetes.io/name=backbeat-config,app.kubernetes.io/instance=end2end \
5656
-o jsonpath='{.items[0].data.config\.json}' | base64 -di | jq .kafka.hosts)
5757
KAFKA_HOST_PORT=${KAFKA_HOST_PORT:1:-1}
58+
BUILD_TREE_HASH=$(git rev-parse HEAD:solution/kafka)
5859

5960
# Creating replication/transition and notification topics in kafka
6061
kubectl run kafka-topics \
61-
--image=$KAFKA_IMAGE \
62+
--image=$KAFKA_IMAGE-$BUILD_TREE_HASH \
6263
--pod-running-timeout=5m \
6364
--rm \
6465
--restart=Never \

.github/scripts/end2end/deploy-zenko.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function dependencies_env()
8989
echo $(dependencies_policy_env)
9090
echo $(dependencies_config_env)
9191
echo "ZENKO_VERSION_NAME=${ZENKO_VERSION_NAME}"
92+
echo "BUILD_TREE_HASH=$(git rev-parse HEAD:solution/kafka)"
9293
}
9394

9495
create_encryption_secret()

.github/scripts/end2end/run-e2e-ctst.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ KAFKA_HOST_PORT=$(kubectl get secret -l app.kubernetes.io/name=backbeat-config,a
6262
KAFKA_HOST_PORT=${KAFKA_HOST_PORT:1:-1}
6363
KAFKA_PORT=${KAFKA_HOST_PORT#*:}
6464

65+
# Subtle: we push to the authenticated Kafka through SASL/PLAIN and SASL/SCRAM,
66+
# as defined in notification_destinations.yaml, but we check the resulting
67+
# notification in the tests through the unauthenticated listener.
68+
# This is why we reuse the base Kafka port here, rather than 9094/9095.
69+
# This variable is used for checking the notifications only.
6570
KAFKA_AUTH_HOST="end2end-base-queue-auth-0"
6671
KAFKA_AUTH_HOST_PORT="$KAFKA_AUTH_HOST:$KAFKA_PORT"
6772

@@ -98,10 +103,10 @@ WORLD_PARAMETERS="$(jq -c <<EOF
98103
"NotificationDestinationTopic":"${NOTIF_DEST_TOPIC}",
99104
"NotificationDestinationAlt":"${NOTIF_ALT_DEST_NAME}",
100105
"NotificationDestinationTopicAlt":"${NOTIF_ALT_DEST_TOPIC}",
101-
"NotificationDestinationAuth":"${NOTIF_AUTH_DEST_NAME}",
102-
"NotificationDestinationTopicAuth":"${NOTIF_AUTH_DEST_TOPIC}",
103-
"NotificationDestinationAuthUsername":"${NOTIF_AUTH_DEST_USERNAME}",
104-
"NotificationDestinationAuthPassword":"${NOTIF_AUTH_DEST_PASSWORD}",
106+
"NotificationDestinationPlain":"${NOTIF_PLAIN_DEST_NAME}",
107+
"NotificationDestinationTopicPlain":"${NOTIF_AUTH_DEST_TOPIC}",
108+
"NotificationDestinationScram":"${NOTIF_SCRAM_DEST_NAME}",
109+
"NotificationDestinationTopicScram":"${NOTIF_SCRAM_DEST_TOPIC}",
105110
"KafkaExternalIps": "${KAFKA_EXTERNAL_IP:-}",
106111
"PrometheusService":"${PROMETHEUS_NAME}-operated.default.svc.cluster.local",
107112
"KafkaHosts":"${KAFKA_HOST_PORT}",

.github/workflows/end2end.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,14 @@ env:
9595
NOTIF_DEST_TOPIC: "destination-topic-1"
9696
NOTIF_ALT_DEST_NAME: "destination2"
9797
NOTIF_ALT_DEST_TOPIC: "destination-topic-2"
98-
NOTIF_AUTH_DEST_NAME: "destination3"
98+
NOTIF_PLAIN_DEST_NAME: "destination3"
9999
NOTIF_AUTH_DEST_TOPIC: "destination-topic-3"
100100
NOTIF_AUTH_DEST_USERNAME: "admin"
101101
NOTIF_AUTH_DEST_PASSWORD: "admin-secret"
102+
NOTIF_SCRAM_DEST_NAME: "destination4"
103+
NOTIF_SCRAM_DEST_TOPIC: "destination-topic-4"
104+
NOTIF_SCRAM_DEST_USERNAME: "admin"
105+
NOTIF_SCRAM_DEST_PASSWORD: "admin-secret"
102106
SUBDOMAIN: "zenko.local"
103107
DR_SUBDOMAIN: "dr.zenko.local"
104108
SKOPEO_PATH: "/tmp"

solution/deps.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ vault:
130130
zenko-operator:
131131
sourceRegistry: ghcr.io/scality
132132
image: zenko-operator
133-
tag: v1.8.2
133+
tag: v1.8.3
134134
envsubst: ZENKO_OPERATOR_TAG
135135
zookeeper:
136-
sourceRegistry: pravega
136+
sourceRegistry: ghcr.io/adobe/zookeeper-operator
137137
image: zookeeper
138-
tag: 0.2.15
138+
tag: 3.8.4-0.2.15-adobe-20250923
139139
envsubst: ZOOKEEPER_TAG

solution/kafka/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN tar -xzf $kafka_distro
2222
RUN rm -r kafka_$scala_version-$kafka_version/bin/windows
2323

2424
####################################################################################################
25-
FROM eclipse-temurin:17.0.3_7-jre
25+
FROM eclipse-temurin:17.0.18_8-jre
2626

2727
ARG scala_version=2.13
2828
ARG kafka_version=3.1.0

solution/zenkoversion.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ spec:
9696
tag: ${KAFKA_CLEANER_TAG}
9797
cluster:
9898
image: ${KAFKA_IMAGE}
99-
tag: ${KAFKA_TAG}
99+
tag: ${KAFKA_TAG}-${BUILD_TREE_HASH}
100100
connect:
101101
image: ${KAFKA_CONNECT_IMAGE}
102-
tag: ${KAFKA_CONNECT_TAG}
102+
tag: ${KAFKA_CONNECT_TAG}-${BUILD_TREE_HASH}
103103
cruiseControl:
104104
image: ${KAFKA_CRUISECONTROL_IMAGE}
105105
tag: ${KAFKA_CRUISECONTROL_TAG}

tests/ctst/features/bucket-notifications/notifications.feature

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,24 @@ Feature: Bucket notifications
100100
@BucketNotification
101101
Scenario Outline: Receive notification for configured events in authenticated notification destinations
102102
Given a "<versioningConfiguration>" bucket
103-
And one authenticated notification destination
103+
And one PLAIN authenticated notification destination
104+
When i subscribe to "<subscribedNotificationType>" notifications for destination <destination>
105+
And a "<notificationType>" event is triggered "<enable>" "<filterType>"
106+
Then i should "<shouldReceive>" a notification for "<notificationType>" event in destination <destination>
107+
108+
Examples:
109+
| versioningConfiguration | subscribedNotificationType | notificationType | enable | filterType | shouldReceive | destination |
110+
| Non versioned | s3:ObjectCreated:* | s3:ObjectCreated:Put | without | filter | receive | 0 |
111+
| Versioned | s3:ObjectCreated:* | s3:ObjectCreated:Copy | without | filter | receive | 0 |
112+
| Versioning suspended | s3:ObjectCreated:* | s3:ObjectCreated:Put | without | filter | receive | 0 |
113+
114+
@2.6.0
115+
@PreMerge
116+
@Flaky
117+
@BucketNotification
118+
Scenario Outline: Receive notification for configured events in SCRAM authenticated notification destinations
119+
Given a "<versioningConfiguration>" bucket
120+
And one SCRAM authenticated notification destination
104121
When i subscribe to "<subscribedNotificationType>" notifications for destination <destination>
105122
And a "<notificationType>" event is triggered "<enable>" "<filterType>"
106123
Then i should "<shouldReceive>" a notification for "<notificationType>" event in destination <destination>

0 commit comments

Comments
 (0)