initial commit

This commit is contained in:
Daniel Noulet 2026-10-04 16:20:07 +02:00
commit ebd5bb09fd
30 changed files with 1920 additions and 0 deletions

6
helm/go-mad/Chart.yaml Normal file
View file

@ -0,0 +1,6 @@
apiVersion: v2
name: go-mad
description: A web application for managing tenant database connections and migrations
type: application
version: 0.1.0
appVersion: "1.0"

View file

@ -0,0 +1,7 @@
{{- define "go-mad.name" -}}
go-mad
{{- end -}}
{{- define "go-mad.fullname" -}}
{{- .Release.Name -}}
{{- end -}}

View file

@ -0,0 +1,52 @@
{{- $fullName := include "go-mad.fullname" . }}
{{- $values := index .Values "go-mad" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: "{{ .Chart.appVersion }}"
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ $fullName }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ $values.serverPort | int }}
env:
- name: GO_MAD_DATABASE_URL
value: "{{ $values.databaseURL }}"
- name: GO_MAD_SERVER_PORT
value: "{{ $values.serverPort }}"
- name: GO_MAD_JWT_SECRET
value: "{{ $values.jwtSecret }}"
{{- with $values.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
httpGet:
path: /health
port: {{ $values.serverPort | int }}
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /health
port: {{ $values.serverPort | int }}
initialDelaySeconds: 10
periodSeconds: 15

View file

@ -0,0 +1,18 @@
{{- $fullName := include "go-mad.fullname" . }}
apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ index .Values "go-mad" "serverPort" | int }}
protocol: TCP
selector:
app.kubernetes.io/name: {{ include "go-mad.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}

53
helm/go-mad/values.yaml Normal file
View file

@ -0,0 +1,53 @@
replicaCount: 1
image:
repository: batty1039.startdedicated.net:5000/go-mad
pullPolicy: IfNotPresent
tag: "latest"
service:
type: ClusterIP
port: 8080
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
database:
enabled: true
postgresql:
enabled: true
auth:
username: mad
password: mad
database: mad
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-related: ...
hosts:
- host: go-mad.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: go-mad-tls
# hosts:
# - go-mad.local
go-mad:
databaseURL: "postgres://mad:mad@go-guess-postgresql:5432/mad?sslmode=disable"
serverPort: 8080
jwtSecret: "change-me-to-a-32-plus-char-secret"
web:
enabled: true
type: serving
port: 8080