diff --git a/charts/operator-wandb/Chart.yaml b/charts/operator-wandb/Chart.yaml index d625bc32..3f77e019 100644 --- a/charts/operator-wandb/Chart.yaml +++ b/charts/operator-wandb/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: operator-wandb description: A Helm chart for deploying W&B to Kubernetes type: application -version: 0.11.0 +version: 0.11.1 appVersion: 1.0.0 icon: https://wandb.ai/logo.svg diff --git a/charts/operator-wandb/charts/app/templates/service.yaml b/charts/operator-wandb/charts/app/templates/service.yaml index 9ffa7b0b..f3e6cd42 100644 --- a/charts/operator-wandb/charts/app/templates/service.yaml +++ b/charts/operator-wandb/charts/app/templates/service.yaml @@ -10,6 +10,9 @@ metadata: {{- toYaml .Values.service.labels | nindent 4 }} {{- end }} annotations: + prometheus.io/scrape: 'true' + prometheus.io/path: '/metrics' + prometheus.io/port: '8181' {{- if .Values.service.annotations -}} {{- toYaml .Values.service.annotations | nindent 4 }} {{- end }} diff --git a/charts/operator-wandb/templates/_kafka.tpl b/charts/operator-wandb/templates/_kafka.tpl new file mode 100644 index 00000000..c53a4072 --- /dev/null +++ b/charts/operator-wandb/templates/_kafka.tpl @@ -0,0 +1,54 @@ +{{/* +These are the variables a service can expect + - name: KAFKA_BROKER_URL + value: "{{ include "wandb.kafka.brokerUrl" . }}" + - name: KAFKA_BROKER_PORT + value: "{{ include "wandb.kafka.brokerPort" . }}" + - name: KAFKA_CLIENT_USER + value: "{{ include "wandb.kafka.user" . }}" + - name: KAFKA_CLIENT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "wandb.kafka.passwordSecret" . }} + key: KAFKA_CLIENT_PASSWORD +*/}} + +{{/* +Return the kafka client user +*/}} +{{- define "wandb.kafka.user" -}} +{{ .Values.global.kafka.user }} +{{- end -}} + +{{/* +Return the kafka client password +*/}} +{{- define "wandb.kafka.password" -}} +{{ .Values.global.kafka.password }} +{{- end -}} + + +{{/* +Return name of secret where kafka information is stored +*/}} +{{- define "wandb.kafka.passwordSecret" -}} +{{- print .Release.Name "-kafka" -}} +{{- end -}} + +{{/* +Return the kafka broker url port +*/}} +{{- define "wandb.kafka.brokerUrl" -}} +{{- if eq .Values.global.redis.host "" -}} +{{ printf "%s-%s" .Release.Name "kafka" }} +{{- else -}} +{{ .Values.global.kafka.brokerUrl }} +{{- end -}} +{{- end -}} + +{{/* +Return kafka broker url port +*/}} +{{- define "wandb.kafka.brokerPort" -}} +{{- print .Values.global.kafka.brokerPort -}} +{{- end -}} \ No newline at end of file diff --git a/charts/operator-wandb/templates/kafka.yaml b/charts/operator-wandb/templates/kafka.yaml new file mode 100644 index 00000000..5c9198e5 --- /dev/null +++ b/charts/operator-wandb/templates/kafka.yaml @@ -0,0 +1,9 @@ +{{- $secretName := (include "wandb.kafka.passwordSecret" .) }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretName }} + labels: + {{- include "wandb.commonLabels" . | nindent 4 }} +data: + KAFKA_CLIENT_PASSWORD: {{ include "wandb.kafka.password" . | b64enc }} \ No newline at end of file diff --git a/charts/operator-wandb/values.yaml b/charts/operator-wandb/values.yaml index 68eecd52..9a7e3925 100644 --- a/charts/operator-wandb/values.yaml +++ b/charts/operator-wandb/values.yaml @@ -75,12 +75,12 @@ global: caCert: "" kafka: - # The following values are anchored here, and referenced by alias later for the kafka dependency chart. - user: &kafkaUser "user1" + # The following values are anchored here, and referenced by alias later for + # the kafka dependency chart. + user: &kafkaUser "wandb" password: &kafkaPassword "wandb" - consumerUrl: "wandb-kafka" - consumerPort: 9092 - producerUrl: "wandb-kafka-controller-headless-0:9092,wandb-kafka-controller-headless-1:9092,wandb-kafka-controller-headless-2:9092" + brokerUrl: "" + brokerPort: 9092 ingress: nameOverride: "" @@ -191,11 +191,11 @@ kafka: controller: password: "controller-pw" # The client usernames and passwords are alias references from the global values section at the beginning of this file. - # Please update the values there to ensure proper propogation to the application + # Please update the values there to ensure proper propagation to the application client: users: - *kafkaUser passwords: *kafkaPassword kraft: # This field is a UUID. It is *strongly* recommended to supply a new UUID yourself for production installs. - clusterId: "2cee15fc-949d-473c-814e-2bdfa41d4091" + clusterId: "ffFF1H3AQKGdBnsqAbJKew"