From 9cf20c087990a517be32cb9deb4712c67569cfdb Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 22 Mar 2023 15:44:38 -0300 Subject: [PATCH] feat(sorting-hat): separated kafka auth for consumer and producer Also delete sorting-hat msk chart --- charts/sorting-hat-msk/.helmignore | 23 ----- charts/sorting-hat-msk/Chart.yaml | 6 -- charts/sorting-hat-msk/templates/_helpers.tpl | 68 ------------- .../sorting-hat-msk/templates/configmap.yaml | 26 ----- .../templates/deployment_atlas.yaml | 96 ------------------- .../templates/deployment_ztf.yaml | 96 ------------------- charts/sorting-hat-msk/templates/hpa.yaml | 94 ------------------ .../sorting-hat-msk/templates/namespace.yaml | 6 -- charts/sorting-hat-msk/templates/secret.yaml | 18 ---- charts/sorting-hat-msk/templates/service.yaml | 35 ------- charts/sorting-hat-msk/values.yaml | 77 --------------- charts/sorting-hat/Chart.yaml | 4 +- charts/sorting-hat/templates/configmap.yaml | 10 +- .../templates/deployment_atlas.yaml | 40 ++++++-- .../sorting-hat/templates/deployment_ztf.yaml | 40 ++++++-- charts/sorting-hat/templates/secret.yaml | 8 +- charts/sorting-hat/values.yaml | 4 +- 17 files changed, 82 insertions(+), 569 deletions(-) delete mode 100644 charts/sorting-hat-msk/.helmignore delete mode 100644 charts/sorting-hat-msk/Chart.yaml delete mode 100644 charts/sorting-hat-msk/templates/_helpers.tpl delete mode 100644 charts/sorting-hat-msk/templates/configmap.yaml delete mode 100644 charts/sorting-hat-msk/templates/deployment_atlas.yaml delete mode 100644 charts/sorting-hat-msk/templates/deployment_ztf.yaml delete mode 100644 charts/sorting-hat-msk/templates/hpa.yaml delete mode 100644 charts/sorting-hat-msk/templates/namespace.yaml delete mode 100644 charts/sorting-hat-msk/templates/secret.yaml delete mode 100644 charts/sorting-hat-msk/templates/service.yaml delete mode 100644 charts/sorting-hat-msk/values.yaml diff --git a/charts/sorting-hat-msk/.helmignore b/charts/sorting-hat-msk/.helmignore deleted file mode 100644 index 0e8a0eb..0000000 --- a/charts/sorting-hat-msk/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/charts/sorting-hat-msk/Chart.yaml b/charts/sorting-hat-msk/Chart.yaml deleted file mode 100644 index 5bf86e8..0000000 --- a/charts/sorting-hat-msk/Chart.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v2 -appVersion: "rc-a024e7a" -description: Sorting Hat Step with MSK -name: sorting-hat-msk -type: application -version: 0.1.0 diff --git a/charts/sorting-hat-msk/templates/_helpers.tpl b/charts/sorting-hat-msk/templates/_helpers.tpl deleted file mode 100644 index f2976a3..0000000 --- a/charts/sorting-hat-msk/templates/_helpers.tpl +++ /dev/null @@ -1,68 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "sorting-hat.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "sorting-hat.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "sorting-hat.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "sorting-hat.labels" -}} -helm.sh/chart: {{ include "sorting-hat.chart" . }} -{{ include "sorting-hat.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "sorting-hat.selectorLabels" -}} -app.kubernetes.io/name: {{ include "sorting-hat.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "sorting-hat.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "sorting-hat.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} - -{{- define "imagePullSecret" }} -{{- with .Values.imageCredentials }} -{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/sorting-hat-msk/templates/configmap.yaml b/charts/sorting-hat-msk/templates/configmap.yaml deleted file mode 100644 index 46b7b99..0000000 --- a/charts/sorting-hat-msk/templates/configmap.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - namespace: {{ .Values.namespace }} -data: - consumer-topics: {{ .Values.configmap.consumerTopics.atlas }} - consumer-group-id: {{ .Values.configmap.consumerGroupId.atlas | default (printf "%s-atlas" (include "sorting-hat.fullname" .)) }} - internal-server: {{ .Values.configmap.internalServer }} - producer-topic: {{ .Values.configmap.producerTopic.atlas }} - metrics-topic: {{ .Values.configmap.metricsTopic }} - mongo-secret-name: {{ .Values.configmap.mongoSecretName }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - namespace: {{ .Values.namespace }} -data: - consumer-topics: {{ .Values.configmap.consumerTopics.ztf }} - consumer-group-id: {{ .Values.configmap.consumerGroupId.ztf | default (printf "%s-atlas" (include "sorting-hat.fullname" .)) }} - internal-server: {{ .Values.configmap.internalServer }} - producer-topic: {{ .Values.configmap.producerTopic.ztf }} - metrics-topic: {{ .Values.configmap.metricsTopic }} - mongo-secret-name: {{ .Values.configmap.mongoSecretName }} \ No newline at end of file diff --git a/charts/sorting-hat-msk/templates/deployment_atlas.yaml b/charts/sorting-hat-msk/templates/deployment_atlas.yaml deleted file mode 100644 index 3129330..0000000 --- a/charts/sorting-hat-msk/templates/deployment_atlas.yaml +++ /dev/null @@ -1,96 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - namespace: {{ .Values.namespace }} - labels: - {{- include "sorting-hat.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.atlas.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - app.kubernetes.io/name: '{{ include "sorting-hat.name" . }}-atlas' - app.kubernetes.io/instance: {{ .Release.Name }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - app.kubernetes.io/name: '{{ include "sorting-hat.name" . }}-atlas' - app.kubernetes.io/instance: {{ .Release.Name }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: metrics - containerPort: 8000 - protocol: TCP - resources: - {{- toYaml .Values.resources | nindent 12 }} - env: - - name: CONSUMER_TOPICS - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: consumer-topics - - name: CONSUMER_SERVER - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: internal-server - - name: CONSUMER_GROUP_ID - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: consumer-group-id - - name: PRODUCER_SERVER - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: internal-server - - name: PRODUCER_TOPIC - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: producer-topic - - name: MONGODB_SECRET_NAME - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: mongo-secret-name - - name: METRICS_HOST - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: internal-server - - name: METRICS_TOPIC - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: metrics-topic - {{- if .Values.secrets.kafkaAuth.enabled }} - - name: KAFKA_USERNAME - valueFrom: - secretKeyRef: - name: kafka-auth - key: username - - name: KAFKA_PASSWORD - valueFrom: - secretKeyRef: - name: kafka-auth - key: password - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} \ No newline at end of file diff --git a/charts/sorting-hat-msk/templates/deployment_ztf.yaml b/charts/sorting-hat-msk/templates/deployment_ztf.yaml deleted file mode 100644 index 67244a1..0000000 --- a/charts/sorting-hat-msk/templates/deployment_ztf.yaml +++ /dev/null @@ -1,96 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - namespace: {{ .Values.namespace }} - labels: - {{- include "sorting-hat.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.ztf.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - app.kubernetes.io/name: '{{ include "sorting-hat.name" . }}-ztf' - app.kubernetes.io/instance: {{ .Release.Name }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - app.kubernetes.io/name: '{{ include "sorting-hat.name" . }}-ztf' - app.kubernetes.io/instance: {{ .Release.Name }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: {{ .Chart.Name }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: metrics - containerPort: 8000 - protocol: TCP - resources: - {{- toYaml .Values.resources | nindent 12 }} - env: - - name: CONSUMER_TOPICS - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: consumer-topics - - name: CONSUMER_SERVER - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: internal-server - - name: CONSUMER_GROUP_ID - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: consumer-group-id - - name: PRODUCER_SERVER - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: internal-server - - name: PRODUCER_TOPIC - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: producer-topic - - name: MONGODB_SECRET_NAME - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: mongo-secret-name - - name: METRICS_HOST - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: internal-server - - name: METRICS_TOPIC - valueFrom: - configMapKeyRef: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: metrics-topic - {{- if .Values.secrets.kafkaAuth.enabled }} - - name: KAFKA_USERNAME - valueFrom: - secretKeyRef: - name: kafka-auth - key: username - - name: KAFKA_PASSWORD - valueFrom: - secretKeyRef: - name: kafka-auth - key: password - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/charts/sorting-hat-msk/templates/hpa.yaml b/charts/sorting-hat-msk/templates/hpa.yaml deleted file mode 100644 index 910a218..0000000 --- a/charts/sorting-hat-msk/templates/hpa.yaml +++ /dev/null @@ -1,94 +0,0 @@ ---- -{{- if .Values.autoscaling.ztf.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - namespace: {{ .Values.namespace }} - labels: - {{- include "sorting-hat.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: '{{ include "sorting-hat.fullname" . }}-ztf' - minReplicas: {{ .Values.autoscaling.ztf.minReplicas }} - maxReplicas: {{ .Values.autoscaling.ztf.maxReplicas }} - metrics: - {{- if .Values.autoscaling.ztf.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.ztf.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.ztf.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.ztf.targetMemoryUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.ztf.targetConsumedMessages}} - - type: Object - object: - metric: - name: consumed_messages_sum - describedObject: - apiVersion: apps/v1 - kind: Deployment - name: '{{ include "sorting-hat.fullname" . }}-ztf' - target: - type: AverageValue - averageValue: {{ .Values.autoscaling.ztf.targetConsumedMessages }} - {{- end}} -{{- end }} ---- -{{- if .Values.autoscaling.atlas.enabled }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - namespace: {{ .Values.namespace }} - labels: - {{- include "sorting-hat.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: '{{ include "sorting-hat.fullname" . }}-atlas' - minReplicas: {{ .Values.autoscaling.atlas.minReplicas }} - maxReplicas: {{ .Values.autoscaling.atlas.maxReplicas }} - metrics: - {{- if .Values.autoscaling.atlas.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.atlas.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.atlas.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.atlas.targetMemoryUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.atlas.targetConsumedMessages}} - - type: Object - object: - metric: - name: consumed_messages_sum - describedObject: - apiVersion: apps/v1 - kind: Deployment - name: '{{ include "sorting-hat.fullname" . }}-atlas' - target: - type: AverageValue - averageValue: {{ .Values.autoscaling.atlas.targetConsumedMessages }} - {{- end}} -{{- end }} \ No newline at end of file diff --git a/charts/sorting-hat-msk/templates/namespace.yaml b/charts/sorting-hat-msk/templates/namespace.yaml deleted file mode 100644 index 4df0747..0000000 --- a/charts/sorting-hat-msk/templates/namespace.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.namespace }} - labels: - name: {{ .Values.namespace }} \ No newline at end of file diff --git a/charts/sorting-hat-msk/templates/secret.yaml b/charts/sorting-hat-msk/templates/secret.yaml deleted file mode 100644 index e518ac1..0000000 --- a/charts/sorting-hat-msk/templates/secret.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -apiVersion: v1 -kind: Secret -metadata: - name: image-pull-access - namespace: {{ .Values.namespace }} -type: kubernetes.io/dockerconfigjson -data: - .dockerconfigjson: {{ template "imagePullSecret" . }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: kafka-auth - namespace: {{ .Values.namespace }} -stringData: - username: "{{ .Values.secrets.kafkaAuth.username }}" - password: "{{ .Values.secrets.kafkaAuth.password }}" \ No newline at end of file diff --git a/charts/sorting-hat-msk/templates/service.yaml b/charts/sorting-hat-msk/templates/service.yaml deleted file mode 100644 index 242afb4..0000000 --- a/charts/sorting-hat-msk/templates/service.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: '{{ include "sorting-hat.fullname" . }}-ztf' - namespace: {{ .Values.namespace }} - labels: - {{- include "sorting-hat.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "sorting-hat.selectorLabels" . | nindent 4 }} ---- ---- -apiVersion: v1 -kind: Service -metadata: - name: '{{ include "sorting-hat.fullname" . }}-atlas' - namespace: {{ .Values.namespace }} - labels: - {{- include "sorting-hat.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "sorting-hat.selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/sorting-hat-msk/values.yaml b/charts/sorting-hat-msk/values.yaml deleted file mode 100644 index f09aba7..0000000 --- a/charts/sorting-hat-msk/values.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# Default values for step_starter. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -namespace: sorting-hat-msk - -image: - repository: ghcr.io/alercebroker/sorting_hat_step - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: - - name: "image-pull-access" - -nameOverride: "" -fullnameOverride: "" - -podAnnotations: {} - -service: - type: ClusterIP - port: 8000 - -resources: {} - -autoscaling: - ztf: - enabled: false - minReplicas: 1 - maxReplicas: 100 - # targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - atlas: - enabled: false - minReplicas: 1 - maxReplicas: 100 - # targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: eks.amazonaws.com/nodegroup - operator: In - ## Override this value with the NodeGroup tag accordingly - values: [] - -configmap: - consumerTopics: - ztf: "" - atlas: "" - consumerGroupId: - ztf: "" - atlas: "" - internalServer: "" - producerTopic: - ztf: "" - atlas: "" - metricsTopic: "" - mongoSecretName: "" - -secrets: - kafkaAuth: - enabled: false - username: "" - password: "" - -imageCredentials: - registry: "" - username: "" - password: "" - email: "" \ No newline at end of file diff --git a/charts/sorting-hat/Chart.yaml b/charts/sorting-hat/Chart.yaml index 2305827..552ab80 100644 --- a/charts/sorting-hat/Chart.yaml +++ b/charts/sorting-hat/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 appVersion: "1.1.0" -description: A Helm chart for Kubernetes +description: Sorting Hat deployment chart name: sorting-hat type: application -version: 0.3.0 +version: 0.4.0 diff --git a/charts/sorting-hat/templates/configmap.yaml b/charts/sorting-hat/templates/configmap.yaml index 46b7b99..4c78f19 100644 --- a/charts/sorting-hat/templates/configmap.yaml +++ b/charts/sorting-hat/templates/configmap.yaml @@ -7,8 +7,10 @@ metadata: data: consumer-topics: {{ .Values.configmap.consumerTopics.atlas }} consumer-group-id: {{ .Values.configmap.consumerGroupId.atlas | default (printf "%s-atlas" (include "sorting-hat.fullname" .)) }} - internal-server: {{ .Values.configmap.internalServer }} + consumer-server: {{ .Values.configmap.consumerServer }} + producer-server: {{ .Values.configmap.producerServer }} producer-topic: {{ .Values.configmap.producerTopic.atlas }} + metrics-server: {{ .Values.configmap.metricsServer }} metrics-topic: {{ .Values.configmap.metricsTopic }} mongo-secret-name: {{ .Values.configmap.mongoSecretName }} --- @@ -19,8 +21,10 @@ metadata: namespace: {{ .Values.namespace }} data: consumer-topics: {{ .Values.configmap.consumerTopics.ztf }} - consumer-group-id: {{ .Values.configmap.consumerGroupId.ztf | default (printf "%s-atlas" (include "sorting-hat.fullname" .)) }} - internal-server: {{ .Values.configmap.internalServer }} + consumer-group-id: {{ .Values.configmap.consumerGroupId.ztf | default (printf "%s-ztf" (include "sorting-hat.fullname" .)) }} + consumer-server: {{ .Values.configmap.consumerServer }} + producer-server: {{ .Values.configmap.producerServer }} producer-topic: {{ .Values.configmap.producerTopic.ztf }} + metrics-server: {{ .Values.configmap.metricsServer }} metrics-topic: {{ .Values.configmap.metricsTopic }} mongo-secret-name: {{ .Values.configmap.mongoSecretName }} \ No newline at end of file diff --git a/charts/sorting-hat/templates/deployment_atlas.yaml b/charts/sorting-hat/templates/deployment_atlas.yaml index 3129330..df5f7b4 100644 --- a/charts/sorting-hat/templates/deployment_atlas.yaml +++ b/charts/sorting-hat/templates/deployment_atlas.yaml @@ -47,7 +47,7 @@ spec: valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: internal-server + key: consumer-server - name: CONSUMER_GROUP_ID valueFrom: configMapKeyRef: @@ -57,7 +57,7 @@ spec: valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: internal-server + key: producer-server - name: PRODUCER_TOPIC valueFrom: configMapKeyRef: @@ -72,23 +72,47 @@ spec: valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-atlas' - key: internal-server + key: metrics-server - name: METRICS_TOPIC valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-atlas' 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.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: diff --git a/charts/sorting-hat/templates/deployment_ztf.yaml b/charts/sorting-hat/templates/deployment_ztf.yaml index 3a412bd..e1aa1a5 100644 --- a/charts/sorting-hat/templates/deployment_ztf.yaml +++ b/charts/sorting-hat/templates/deployment_ztf.yaml @@ -47,7 +47,7 @@ spec: valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: internal-server + key: consumer-server - name: CONSUMER_GROUP_ID valueFrom: configMapKeyRef: @@ -57,7 +57,7 @@ spec: valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: internal-server + key: producer-server - name: PRODUCER_TOPIC valueFrom: configMapKeyRef: @@ -72,23 +72,47 @@ spec: valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-ztf' - key: internal-server + key: metrics-server - name: METRICS_TOPIC valueFrom: configMapKeyRef: name: '{{ include "sorting-hat.fullname" . }}-ztf' 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: kafka-username - - name: KAFKA_PASSWORD + key: consumer-username + - name: CONSUMER_KAFKA_PASSWORD valueFrom: secretKeyRef: name: kafka-auth - key: kafka-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.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: diff --git a/charts/sorting-hat/templates/secret.yaml b/charts/sorting-hat/templates/secret.yaml index e518ac1..cc95153 100644 --- a/charts/sorting-hat/templates/secret.yaml +++ b/charts/sorting-hat/templates/secret.yaml @@ -14,5 +14,9 @@ metadata: name: kafka-auth namespace: {{ .Values.namespace }} stringData: - username: "{{ .Values.secrets.kafkaAuth.username }}" - password: "{{ .Values.secrets.kafkaAuth.password }}" \ No newline at end of file + 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 }}" + metrics-username: "{{ .Values.secrets.kafkaAuth.metrics.username }}" + metrics-password: "{{ .Values.secrets.kafkaAuth.metrics.password }}" \ No newline at end of file diff --git a/charts/sorting-hat/values.yaml b/charts/sorting-hat/values.yaml index d0e1dd6..409c0dd 100644 --- a/charts/sorting-hat/values.yaml +++ b/charts/sorting-hat/values.yaml @@ -57,11 +57,13 @@ configmap: consumerGroupId: ztf: "" atlas: "" - internalServer: "" + consumerServer: "" + producerServer: "" producerTopic: ztf: "" atlas: "" metricsTopic: "" + metricsServer: "" mongoSecretName: "" secrets: