Skip to content

Commit 757bb92

Browse files
authored
Add Helm chart (hypertrace#27)
* Add helm chart Signed-off-by: Pavol Loffay <[email protected]> * publish helm chart Signed-off-by: Pavol Loffay <[email protected]>
1 parent 2cfc099 commit 757bb92

File tree

7 files changed

+352
-15
lines changed

7 files changed

+352
-15
lines changed

.github/workflows/release.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ jobs:
3636
VERSION=${{ env.VERSION }}
3737
GIT_COMMIT=${GITHUB_SHA}
3838
39-
# publish-helm-charts:
40-
# needs: publish-artifacts
41-
# runs-on: ubuntu-20.04
42-
# steps:
43-
# # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
44-
# - name: Checkout Repository
45-
# uses: actions/[email protected]
46-
# with:
47-
# fetch-depth: 0
48-
#
49-
# - name: package and release charts
50-
# uses: hypertrace/github-actions/helm-gcs-publish@main
51-
# with:
52-
# helm-gcs-credentials: ${{ secrets.HELM_GCS_CREDENTIALS }}
53-
# helm-gcs-repository: ${{ secrets.HELM_GCS_REPOSITORY }}
39+
publish-helm-charts:
40+
needs: publish-artifacts
41+
runs-on: ubuntu-20.04
42+
steps:
43+
# Set fetch-depth: 0 to fetch commit history and tags for use in version calculation
44+
- name: Checkout Repository
45+
uses: actions/[email protected]
46+
with:
47+
fetch-depth: 0
48+
49+
- name: package and release charts
50+
uses: hypertrace/github-actions/helm-gcs-publish@main
51+
with:
52+
helm-gcs-credentials: ${{ secrets.HELM_GCS_CREDENTIALS }}
53+
helm-gcs-repository: ${{ secrets.HELM_GCS_REPOSITORY }}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
collector
2+
3+
helm/charts
4+
helm/Chart.lock

helm/Chart.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This Chart.yaml file will act as the template for the "helm package" command. The helm package will set the chart
2+
# version and appVersion.
3+
# Command to package:
4+
# helm package --version <chart version> --app-version <app version> <folder containing Chart.yaml>
5+
apiVersion: v2
6+
name: hypertrace-collector
7+
description: Hypertrace Collector Helm Chart for Platform Trace Collector
8+
9+
# A chart can be either an 'application' or a 'library' chart.
10+
#
11+
# Application charts are a collection of templates that can be packaged into versioned archives
12+
# to be deployed.
13+
#
14+
# Library charts provide useful utilities or functions for the chart developer. They're included as
15+
# a dependency of application charts to inject those utilities and functions into the rendering
16+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
17+
type: application
18+
19+
# This is the chart version. This version number should be incremented each time you make changes
20+
# to the chart and its templates, including the app version. The "helm package" command will take care of setting this.
21+
# A new chart will be created for each new version of the service.
22+
version: 0.1.0
23+
24+
# This is the appVersion which will correspond to build version tag. The "helm package" command will take care of setting
25+
# this.
26+
appVersion: 0.1.0
27+
28+
dependencies:
29+
- name: kafka-topic-creator
30+
repository: "https://storage.googleapis.com/hypertrace-helm-charts"
31+
version: 0.1.5

helm/templates/config-map.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ .Values.configMap.name }}
5+
labels:
6+
app: hypertrace-collector
7+
release: {{ .Release.Name }}
8+
data:
9+
hypertrace-collector-config: |-
10+
{{- toYaml .Values.configMap.data | nindent 4 }}
11+

