Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showcase #10

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/es.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: es Charts

on: pull_request

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4

# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1
with:
version: v3.10.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi

- name: Run chart-testing (lint)
run: ct lint --config ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.9.0
if: steps.list-changed.outputs.changed == 'true'

- name: Install kubectl
uses: azure/setup-kubectl@v4.0.0
with:
version: 'v1.28.8'
id: install

- name: Set up cert-manager
run: |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml --namespace ingress-nginx
kubectl label node --all ingress-ready=true
kubectl describe pod --selector=app.kubernetes.io/component=controller -n ingress-nginx
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=5m
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml

- name: Set up cmctl
run: |
curl -sSL -o cmctl.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.6.1/cmctl-linux-amd64.tar.gz
tar xzf cmctl.tar.gz
sudo mv cmctl /usr/local/bin
cmctl version

- name: Check if cert-manager is up
run: |
cmctl check api --wait=5m

- name: Run 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 \
--set storage.elasticsearch.host=es-elasticsearch"
11 changes: 10 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [v1, v2] # Define the matrix with v1 and v2 versions

steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -69,4 +73,9 @@ jobs:
cmctl check api --wait=5m
- name: Run chart-testing (install)
run: ct install --config ct.yaml
run: |
if [ "${{ matrix.version }}" == "v1" ]; then
ct install --config ct.yaml
elif [ "${{ matrix.version }}" == "v2" ]; then
ct install --config ct.yaml --helm-extra-set-args "--set v2.enabled=true --set provisionDataStore.cassandra=false --set storage.type=memory --set allInOne.enabled=true --set agent.enabled=false --set collector.enabled=false --set query.enabled=false"
fi
2 changes: 1 addition & 1 deletion charts/jaeger/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
112 changes: 111 additions & 1 deletion charts/jaeger/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Expand Down Expand Up @@ -572,6 +576,20 @@ Create pull secrets for all in one image
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.allInOne.image) "context" $) -}}
{{- end }}

{{/*
Create image name for v2 image
*/}}
{{- define "v2.image" -}}
{{- include "renderImage" ( dict "imageRoot" .Values.v2.image "context" $ ) -}}
{{- end -}}

{{/*
Create pull secrets for all in one image
*/}}
{{- define "v2.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.v2.image) "context" $) -}}
{{- end }}

{{/*
Create image name for schema image
*/}}
Expand Down Expand Up @@ -719,3 +737,95 @@ Create pull secrets for hotrod image
{{- define "hotrod.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.hotrod.image) "context" $) -}}
{{- end }}



{{- define "jaeger-v2.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 "jaeger-v2.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 "jaeger-v2.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "jaeger-v2.labels" -}}
helm.sh/chart: {{ include "jaeger-v2.chart" . }}
{{ include "jaeger-v2.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "jaeger-v2.selectorLabels" -}}
app.kubernetes.io/name: {{ include "jaeger-v2.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "jaeger-v2.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "jaeger-v2.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "jaeger-v2.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{- define "jaeger-v2.extensionsConfig" -}}
{{ toYaml .Values.extensions | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.receiversConfig" -}}
{{ toYaml .Values.receivers | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.processorsConfig" -}}
{{ toYaml .Values.processors | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.exportersConfig" -}}
{{ toYaml .Values.exporters | nindent 6 }}
{{- end }}

{{- define "jaeger-v2.podLabels" -}}
{{- if .Values.podLabels }}
{{- tpl (.Values.podLabels | toYaml) . }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/jaeger/templates/allinone-configmap-v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.v2.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: jaeger-v2-configmap
namespace: {{ include "jaeger-v2.namespace" . }}
labels:
{{- include "jaeger-v2.labels" . | nindent 4 }}
data:
config.yaml: |
service:
extensions: [{{ join ", " .Values.service.extensions }}]
pipelines:
traces:
receivers: [{{ join ", " .Values.service.pipelines.traces.receivers }}]
processors: [{{ join ", " .Values.service.pipelines.traces.processors }}]
exporters: [{{ join ", " .Values.service.pipelines.traces.exporters }}]

extensions:
{{- include "jaeger-v2.extensionsConfig" . | nindent 6 }}
receivers:
{{- include "jaeger-v2.receiversConfig" . | nindent 6 }}
processors:
{{- include "jaeger-v2.processorsConfig" . | nindent 6 }}
exporters:
{{- include "jaeger-v2.exportersConfig" . | nindent 6 }}
{{- end }}
32 changes: 30 additions & 2 deletions charts/jaeger/templates/allinone-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,22 @@ spec:
{{- end }}
securityContext:
{{- toYaml .Values.allInOne.securityContext | nindent 12 }}
{{- if .Values.v2.enabled }}
image: {{ include "v2.image" . }}
{{- else }}
image: {{ include "allInOne.image" . }}
{{- end }}
imagePullPolicy: {{ .Values.allInOne.image.pullPolicy }}
name: jaeger
args:
{{- if .Values.v2.enabled }}
- "--config"
- "/etc/jaeger/config.yaml"
{{- else }}
{{- range $arg := .Values.allInOne.args }}
- "{{ tpl $arg $ }}"
{{- end }}
{{- end }}
ports:
- containerPort: 5775
protocol: UDP
Expand All @@ -83,19 +92,29 @@ spec:
livenessProbe:
failureThreshold: 5
httpGet:
scheme: HTTP
{{- if .Values.v2.enabled }}
path: /status
port: 13133
{{- else }}
path: /
port: 14269
scheme: HTTP
{{- end }}
initialDelaySeconds: 5
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
scheme: HTTP
{{- if .Values.v2.enabled }}
path: /status
port: 13133
{{- else }}
path: /
port: 14269
scheme: HTTP
{{- end }}
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
Expand All @@ -105,6 +124,10 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.v2.enabled }}
- name: jaeger-v2-config
mountPath: /etc/jaeger
{{- end }}
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
mountPath: {{ .Values.storage.badger.persistence.mountPath }}
Expand All @@ -123,6 +146,11 @@ spec:
{{- toYaml .Values.allInOne.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "jaeger.fullname" . }}
volumes:
{{- if .Values.v2.enabled }}
- name: jaeger-v2-config
configMap:
name: jaeger-v2-configmap
{{- end }}
{{- if not .Values.storage.badger.ephemeral }}
- name: badger-data
persistentVolumeClaim:
Expand Down
Loading
Loading