initial commit

This commit is contained in:
Daniel Noulet 2026-10-07 15:14:50 +02:00
commit 1253955070
75 changed files with 13972 additions and 0 deletions

View file

@ -0,0 +1,41 @@
{{/*
Full name.
Used for naming resources like Deployments and Services.
*/}}
{{- define "go-loose.fullname" -}}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Labels.
Used to mark resources for selection.
*/}}
{{- define "go-loose.labels" -}}
helm.sh/chart: {{ include "go-loose.chart" . }}
{{ include "go-loose.selectorLabels" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels.
Used by a Service to find the pods it should route traffic to.
*/}}
{{- define "go-loose.selectorLabels" -}}
app.kubernetes.io/name: {{ include "go-loose.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/*
Name template helper.
*/}}
{{- define "go-loose.name" -}}
{{- default .Chart.Name .Values.nameOverride -}}
{{- end -}}
{{/*
Chart name helper.
*/}}
{{- define "go-loose.chart" -}}
{{- printf "%s-%s-%s" .Chart.Name .Chart.Version .Chart.AppVersion | replace "+" "_" -}}
{{- end -}}

View file

@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "go-loose.fullname" . }}
labels:
{{- include "go-loose.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "go-loose.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "go-loose.labels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
env:
- name: GO_LOOSE_SESSION_SECRET
value: {{ .Values.sessionSecret | quote }}
- name: GO_LOOSE_DATABASE_URL
value: "postgres://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ .Release.Name }}-postgresql:5432/{{ .Values.postgresql.auth.database }}?sslmode=disable"
{{- with .Values.probes.livenessProbe }}
livenessProbe:
httpGet:
path: {{ .httpGet.path }}
port: http
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
{{- end }}
{{- with .Values.probes.readinessProbe }}
readinessProbe:
httpGet:
path: {{ .httpGet.path }}
port: http
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}

View file

@ -0,0 +1,34 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "go-loose.fullname" . }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "go-loose.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
{{- if .Values.ingress.tls }}
tls:
{{- toYaml .Values.ingress.tls | nindent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ $fullName }}
port:
number: {{ $.Values.service.port }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "go-loose.fullname" . }}
labels:
{{- include "go-loose.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }} # ClusterIP for internal service discovery
ports:
- port: {{ .Values.service.port }}
targetPort: http # Must match the containerPort in deployment.yaml
protocol: TCP
name: http
selector:
{{- include "go-loose.selectorLabels" . | nindent 4 }}