helm/templates/deployment.yaml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Chart.Name }}
5+
annotations:
6+
# This annotation distinguishes this deployment from those done with skaffold in order to remove those ones before
7+
# deploying this one.
8+
deployment.traceable.ai/tool: helm3
9+
labels:
10+
release: {{ .Release.Name }}
11+
{{- with .Values.deploymentLabels }}
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
minReadySeconds: {{ .Values.minReadySeconds }}
16+
progressDeadlineSeconds: {{ .Values.progressDeadlineSeconds }}
17+
replicas: {{ .Values.replicaCount }}
18+
strategy:
19+
type: RollingUpdate
20+
rollingUpdate:
21+
maxUnavailable: {{ .Values.maxUnavailable }}
22+
selector:
23+
matchLabels:
24+
{{- toYaml .Values.deploymentSelectorMatchLabels | nindent 6 }}
25+
template:
26+
metadata:
27+
annotations:
28+
checksum/config: {{ include (print $.Template.BasePath "/config-map.yaml") . | sha256sum }}
29+
prometheus.io/path: "/metrics"
30+
prometheus.io/port: "8888"
31+
prometheus.io/scrape: "true"
32+
{{- with .Values.podAnnotations }}
33+
{{- toYaml . | nindent 8 }}
34+
{{- end }}
35+
labels:
36+
release: {{ .Release.Name }}
37+
{{- with .Values.podLabels }}
38+
{{- toYaml . | nindent 8 }}
39+
{{- end }}
40+
spec:
41+
{{- with .Values.imagePullSecrets }}
42+
imagePullSecrets:
43+
{{- toYaml . | nindent 8 }}
44+
{{- end }}
45+
{{- with .Values.volumes }}
46+
volumes:
47+
{{- toYaml . | nindent 8 }}
48+
{{- end }}
49+
{{- with .Values.nodeSelector }}
50+
nodeSelector:
51+
{{- toYaml . | nindent 8 }}
52+
{{- end }}
53+
containers:
54+
- name: {{ .Chart.Name }}
55+
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
56+
imagePullPolicy: {{ .Values.image.pullPolicy }}
57+
command:
58+
- "/usr/local/bin/hypertrace/collector"
59+
- "--config=/conf/hypertrace-collector-config.yaml"
60+
- "--log-level={{ .Values.logLevel }}"
61+
ports:
62+
{{ range $port := .Values.containerPorts }}
63+
- name: {{ $port.name }}
64+
containerPort: {{ $port.containerPort }}
65+
{{ end }}
66+
{{- with .Values.env }}
67+
env:
68+
{{- toYaml . | nindent 12}}
69+
{{- end }}
70+
{{- with .Values.volumeMounts }}
71+
volumeMounts:
72+
{{- toYaml . | nindent 12}}
73+
{{- end }}
74+
livenessProbe:
75+
initialDelaySeconds: {{ int .Values.livenessProbe.initialDelaySeconds }}
76+
periodSeconds: {{ int .Values.livenessProbe.periodSeconds }}
77+
httpGet:
78+
path: /
79+
port: 13133
80+
readinessProbe:
81+
initialDelaySeconds: {{ int .Values.readinessProbe.initialDelaySeconds }}
82+
periodSeconds: {{ int .Values.readinessProbe.periodSeconds }}
83+
httpGet:
84+
path: /
85+
port: 13133
86+
resources:
87+
{{- toYaml .Values.resources | nindent 12 }}

