Skip to content
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
84 changes: 84 additions & 0 deletions charts/uptrace/templates/_uptrace-pod.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{{- define "uptrace.pod" -}}
{{- with .Values.uptrace.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
serviceAccountName: {{ include "uptrace.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 2 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 6 }}
image: "{{ .Values.uptrace.image.repository }}:{{ .Values.uptrace.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.uptrace.image.pullPolicy }}
args: ["serve"]
volumeMounts:
- name: config
mountPath: /etc/uptrace/config.yml
subPath: uptrace.yml
ports:
- name: http
containerPort: {{ .Values.uptrace.config.listen.http.addr | splitList ":" | last }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.uptrace.config.listen.grpc.addr | splitList ":" | last }}
protocol: TCP
{{ with (tpl .Values.uptrace.config.site.url $) | urlParse }}
livenessProbe:
httpGet:
path: {{ .path }}
port: http
scheme: {{ if $.Values.uptrace.config.listen.tls }}HTTPS{{ else }}HTTP{{ end }}
readinessProbe:
httpGet:
path: {{ .path }}
port: http
scheme: {{ if $.Values.uptrace.config.listen.tls }}HTTPS{{ else }}HTTP{{ end }}
{{ end }}
env:
{{- if .Values.postgresql.enabled }}
- name: PG_HOST
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: host
- name: PG_USER
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: username
- name: PG_PASSWORD
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: password
- name: PG_DATABASE
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: dbname
{{- end }}
{{- toYaml .Values.uptrace.env | nindent 6 }}
envFrom:
{{- toYaml .Values.uptrace.envFrom | nindent 6 }}
resources:
{{- toYaml .Values.uptrace.resources | nindent 6 }}
{{- with .Values.uptrace.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.uptrace.affinity }}
affinity:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.uptrace.tolerations }}
tolerations:
{{- toYaml . | nindent 2 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "uptrace.fullname" . }}

{{- end }}
27 changes: 27 additions & 0 deletions charts/uptrace/templates/uptrace-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if eq .Values.uptrace.mode "deployment" -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "uptrace.fullname" . }}
labels:
app: uptrace
{{- include "uptrace.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.uptrace.replicaCount }}
selector:
matchLabels:
app: uptrace
{{- include "uptrace.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ .Values.uptrace.config | toYaml | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: uptrace
{{- include "uptrace.selectorLabels" . | nindent 8 }}
spec:
{{- include "uptrace.pod" . | nindent 6 }}
{{- end }}
84 changes: 3 additions & 81 deletions charts/uptrace/templates/uptrace-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if eq .Values.uptrace.mode "statefulset" -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand All @@ -23,84 +24,5 @@ spec:
app: uptrace
{{- include "uptrace.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.uptrace.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "uptrace.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
image: "{{ .Values.uptrace.image.repository }}:{{ .Values.uptrace.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.uptrace.image.pullPolicy }}
args: ["serve"]
volumeMounts:
- name: config
mountPath: /etc/uptrace/config.yml
subPath: uptrace.yml
ports:
- name: http
containerPort: {{ .Values.uptrace.config.listen.http.addr | splitList ":" | last }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.uptrace.config.listen.grpc.addr | splitList ":" | last }}
protocol: TCP
{{ with (tpl .Values.uptrace.config.site.url $) | urlParse }}
livenessProbe:
httpGet:
path: {{ .path }}
port: http
scheme: {{ if $.Values.uptrace.config.listen.tls }}HTTPS{{ else }}HTTP{{ end }}
readinessProbe:
httpGet:
path: {{ .path }}
port: http
scheme: {{ if $.Values.uptrace.config.listen.tls }}HTTPS{{ else }}HTTP{{ end }}
{{ end }}
env:
{{- if .Values.postgresql.enabled }}
- name: PG_HOST
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: host
- name: PG_USER
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: username
- name: PG_PASSWORD
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: password
- name: PG_DATABASE
valueFrom:
secretKeyRef:
name: uptrace-postgresql-app
key: dbname
{{- end }}
{{- toYaml .Values.uptrace.env | nindent 12 }}
envFrom:
{{- toYaml .Values.uptrace.envFrom | nindent 12 }}
resources:
{{- toYaml .Values.uptrace.resources | nindent 12 }}
{{- with .Values.uptrace.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.uptrace.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.uptrace.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "uptrace.fullname" . }}
{{- include "uptrace.pod" . | nindent 6 }}
{{- end }}
1 change: 1 addition & 0 deletions charts/uptrace/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ ingress:
# - chart-example.local

uptrace:
mode: "statefulset" # statefulset or deployment
replicaCount: 1

migrate:
Expand Down