Skip to content

Commit aa977ee

Browse files
committed
wip: livechat helm chart
1 parent babfe85 commit aa977ee

File tree

13 files changed

+337
-0
lines changed

13 files changed

+337
-0
lines changed

charts/livechat/.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/

charts/livechat/Chart.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dependencies:
2+
- name: mongodb
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 16.4.8
5+
- name: keycloak
6+
repository: https://charts.bitnami.com/bitnami
7+
version: 24.4.13
8+
digest: sha256:61e66472801d06d0838aff7a663a42b1aa9e9f8dcbc6101797179dadea79d27c
9+
generated: "2025-04-06T21:31:12.636295295Z"

charts/livechat/Chart.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v2
2+
name: livechat
3+
description: A live chat application.
4+
5+
type: application
6+
version: 1.0.0
7+
8+
dependencies:
9+
- name: mongodb
10+
version: "16.4.8"
11+
repository: "https://charts.bitnami.com/bitnami"
12+
condition: mongodb.enabled
13+
- name: keycloak
14+
version: "24.4.13"
15+
repository: "https://charts.bitnami.com/bitnami"
16+
condition: keycloak.enabled
140 KB
Binary file not shown.
99.3 KB
Binary file not shown.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "livechat.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 "livechat.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 "livechat.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "livechat.labels" -}}
37+
helm.sh/chart: {{ include "livechat.chart" . }}
38+
{{ include "livechat.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 "livechat.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "livechat.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 "livechat.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "livechat.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ printf "%s-backend" (include "livechat.fullname" .) }}
5+
spec:
6+
selector:
7+
matchLabels:
8+
app.kubernetes.io/name: {{ include "livechat.fullname" . }}
9+
template:
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: {{ include "livechat.fullname" . }}
13+
spec:
14+
containers:
15+
- name: {{ .Chart.Name }}
16+
image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag | default .Chart.AppVersion }}"
17+
imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
18+
ports:
19+
- name: http
20+
containerPort: {{ .Values.backend.service.port }}
21+
protocol: TCP
22+
livenessProbe:
23+
httpGet:
24+
path: "/actuator/health/liveness"
25+
port: 8081
26+
initialDelaySeconds: 15
27+
readinessProbe:
28+
httpGet:
29+
path: "/actuator/health/readiness"
30+
port: 8081
31+
initialDelaySeconds: 5
32+
envFrom:
33+
- configMapRef:
34+
name: {{ include "livechat.fullname" . }}
35+
env:
36+
- name: MONGODB_PASSWORD
37+
valueFrom:
38+
secretKeyRef:
39+
name: {{ include "mongodb.fullname" .Subcharts.mongodb }}
40+
key: mongodb-passwords
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ printf "%s-backend" (include "livechat.fullname" .) }}
5+
spec:
6+
type: {{ .Values.backend.service.type }}
7+
ports:
8+
- port: {{ .Values.backend.service.port }}
9+
targetPort: http
10+
protocol: TCP
11+
name: http
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "livechat.fullname" . }}
5+
labels:
6+
{{- include "livechat.labels" . | nindent 4 }}
7+
data:
8+
BACKEND_URI: {{ printf "%s://%s" (ternary "https" "http" .Values.ingress.tls.enabled) .Values.backend.ingress.host | quote }}
9+
FRONTEND_URI: {{ printf "%s://%s" (ternary "https" "http" .Values.ingress.tls.enabled) .Values.frontend.ingress.host | quote }}
10+
11+
MONGODB_HOST: {{ include "mongodb.service.nameOverride" .Subcharts.mongodb | quote }}
12+
MONGODB_PORT: {{ .Values.mongodb.service.ports.mongodb | quote }}
13+
MONGODB_USERNAME: {{ .Values.mongodb.auth.username | quote }}
14+
MONGODB_DATABASE: {{ .Values.mongodb.auth.database | quote }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ printf "%s-frontend" (include "livechat.fullname" .) }}
5+
spec:
6+
selector:
7+
matchLabels:
8+
app.kubernetes.io/name: {{ include "livechat.fullname" . }}
9+
template:
10+
metadata:
11+
labels:
12+
app.kubernetes.io/name: {{ include "livechat.fullname" . }}
13+
spec:
14+
containers:
15+
- name: {{ .Chart.Name }}
16+
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}"
17+
imagePullPolicy: {{ .Values.frontend.image.pullPolicy }}
18+
ports:
19+
- name: http
20+
containerPort: {{ .Values.frontend.service.port }}
21+
protocol: TCP
22+
livenessProbe:
23+
httpGet:
24+
path: "/healthz"
25+
port: {{ .Values.frontend.service.port }}
26+
initialDelaySeconds: 15
27+
readinessProbe:
28+
httpGet:
29+
path: "/readyz"
30+
port: {{ .Values.frontend.service.port }}
31+
initialDelaySeconds: 5
32+
envFrom:
33+
- configMapRef:
34+
name: {{ include "livechat.fullname" . }}

0 commit comments

Comments
 (0)