helm/templates/service.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Chart.Name }}
5+
labels:
6+
app: hypertrace-collector
7+
release: {{ .Release.Name }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
ports:
11+
{{ range $port := .Values.service.ports }}
12+
- name: {{ $port.name }}
13+
port: {{ $port.port }}
14+
targetPort: {{ $port.targetPort }}
15+
protocol: {{ $port.protocol }}
16+
{{ end }}
17+
selector:
18+
{{- toYaml .Values.serviceSelectorLabels | nindent 4 }}

helm/values.yaml

+187
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# Default values for the helm chart.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
###########
6+
# Deployment and Service
7+
###########
8+
logLevel: INFO
9+
10+
minReadySeconds: 5
11+
progressDeadlineSeconds: 120
12+
replicaCount: 1
13+
maxUnavailable: 0
14+
15+
image:
16+
repository: hypertrace/hypertrace-collector
17+
pullPolicy: IfNotPresent
18+
19+
env:
20+
- name: GOGC
21+
value: "80"
22+
23+
containerPorts:
24+
- name: grpc-otlp
25+
containerPort: 4317
26+
- name: http-otlp
27+
containerPort: 55681
28+
- name: grpc-opencensus
29+
containerPort: 55678
30+
- name: http-jaeger
31+
containerPort: 14268
32+
- name: grpc-jaeger
33+
containerPort: 14250
34+
- name: http-zipkin
35+
containerPort: 9411
36+
37+
service:
38+
type: ClusterIP
39+
ports:
40+
- name: grpc-otlp
41+
port: 4317
42+
targetPort: 4317
43+
protocol: TCP
44+
- name: http-otlp
45+
port: 55681
46+
targetPort: 55681
47+
protocol: TCP
48+
- name: grpc-opencensus
49+
port: 55678
50+
targetPort: 55678
51+
protocol: TCP
52+
- name: http-jaeger
53+
port: 14268
54+
targetPort: 14268
55+
protocol: TCP
56+
- name: grpc-jaeger
57+
port: 14250
58+
targetPort: 14268
59+
protocol: TCP
60+
- name: http-zipkin
61+
port: 9411
62+
targetPort: 9411
63+
protocol: TCP
64+
65+
livenessProbe:
66+
initialDelaySeconds: 5
67+
periodSeconds: 10
68+
69+
readinessProbe:
70+
initialDelaySeconds: 5
71+
periodSeconds: 5
72+
73+
resources:
74+
# We usually recommend not to specify default resources and to leave this as a conscious
75+
# choice for the user. This also increases chances charts run on environments with little
76+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
77+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
78+
limits:
79+
cpu: 1
80+
memory: 2Gi
81+
requests:
82+
cpu: 200m
83+
memory: 400Mi
84+
85+
deploymentLabels:
86+
app: hypertrace-collector
87+
88+
podLabels:
89+
app: hypertrace-collector
90+
91+
podAnnotations: {}
92+
93+
# The Deployment Selector match labels are different from the pod labels. Note that they should be a subset of the pod
94+
# labels. You append new labels to them but cannot remove labels. If you remove or modify the labels you will need to
95+
# delete the existing deployment bearing the same name and then redeploy. This is the reason why they are separated from
96+
# the pod labels. You can add and remove pod labels without having an effect on the deployment.
97+
# Also, please use "apiVersion: apps/v1" instead of the deprecated "apiVersion: extensions/v1beta1" for the deployment
98+
# apiVersion in the yaml file.
99+
deploymentSelectorMatchLabels:
100+
app: hypertrace-collector
101+
102+
serviceSelectorLabels:
103+
app: hypertrace-collector
104+
105+
# Volumes and Volume mounts
106+
volumeMounts:
107+
- name: hypertrace-collector-config-vol
108+
mountPath: /conf
109+
110+
volumes:
111+
- configMap:
112+
name: hypertrace-collector-config
113+
items:
114+
- key: hypertrace-collector-config
115+
path: hypertrace-collector-config.yaml
116+
name: hypertrace-collector-config-vol
117+
118+
nodeSelector: {}
119+
120+
###########
121+
# Config Maps
122+
###########
123+
configMap:
124+
name: hypertrace-collector-config
125+
data:
126+
extensions:
127+
health_check:
128+
pprof:
129+
endpoint: 0.0.0.0:1777
130+
zpages:
131+
endpoint: 0.0.0.0:55679
132+
133+
receivers:
134+
otlp:
135+
protocols:
136+
grpc:
137+
http:
138+
opencensus:
139+
zipkin:
140+
jaeger:
141+
protocols:
142+
grpc:
143+
thrift_http:
144+
# Collect own metrics
145+
prometheus:
146+
config:
147+
scrape_configs:
148+
- job_name: "otel-collector"
149+
scrape_interval: 10s
150+
static_configs:
151+
- targets: ["0.0.0.0:8888"]
152+
153+
processors:
154+
batch:
155+
156+
exporters:
157+
kafka:
158+
protocol_version: 2.0.0
159+
brokers:
160+
- bootstrap:9092
161+
topic: jaeger-spans
162+
encoding: jaeger_proto
163+
164+
service:
165+
extensions: [health_check, pprof, zpages]
166+
pipelines:
167+
traces:
168+
receivers: [otlp, opencensus, jaeger, zipkin]
169+
processors: [batch]
170+
exporters: [kafka]
171+
172+
kafka-topic-creator:
173+
jobName: jaeger-spans-kafka-topic-creator
174+
helmHook: pre-install,pre-upgrade
175+
kafka:
176+
topics:
177+
- name: jaeger-spans
178+
replicationFactor: 1
179+
partitions: 8
180+
configs:
181+
- retention.bytes=4294967296
182+
- retention.ms=259200000
183+
zookeeper:
184+
address: zookeeper:2181
185+
imagePullSecrets: []
186+
podAnnotations:
187+
sidecar.istio.io/inject: "false"

0 commit comments

Comments
 (0)