Skip to content

Commit

Permalink
Merge pull request #84 from alercebroker/prv-candidates/separated-kaf…
Browse files Browse the repository at this point in the history
…ka-clients

Prv Candidates: separated kafka clients
  • Loading branch information
dirodriguezm authored Apr 13, 2023
2 parents 4f7ee61 + 0ac07ab commit 68f4a23
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 19 deletions.
4 changes: 2 additions & 2 deletions charts/prv_candidates/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: "rc-9442894"
appVersion: "rc-97da10d"
description: Previous candidates processor step
name: prv-candidates
type: application
version: 0.4.0
version: 0.5.0
5 changes: 4 additions & 1 deletion charts/prv_candidates/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ metadata:
data:
consumer-topics: {{ .Values.configmap.consumerTopics }}
consume-messages: "{{ .Values.configmap.consumeMessages }}"
internal-server: {{ .Values.configmap.internalServer }}
consumer-server: {{ .Values.configmap.consumerServer }}
scribe-server: {{ .Values.configmap.scribeServer }}
scribe-topic: {{ .Values.configmap.scribeTopic }}
producer-server: {{ .Values.configmap.producerServer }}
producer-topic: {{ .Values.configmap.producerTopic }}
metrics-server: {{ .Values.configmap.metricsServer }}
metrics-topic: {{ .Values.configmap.metricsTopic }}
56 changes: 46 additions & 10 deletions charts/prv_candidates/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
valueFrom:
configMapKeyRef:
name: {{ include "prv-candidates.fullname" . }}
key: internal-server
key: consumer-server
- name: CONSUMER_GROUP_ID
value: {{ include "prv-candidates.fullname" . }}
- name: CONSUME_MESSAGES
Expand All @@ -57,17 +57,17 @@ spec:
valueFrom:
configMapKeyRef:
name: {{ include "prv-candidates.fullname" . }}
key: internal-server
key: producer-server
- name: PRODUCER_TOPIC
valueFrom:
configMapKeyRef:
name: {{ include "prv-candidates.fullname" . }}
key: producer-topic
- name: SCRIBE_SERVER
- name: SCRIBE_PRODUCER_SERVER
valueFrom:
configMapKeyRef:
name: {{ include "prv-candidates.fullname" . }}
key: internal-server
key: scribe-server
- name: SCRIBE_PRODUCER_TOPIC
valueFrom:
configMapKeyRef:
Expand All @@ -77,23 +77,59 @@ spec:
valueFrom:
configMapKeyRef:
name: {{ include "prv-candidates.fullname" . }}
key: internal-server
key: metrics-server
- name: METRICS_TOPIC
valueFrom:
configMapKeyRef:
name: {{ include "prv-candidates.fullname" . }}
key: metrics-topic
{{- if .Values.secrets.kafkaAuth.enabled }}
- name: KAFKA_USERNAME
{{- if .Values.secrets.kafkaAuth.consumer.enabled }}
- name: CONSUMER_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: username
- name: KAFKA_PASSWORD
key: consumer-username
- name: CONSUMER_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: password
key: consumer-password
{{- end}}
{{- if .Values.secrets.kafkaAuth.producer.enabled }}
- name: PRODUCER_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: producer-username
- name: PRODUCER_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: producer-password
{{- end}}
{{- if .Values.secrets.kafkaAuth.scribe.enabled }}
- name: SCRIBE_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: scribe-username
- name: SCRIBE_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: scribe-password
{{- end}}
{{- if .Values.secrets.kafkaAuth.metrics.enabled }}
- name: METRICS_KAFKA_USERNAME
valueFrom:
secretKeyRef:
name: kafka-auth
key: metrics-username
- name: METRICS_KAFKA_PASSWORD
valueFrom:
secretKeyRef:
name: kafka-auth
key: metrics-password
{{- end}}
{{- with .Values.affinity }}
affinity:
Expand Down
10 changes: 8 additions & 2 deletions charts/prv_candidates/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@ metadata:
name: kafka-auth
namespace: {{ .Values.namespace }}
stringData:
username: "{{ .Values.secrets.kafkaAuth.username }}"
password: "{{ .Values.secrets.kafkaAuth.password }}"
consumer-username: "{{ .Values.secrets.kafkaAuth.consumer.username }}"
consumer-password: "{{ .Values.secrets.kafkaAuth.consumer.password }}"
producer-username: "{{ .Values.secrets.kafkaAuth.producer.username }}"
producer-password: "{{ .Values.secrets.kafkaAuth.producer.password }}"
scribe-username: "{{ .Values.secrets.kafkaAuth.scribe.username }}"
scribe-password: "{{ .Values.secrets.kafkaAuth.scribe.password }}"
metrics-username: "{{ .Values.secrets.kafkaAuth.metrics.username }}"
metrics-password: "{{ .Values.secrets.kafkaAuth.metrics.password }}"
24 changes: 20 additions & 4 deletions charts/prv_candidates/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ affinity:
configmap:
consumerTopics: ""
consumeMessages: ""
internalServer: ""
consumerServer: ""
scribeServer: ""
scribeTopic: ""
metricsServer: ""
metricsTopic: ""
producerServer: ""
producerTopic: ""

imageCredentials:
Expand All @@ -57,6 +60,19 @@ imageCredentials:

secrets:
kafkaAuth:
enabled: false
username: ""
password: ""
consumer:
enabled: false
username: ""
password: ""
producer:
enabled: false
username: ""
password: ""
scribe:
enabled: false
username: ""
password: ""
metrics:
enabled: false
username: ""
password: ""

0 comments on commit 68f4a23

Please sign in to comment.