-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes kafkaList + updates to 29.3.14 + adds new test (#110)
- Loading branch information
Showing
7 changed files
with
68 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
{{- if .Values.kafka.discoverable.allow }} | ||
{{- $fullname := include "common.names.fullname" . }} | ||
{{- $secretName := printf "%s-%s" "discoverable" $fullname -}} | ||
{{- $fullname := include "common.names.fullname" .Subcharts.kafka -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ $secretName }} | ||
name: discoverable-{{ $fullname }} | ||
annotations: | ||
onyxia/discovery: "kafka" | ||
type: Opaque | ||
data: | ||
kafka-service: {{ (include "kafkaList" .) | b64enc | quote }} | ||
kafka-service: {{ (printf "%s:%d" $fullname (.Values.kafka.service.ports.client | int)) | b64enc | quote }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ include "library-chart.fullname" . }}-test-confluent-kafka" | ||
labels: | ||
{{- include "library-chart.labels" . | nindent 4 }} | ||
annotations: | ||
"helm.sh/hook": test | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
containers: | ||
- name: {{ include "library-chart.fullname" . }}-test-confluent-kafka | ||
image: "inseefrlab/onyxia-python-minimal" | ||
command: ["/bin/sh","-c"] | ||
args: | ||
- | | ||
pip3 install confluent-kafka && timeout 2m python3 <<EOF | ||
from confluent_kafka import Producer, Consumer | ||
import socket | ||
kafka_server = "{{ template "common.names.fullname" . }}:{{ .Values.kafka.service.ports.client }}" | ||
print("Setting up producer...") | ||
pconf = { | ||
'bootstrap.servers': kafka_server, | ||
'client.id': socket.gethostname() | ||
} | ||
producer = Producer(pconf) | ||
print("Sending message to topic `helm-test-kafka-db`...") | ||
producer.produce("helm-test-kafka-db", key="Test result", value="Success!") | ||
producer.flush() | ||
print("Setting up consumer...") | ||
cconf = {'bootstrap.servers': kafka_server, | ||
'group.id': 'foo', | ||
'auto.offset.reset': 'smallest'} | ||
consumer = Consumer(cconf) | ||
consumer.subscribe(["helm-test-kafka-db"]) | ||
print("Waiting message from topic `helm-test-kafka-db`...") | ||
while True: | ||
try: | ||
msg = consumer.poll(1.0) | ||
if msg is None: | ||
continue | ||
else: | ||
print(msg.value()) | ||
exit(0) | ||
except KeyboardInterrupt: | ||
exit(1) | ||
EOF | ||
restartPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ kafka: | |
interbroker: | ||
protocol: PLAINTEXT | ||
fullnameOverride: kafka | ||
|