Skip to content

Commit f641741

Browse files
author
Андрей Лалаев
committed
initial commit
1 parent c26b3e4 commit f641741

File tree

9 files changed

+404
-3
lines changed

9 files changed

+404
-3
lines changed

.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

Chart.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: qryn-helm
3+
description: A Helm chart for Kubernetes
4+
# A chart can be either an 'application' or a 'library' chart.
5+
#
6+
# Application charts are a collection of templates that can be packaged into versioned archives
7+
# to be deployed.
8+
#
9+
# Library charts provide useful utilities or functions for the chart developer. They're included as
10+
# a dependency of application charts to inject those utilities and functions into the rendering
11+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
12+
type: application
13+
# This is the chart version. This version number should be incremented each time you make changes
14+
# to the chart and its templates, including the app version.
15+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16+
version: 0.1.0
17+
# This is the version number of the application being deployed. This version number should be
18+
# incremented each time you make changes to the application. Versions are not expected to
19+
# follow Semantic Versioning. They should reflect the version the application is using.
20+
# It is recommended to use it with quotes.
21+
appVersion: "3.0.20"

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
# Qryn Helm Chart
12
<a href="https://qryn.dev" target="_blank">
23
<img src='https://user-images.githubusercontent.com/1423657/218816262-e0e8d7ad-44d0-4a7d-9497-0d383ed78b83.png' style="margin-left:-10px" width=150/>
3-
</a>
44

5-
# qryn-helm
6-
> helm charts for qryn
5+
## Overview
6+
This Helm chart provides Kubernetes deployment configurations for [Qryn](https://github.com/metrico/qryn), a data visualization and exploration tool. [Qryn](https://github.com/metrico/qryn) is a polyglot, lighweight, multi-standard drop-in observability framework for Logs, Metrics and Traces
7+
8+
## Usage
9+
To deploy [Qryn](https://github.com/metrico/qryn) using this Helm chart, use the following command:
10+
11+
bash
12+
Copy code
13+
helm install qryn-release qryn-helm
14+
For customization, you can provide a values.yaml file or use --set flags to override specific configurations during installation.
15+
16+
17+
Feel free to modify the configurations based on your requirements and environment.
18+
19+
## Qryn Environments Link
20+
For more information about Qryn environment variables, visit [Qryn Environments](https://qryn.metrico.in/#/env).

templates/_helpers.tpl

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "qryn-helm.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "qryn-helm.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "qryn-helm.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "qryn-helm.labels" -}}
37+
helm.sh/chart: {{ include "qryn-helm.chart" . }}
38+
{{ include "qryn-helm.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "qryn-helm.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "qryn-helm.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "qryn-helm.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "qryn-helm.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
63+
64+
{{/*
65+
Creating Image Pull Secrets
66+
*/}}
67+
{{- define "imagePullSecret" }}
68+
{{- with .Values.imageCredentials }}
69+
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
70+
{{- end }}
71+
{{- end }}
72+
73+
{{- define "helm.secretName" -}}
74+
{{- if .Values.imagePullSecrets.nameOverride }}
75+
{{- .Values.imagePullSecrets.nameOverride }}
76+
{{- else }}
77+
{{- printf "%s-regcred" .Release.Name | trunc 63 | trimSuffix "-" }}
78+
{{- end }}
79+
{{- end }}

templates/qryn-deployment.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "qryn-helm.fullname" . }}
5+
labels:
6+
{{- include "qryn-helm.labels" . | nindent 4 }}
7+
spec:
8+
replicas: {{ .Values.replicas }}
9+
selector:
10+
matchLabels:
11+
{{- include "qryn-helm.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "qryn-helm.selectorLabels" . | nindent 8 }}
16+
spec:
17+
securityContext:
18+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
19+
containers:
20+
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
21+
name: {{ include "qryn-helm.fullname" . }}
22+
imagePullSecrets:
23+
- name: {{ include "helm.secretName" . }}
24+
env:
25+
{{- range $key, $val := .Values.env }}
26+
- name: {{ $key }}
27+
value: "{{ $val }}"
28+
{{- end }}
29+
30+
ports:
31+
- name: http
32+
containerPort: {{ .Values.service.port }}
33+
protocol: TCP
34+
35+
livenessProbe:
36+
httpGet:
37+
path: /ready
38+
port: http
39+
initialDelaySeconds: 10 #Default 0
40+
periodSeconds: 10 #Default 10
41+
timeoutSeconds: 1 #Default 1
42+
successThreshold: 1 #Default 1
43+
failureThreshold: 3 #Default 3
44+
45+
resources:
46+
{{- toYaml .Values.resources | nindent 12 }}
47+
48+
49+
restartPolicy: Always

templates/qryn-hpa.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "qryn-helm.fullname" . }}
6+
labels:
7+
{{- include "qryn-helm.labels" . | nindent 4 }}
8+
spec:
9+
scaleTargetRef:
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
name: {{ include "qryn-helm.fullname" . }}
13+
minReplicas: {{ .Values.autoscaling.minReplicas }}
14+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15+
metrics:
16+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17+
- type: Resource
18+
resource:
19+
name: cpu
20+
target:
21+
type: Utilization
22+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
23+
{{- end }}
24+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
25+
- type: Resource
26+
resource:
27+
name: memory
28+
target:
29+
type: Utilization
30+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
31+
{{- end }}
32+
{{- end }}

templates/qryn-ingress.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "qryn-helm.fullname" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5+
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
6+
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
7+
{{- end }}
8+
{{- end }}
9+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
10+
apiVersion: networking.k8s.io/v1
11+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12+
apiVersion: networking.k8s.io/v1beta1
13+
{{- else -}}
14+
apiVersion: extensions/v1beta1
15+
{{- end }}
16+
kind: Ingress
17+
metadata:
18+
name: {{ $fullName }}
19+
labels:
20+
{{- include "qryn-helm.labels" . | nindent 4 }}
21+
{{- with .Values.ingress.annotations }}
22+
annotations:
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
25+
spec:
26+
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27+
ingressClassName: {{ .Values.ingress.className }}
28+
{{- end }}
29+
{{- if .Values.ingress.tls }}
30+
tls:
31+
{{- range .Values.ingress.tls }}
32+
- hosts:
33+
{{- range .hosts }}
34+
- {{ . | quote }}
35+
{{- end }}
36+
secretName: {{ .secretName }}
37+
{{- end }}
38+
{{- end }}
39+
rules:
40+
{{- range .Values.ingress.hosts }}
41+
- host: {{ .host | quote }}
42+
http:
43+
paths:
44+
{{- range .paths }}
45+
- path: {{ .path }}
46+
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
47+
pathType: {{ .pathType }}
48+
{{- end }}
49+
backend:
50+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
51+
service:
52+
name: {{ $fullName }}
53+
port:
54+
number: {{ $svcPort }}
55+
{{- else }}
56+
serviceName: {{ $fullName }}
57+
servicePort: {{ $svcPort }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
61+
{{- end }}

templates/qryn-service.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "qryn-helm.fullname" . }}
5+
labels:
6+
{{- include "qryn-helm.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.type }}
9+
selector:
10+
{{- include "qryn-helm.selectorLabels" . | nindent 4 }}
11+
ports:
12+
- port: {{ .Values.service.port }}
13+
targetPort: http
14+
protocol: TCP
15+
name: http

0 commit comments

Comments
 (0)