Skip to content

Commit 458192c

Browse files
authored
Merge pull request #214 from rootcodelabs/kubernetes
Kubernetes helm charts
2 parents 0d11da2 + 327e5b2 commit 458192c

128 files changed

Lines changed: 4976 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Helm Dependency Build
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
paths:
9+
- 'kubernetes/**'
10+
11+
jobs:
12+
build-dependencies:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
with:
19+
persist-credentials: true
20+
21+
- name: Set up Helm
22+
uses: azure/setup-helm@v3
23+
with:
24+
version: v3.12.0
25+
26+
- name: Build Helm dependencies
27+
working-directory: ./kubernetes
28+
run: |
29+
rm -f Chart.lock
30+
helm dependency build
31+
32+
- name: Commit and push if dependencies updated
33+
run: |
34+
git config user.name "github-actions[bot]"
35+
git config user.email "github-actions[bot]@users.noreply.github.com"
36+
git add kubernetes/Chart.lock kubernetes/charts/
37+
if ! git diff --cached --quiet; then
38+
git commit -m "chore: update Helm dependencies (charts/ and Chart.lock)"
39+
git push
40+
else
41+
echo "No changes to Helm dependencies."
42+
fi
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: Authentication-Layer
3+
description: Authentication Layer Service for RAG
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.0"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{- if .Values.enabled }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: "{{ .Values.release_name }}"
6+
labels:
7+
app: "{{ .Values.release_name }}"
8+
spec:
9+
replicas: {{ .Values.replicas }}
10+
selector:
11+
matchLabels:
12+
app: "{{ .Values.release_name }}"
13+
template:
14+
metadata:
15+
labels:
16+
app: "{{ .Values.release_name }}"
17+
spec:
18+
containers:
19+
- name: "{{ .Values.release_name }}"
20+
image: "{{ .Values.authentication.image.repository }}:{{ .Values.authentication.image.tag }}"
21+
imagePullPolicy: {{ .Values.authentication.image.pullPolicy }}
22+
ports:
23+
- name: http
24+
containerPort: {{ .Values.service.port }}
25+
protocol: TCP
26+
env:
27+
- name: PORT
28+
value: {{ .Values.authentication.environment.serverPort | quote }}
29+
- name: TIM_SERVICE_URL
30+
value: {{ .Values.authentication.environment.timServiceUrl | quote }}
31+
- name: CORS_ORIGINS
32+
value: {{ .Values.authentication.environment.corsOrigins | quote }}
33+
34+
{{- end }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if .Values.ingress.enabled }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: "{{ .Values.release_name }}-ingress"
6+
annotations:
7+
kubernetes.io/ingress.class: "nginx"
8+
nginx.ingress.kubernetes.io/enable-cors: "true"
9+
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
10+
cert-manager.io/cluster-issuer: {{ .Values.ingress.certIssuerName | quote }}
11+
labels:
12+
name: "{{ .Values.release_name }}-ingress"
13+
spec:
14+
rules:
15+
- host: auth.{{ .Values.domain }}
16+
http:
17+
paths:
18+
- pathType: Prefix
19+
path: "/"
20+
backend:
21+
service:
22+
name: "{{ .Values.release_name }}"
23+
port:
24+
number: 3004
25+
tls:
26+
- hosts:
27+
- auth.{{ .Values.domain }}
28+
secretName: {{ .Values.secretname }}
29+
{{- end }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if .Values.enabled }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: "{{ .Values.release_name }}"
6+
labels:
7+
app: "{{ .Values.release_name }}"
8+
spec:
9+
type: {{ .Values.service.type }}
10+
ports:
11+
- port: {{ .Values.service.port }}
12+
targetPort: {{ .Values.service.port }}
13+
protocol: TCP
14+
name: http
15+
selector:
16+
app: "{{ .Values.release_name }}"
17+
{{- end }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
replicas: 1
2+
enabled: true
3+
4+
5+
release_name: "authentication-layer"
6+
domain: "rag.local" # need to set this
7+
secretname: "authentication-layer-tls"
8+
9+
ingress:
10+
enabled: true
11+
certIssuerName: "letsencrypt-prod"
12+
13+
# Authentication Layer Configuration
14+
authentication:
15+
image:
16+
repository: "ghcr.io/buerokratt/authentication-layer" # Update with actual auth-layer image repository
17+
tag: "latest"
18+
pullPolicy: Always
19+
20+
environment:
21+
serverPort: "3004"
22+
timServiceUrl: "http://tim:8085"
23+
corsOrigins: "http://localhost:3001,http://localhost:3003,http://localhost:8086"
24+
25+
service:
26+
type: ClusterIP
27+
port: 3004
28+
29+
resources:
30+
requests:
31+
memory: "10Mi"
32+
cpu: "1m"
33+
limits:
34+
memory: "50Mi"
35+
cpu: "5m"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: ClickHouse
3+
description: ClickHouse analytics database for Langfuse
4+
type: application
5+
version: 0.1.0
6+
appVersion: "latest"
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{{- if .Values.enabled }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: "{{ .Values.release_name }}"
6+
labels:
7+
app: "{{ .Values.release_name }}"
8+
component: clickhouse
9+
spec:
10+
replicas: {{ .Values.replicas }}
11+
selector:
12+
matchLabels:
13+
app: "{{ .Values.release_name }}"
14+
template:
15+
metadata:
16+
labels:
17+
app: "{{ .Values.release_name }}"
18+
component: clickhouse
19+
spec:
20+
{{- if .Values.securityContext }}
21+
securityContext:
22+
runAsUser: {{ .Values.securityContext.runAsUser }}
23+
runAsGroup: {{ .Values.securityContext.runAsGroup }}
24+
fsGroup: {{ .Values.securityContext.fsGroup }}
25+
{{- end }}
26+
containers:
27+
- name: "{{ .Values.release_name }}"
28+
image: "{{ .Values.images.clickhouse.registry }}/{{ .Values.images.clickhouse.repository }}:{{ .Values.images.clickhouse.tag }}"
29+
imagePullPolicy: {{ .Values.pullPolicy }}
30+
ports:
31+
- name: http
32+
containerPort: {{ .Values.service.httpPort }}
33+
protocol: TCP
34+
- name: native
35+
containerPort: {{ .Values.service.nativePort }}
36+
protocol: TCP
37+
# Non-sensitive env's from values.yaml
38+
env:
39+
- name: CLICKHOUSE_DB
40+
value: "{{ .Values.env.CLICKHOUSE_DB }}"
41+
# Sensitive env's from Kubernetes Secret
42+
{{- if .Values.envFrom }}
43+
envFrom:
44+
{{- toYaml .Values.envFrom | nindent 12 }}
45+
{{- end }}
46+
{{- if .Values.healthcheck.enabled }}
47+
livenessProbe:
48+
httpGet:
49+
path: "{{ .Values.healthcheck.httpPath }}"
50+
port: {{ .Values.service.httpPort }}
51+
initialDelaySeconds: {{ .Values.healthcheck.initialDelaySeconds }}
52+
periodSeconds: {{ .Values.healthcheck.periodSeconds }}
53+
timeoutSeconds: {{ .Values.healthcheck.timeoutSeconds }}
54+
failureThreshold: {{ .Values.healthcheck.failureThreshold }}
55+
readinessProbe:
56+
httpGet:
57+
path: "{{ .Values.healthcheck.httpPath }}"
58+
port: {{ .Values.service.httpPort }}
59+
initialDelaySeconds: {{ .Values.healthcheck.initialDelaySeconds }}
60+
periodSeconds: {{ .Values.healthcheck.periodSeconds }}
61+
timeoutSeconds: {{ .Values.healthcheck.timeoutSeconds }}
62+
failureThreshold: {{ .Values.healthcheck.failureThreshold }}
63+
{{- end }}
64+
{{- if .Values.persistence.enabled }}
65+
volumeMounts:
66+
- name: langfuse-clickhouse-data
67+
mountPath: /var/lib/clickhouse
68+
- name: langfuse-clickhouse-logs
69+
mountPath: /var/log/clickhouse-server
70+
{{- end }}
71+
resources:
72+
requests:
73+
memory: "{{ .Values.resources.requests.memory }}"
74+
cpu: "{{ .Values.resources.requests.cpu }}"
75+
limits:
76+
memory: "{{ .Values.resources.limits.memory }}"
77+
cpu: "{{ .Values.resources.limits.cpu }}"
78+
{{- if .Values.persistence.enabled }}
79+
volumes:
80+
- name: langfuse-clickhouse-data
81+
persistentVolumeClaim:
82+
claimName: "{{ .Values.release_name }}-data"
83+
- name: langfuse-clickhouse-logs
84+
persistentVolumeClaim:
85+
claimName: "{{ .Values.release_name }}-logs"
86+
{{- end }}
87+
restartPolicy: Always
88+
{{- end }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if and .Values.enabled .Values.persistence.enabled }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: "{{ .Values.release_name }}-data"
6+
labels:
7+
app: "{{ .Values.release_name }}"
8+
component: clickhouse
9+
type: data
10+
spec:
11+
accessModes:
12+
- {{ .Values.persistence.data.accessMode }}
13+
resources:
14+
requests:
15+
storage: {{ .Values.persistence.data.size }}
16+
{{- if .Values.persistence.data.storageClass }}
17+
storageClassName: {{ .Values.persistence.data.storageClass }}
18+
{{- end }}
19+
---
20+
apiVersion: v1
21+
kind: PersistentVolumeClaim
22+
metadata:
23+
name: "{{ .Values.release_name }}-logs"
24+
labels:
25+
app: "{{ .Values.release_name }}"
26+
component: clickhouse
27+
type: logs
28+
spec:
29+
accessModes:
30+
- {{ .Values.persistence.logs.accessMode }}
31+
resources:
32+
requests:
33+
storage: {{ .Values.persistence.logs.size }}
34+
{{- if .Values.persistence.logs.storageClass }}
35+
storageClassName: {{ .Values.persistence.logs.storageClass }}
36+
{{- end }}
37+
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if .Values.enabled }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: clickhouse-secrets
6+
labels:
7+
app: "{{ .Values.release_name }}"
8+
component: clickhouse
9+
type: Opaque
10+
stringData:
11+
CLICKHOUSE_USER: "<SET_ME>"
12+
CLICKHOUSE_PASSWORD: "<SET_ME>"
13+
{{- end }}

0 commit comments

Comments
 (0)