From a385adf140a9d8b57485fdfaa3f1c652fe19e941 Mon Sep 17 00:00:00 2001 From: Oleh Ozimok Date: Sat, 6 Jan 2018 14:14:11 +0100 Subject: [PATCH] fix query service for ingress and add some query start flags (#2867) --- incubator/jaeger/Chart.yaml | 2 +- incubator/jaeger/README.md | 2 +- incubator/jaeger/templates/_helpers.tpl | 12 ++++++++++++ incubator/jaeger/templates/ingress.yaml | 4 ++-- incubator/jaeger/templates/query-deploy.yaml | 8 +++++--- incubator/jaeger/templates/query-svc.yaml | 2 +- incubator/jaeger/values.yaml | 7 ++++--- 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/incubator/jaeger/Chart.yaml b/incubator/jaeger/Chart.yaml index 4e0c75a768..752ecc8095 100644 --- a/incubator/jaeger/Chart.yaml +++ b/incubator/jaeger/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 0.8.0 description: A Jaeger Helm chart for Kubernetes name: jaeger -version: 0.2.2 +version: 0.2.3 keywords: - jaeger - opentracing diff --git a/incubator/jaeger/README.md b/incubator/jaeger/README.md index 93ebb5e721..f4696124ed 100644 --- a/incubator/jaeger/README.md +++ b/incubator/jaeger/README.md @@ -68,7 +68,7 @@ data: To install the chart with the release name `myrel`, run the following command: ```bash -$ helm install --name myrel +$ helm install incubator/jaeger --name myrel ``` After a few minutes, you should see a 3 node Cassandra instance, a Jaeger DaemonSet, a Jaeger Collector, and a Jaeger Query (UI) pod deployed into your Kubernetes cluster. diff --git a/incubator/jaeger/templates/_helpers.tpl b/incubator/jaeger/templates/_helpers.tpl index 7f3e242b18..6f7a5eed02 100644 --- a/incubator/jaeger/templates/_helpers.tpl +++ b/incubator/jaeger/templates/_helpers.tpl @@ -19,6 +19,18 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- end -}} {{- end -}} +Create a fully qualified query name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "jaeger.query.fullname" -}} +{{- $name := default "jaeger-query" .Values.queryNameOverride -}} +{{- if ne .Chart.Name .Release.Name -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s" $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- 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). diff --git a/incubator/jaeger/templates/ingress.yaml b/incubator/jaeger/templates/ingress.yaml index c82ccfc4d9..7da07c6ab5 100644 --- a/incubator/jaeger/templates/ingress.yaml +++ b/incubator/jaeger/templates/ingress.yaml @@ -1,5 +1,5 @@ {{- if .Values.ingress.enabled -}} -{{- $serviceName := printf "%s%s" (include "jaeger.fullname" .) "-query" -}} +{{- $serviceName := include "jaeger.query.fullname" . -}} {{- $servicePort := .Values.query.service.queryPort -}} apiVersion: extensions/v1beta1 kind: Ingress @@ -29,4 +29,4 @@ spec: tls: {{ toYaml .Values.ingress.tls | indent 4 }} {{- end -}} -{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/incubator/jaeger/templates/query-deploy.yaml b/incubator/jaeger/templates/query-deploy.yaml index e5d8163b43..5b71fb5bb0 100644 --- a/incubator/jaeger/templates/query-deploy.yaml +++ b/incubator/jaeger/templates/query-deploy.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: "{{ template "jaeger.fullname" . }}-query" + name: "{{ template "jaeger.query.fullname" . }}" labels: app: "{{ template "jaeger.name" . }}" jaeger-infra: query-deployment @@ -31,7 +31,7 @@ spec: nodeSelector: {{ toYaml .Values.query.nodeSelector | indent 8 }} containers: - - name: "{{ template "jaeger.fullname" . }}-query" + - name: "{{ template "jaeger.query.fullname" . }}" image: "{{ .Values.query.image }}:{{ .Values.query.tag }}" imagePullPolicy: {{ .Values.query.pullPolicy }} ports: @@ -57,12 +57,14 @@ spec: - "--cassandra.keyspace=jaeger_v1_{{ .Values.cassandra.config.dc_name }}" {{ end }} - "--query.static-files=/go/jaeger-ui/" + - "--query.port={{ .Values.query.service.targetPort }}" + - "--query.health-check-http-port={{ .Values.query.healthCheckPort }}" {{- range $key, $value := .Values.query.cmdlineParams }} - "{{ $value }}" {{- end }} readinessProbe: httpGet: path: "/" - port: {{ .Values.query.service.targetPort }} + port: {{ .Values.query.healthCheckPort }} dnsPolicy: {{ .Values.query.dnsPolicy }} restartPolicy: Always diff --git a/incubator/jaeger/templates/query-svc.yaml b/incubator/jaeger/templates/query-svc.yaml index eacc0e8f11..c217e91704 100644 --- a/incubator/jaeger/templates/query-svc.yaml +++ b/incubator/jaeger/templates/query-svc.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: "{{ template "jaeger.fullname" . }}-query" + name: "{{ template "jaeger.query.fullname" . }}" labels: app: "{{ template "jaeger.name" . }}" jaeger-infra: query-service diff --git a/incubator/jaeger/values.yaml b/incubator/jaeger/values.yaml index a734355c09..1d17d3dc40 100644 --- a/incubator/jaeger/values.yaml +++ b/incubator/jaeger/values.yaml @@ -97,11 +97,11 @@ collector: zipkinPort: 9411 resources: {} # limits: + # cpu: 1 + # memory: 1Gi + # requests: # cpu: 500m # memory: 512Mi - # requests: - # cpu: 1024m - # memory: 1024Mi nodeSelector: {} ## Additional pod labels ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -113,6 +113,7 @@ query: pullPolicy: IfNotPresent dnsPolicy: ClusterFirst cmdlineParams: {} + healthCheckPort: 16687 service: annotations: {} type: NodePort