Skip to content

Commit

Permalink
Merge pull request confluentinc#163 from nysthee/bug/ksql-server-sche…
Browse files Browse the repository at this point in the history
…ma-registry

Add env variable to cp-ksql-server deployment for cp-schema-registry.url
  • Loading branch information
qshao-pivotal authored Nov 14, 2018
2 parents 2b9ae93 + f929586 commit 1a95074
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions charts/cp-ksql-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,20 @@ Default Server Pool Id to Release Name but allow it to be overridden
{{- .Release.Name -}}
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified schema registry name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cp-ksql-server.cp-schema-registry.fullname" -}}
{{- $name := default "cp-schema-registry" (index .Values "cp-schema-registry" "nameOverride") -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "cp-ksql-server.cp-schema-registry.service-name" -}}
{{- if (index .Values "cp-schema-registry" "url") -}}
{{- printf "%s" (index .Values "cp-schema-registry" "url") -}}
{{- else -}}
{{- printf "http://%s:8081" (include "cp-ksql-server.cp-schema-registry.fullname" .) -}}
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/cp-ksql-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ spec:
value: {{ template "cp-ksql-server.kafka.bootstrapServers" . }}
- name: KSQL_KSQL_SERVICE_ID
value: {{ template "cp-ksql-server.serviceId" . }}
- name: KSQL_KSQL_SCHEMA_REGISTRY_URL
value: {{ template "cp-ksql-server.cp-schema-registry.service-name" . }}
{{- if .Values.ksql.headless }}
- name: KSQL_KSQL_QUERIES_FILE
value: /etc/ksql/queries/queries.sql
Expand Down

0 comments on commit 1a95074

Please sign in to comment.