diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index a4014005..4b7b2b25 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -47,5 +47,43 @@ jobs: - uses: ./.github/actions/prepare-k8s - - name: Run chart-testing (install) + - name: Run cassandra-chart-testing (install) run: ct install --config ct.yaml + test-with-allInOne: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: ./.github/actions/prepare-k8s + + - name: Run allInOne-chart-testing (install) + run: | + ct install --config ct.yaml --helm-extra-set-args " + --set provisionDataStore.cassandra=false + --set storage.type=memory + --set allInOne.enabled=true + --set agent.enabled=false + --set collector.enabled=false + --set query.enabled=false" + test-with-elasticsearch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: ./.github/actions/prepare-k8s + + - name: Run elasticsearch-chart-testing (install) + run: | + ct install --config ct.yaml --helm-extra-set-args " + --set provisionDataStore.cassandra=false + --set provisionDataStore.elasticsearch=true + --set storage.type=elasticsearch + --set elasticsearch.master.masterOnly=false + --set elasticsearch.master.replicaCount=1 + --set elasticsearch.data.replicaCount=0 + --set elasticsearch.coordinating.replicaCount=0 + --set elasticsearch.ingest.replicaCount=0" \ No newline at end of file diff --git a/charts/jaeger/Chart.yaml b/charts/jaeger/Chart.yaml index 7b103ab6..be86e1c2 100644 --- a/charts/jaeger/Chart.yaml +++ b/charts/jaeger/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 1.53.0 description: A Jaeger Helm chart for Kubernetes name: jaeger type: application -version: 3.3.1 +version: 3.3.2 # CronJobs require v1.21 kubeVersion: ">= 1.21-0" keywords: diff --git a/charts/jaeger/templates/_helpers.tpl b/charts/jaeger/templates/_helpers.tpl index f4db73be..f6f6b13f 100644 --- a/charts/jaeger/templates/_helpers.tpl +++ b/charts/jaeger/templates/_helpers.tpl @@ -268,7 +268,11 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this */}} {{- define "elasticsearch.client.url" -}} {{- $port := .Values.storage.elasticsearch.port | toString -}} -{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme .Values.storage.elasticsearch.host $port }} +{{- $host := .Values.storage.elasticsearch.host }} +{{- if .Values.provisionDataStore.elasticsearch }} +{{- $host = printf "%s-elasticsearch" .Release.Name }} +{{- end }} +{{- printf "%s://%s:%s" .Values.storage.elasticsearch.scheme $host $port }} {{- end -}} {{- define "jaeger.hotrod.tracing.host" -}} diff --git a/charts/jaeger/templates/collector-deploy.yaml b/charts/jaeger/templates/collector-deploy.yaml index dfdd1dc7..86e15ed8 100644 --- a/charts/jaeger/templates/collector-deploy.yaml +++ b/charts/jaeger/templates/collector-deploy.yaml @@ -32,6 +32,20 @@ spec: {{- toYaml .Values.collector.podLabels | nindent 8 }} {{- end }} spec: + {{- if .Values.provisionDataStore.elasticsearch }} + initContainers: + - name: elasticsearch-checker + image: curlimages/curl + command: + - sh + - "-c" + - | + url="{{ include "elasticsearch.client.url" . }}" + until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do + echo "Waiting for Elasticsearch at $url" + sleep 5 + done + {{- end}} {{- with .Values.collector.priorityClassName }} priorityClassName: {{ . }} {{- end }} diff --git a/charts/jaeger/templates/query-deploy.yaml b/charts/jaeger/templates/query-deploy.yaml index da8f1aa1..dc6ece41 100644 --- a/charts/jaeger/templates/query-deploy.yaml +++ b/charts/jaeger/templates/query-deploy.yaml @@ -44,10 +44,25 @@ spec: {{- toYaml .Values.query.podSecurityContext | nindent 8 }} serviceAccountName: {{ template "jaeger.query.serviceAccountName" . }} {{- include "query.imagePullSecrets" . | nindent 6 }} - {{- if .Values.query.initContainers }} + {{- if or .Values.query.initContainers .Values.provisionDataStore.elasticsearch }} initContainers: - {{- toYaml .Values.query.initContainers | nindent 8 }} - {{- end}} + {{- if .Values.query.initContainers }} + {{- toYaml .Values.query.initContainers | nindent 8 }} + {{- end }} + {{- if .Values.provisionDataStore.elasticsearch }} + - name: elasticsearch-checker + image: curlimages/curl + command: + - sh + - "-c" + - | + url="{{ include "elasticsearch.client.url" . }}" + until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do + echo "waiting for Elasticsearch at $url" + sleep 5 + done + {{- end }} + {{- end }} containers: - name: {{ template "jaeger.query.name" . }} securityContext: