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,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 16.7.27
digest: sha256:e8b999a3aaad6328a13d0c666207650897b69c61367c947d363b2acbe0ea1b42
generated: "2026-10-04T19:38:06.343578353+02:00"

View file

@ -0,0 +1,13 @@
# Chart metadata for go-loose, the authentication service.
# Note: this file is plain YAML, not a Helm template, so comments start with '#'.
apiVersion: v2
name: go-loose
description: A Helm chart for deploying the go-loose SSO service.
type: application
version: 0.1.0
appVersion: "latest"
dependencies:
- name: postgresql
version: "16.x.x"
repository: "https://charts.bitnami.com/bitnami"
condition: postgresql.enabled

Binary file not shown.

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 }}

View file

@ -0,0 +1,73 @@
# Development values for go-loose
replicaCount: 1
sessionSecret: "dev-session-secret-change-me-to-32-plus-chars"
postgresql:
enabled: true
image:
registry: docker.io
repository: bitnami/postgresql
tag: latest
pullPolicy: IfNotPresent
auth:
username: goloose
password: goloose
database: goloose
primary:
persistence:
enabled: true
size: 2Gi
image:
repository: batty1039.startdedicated.net:5000/go-loose
pullPolicy: Always
tag: latest
service:
type: ClusterIP
port: 8080
probes:
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-staging
nginx.ingress.kubernetes.io/ssl-redirect: "true"
hosts:
- host: auth-dev.urpi.be
paths:
- path: /
pathType: Prefix
tls:
- secretName: go-loose-tls
hosts:
- auth-dev.urpi.be
certManager:
enabled: true
issuerRef:
name: letsencrypt-staging
kind: ClusterIssuer

View file

@ -0,0 +1,73 @@
# Local (LCL) values for go-loose (the auth service).
# Served at https://auth-lcl.intern-urpi.be by the docker TLS edge.
replicaCount: 1
sessionSecret: "lcl-session-secret-change-me-to-32-plus-chars"
postgresql:
enabled: true
image:
registry: docker.io
repository: bitnami/postgresql
tag: latest
pullPolicy: IfNotPresent
auth:
username: goloose
password: goloose
database: goloose
primary:
persistence:
enabled: true
size: 2Gi
image:
repository: localhost:5000/go-loose
pullPolicy: IfNotPresent
tag: "0.0.1"
service:
type: ClusterIP
port: 8080
probes:
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi
ingress:
enabled: true
className: traefik
annotations: {}
hosts:
- host: auth-lcl.intern-urpi.be
paths:
- path: /
pathType: Prefix
tls:
- secretName: local-dev-cert
hosts:
- auth-lcl.intern-urpi.be
# No cert-manager in the local cluster.
certManager:
enabled: false
issuerRef:
name: letsencrypt-staging
kind: ClusterIssuer

View file

@ -0,0 +1,73 @@
# Production values for go-loose
replicaCount: 2
sessionSecret: "" # Set via --set or secret
postgresql:
enabled: true
image:
registry: docker.io
repository: bitnami/postgresql
tag: latest
pullPolicy: IfNotPresent
auth:
username: goloose
password: goloose
database: goloose
primary:
persistence:
enabled: true
size: 10Gi
image:
repository: batty1039.startdedicated.net:5000/go-loose
pullPolicy: Always
tag: latest
service:
type: ClusterIP
port: 8080
probes:
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 200m
memory: 256Mi
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/ssl-redirect: "true"
hosts:
- host: auth.urpi.be
paths:
- path: /
pathType: Prefix
tls:
- secretName: go-loose-tls
hosts:
- auth.urpi.be
certManager:
enabled: true
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer

View file

@ -0,0 +1,73 @@
# TST values for go-loose
replicaCount: 1
sessionSecret: "tst-session-secret-change-me-to-32-plus-chars"
postgresql:
enabled: true
image:
registry: docker.io
repository: bitnami/postgresql
tag: latest
pullPolicy: IfNotPresent
auth:
username: goloose
password: goloose
database: goloose
primary:
persistence:
enabled: true
size: 5Gi
image:
repository: batty1039.startdedicated.net:5000/go-loose
pullPolicy: Always
tag: latest
service:
type: ClusterIP
port: 8080
probes:
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 750m
memory: 512Mi
requests:
cpu: 150m
memory: 256Mi
ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt-staging
nginx.ingress.kubernetes.io/ssl-redirect: "true"
hosts:
- host: auth-tst.intern-urpi.be
paths:
- path: /
pathType: Prefix
tls:
- secretName: go-loose-tls
hosts:
- auth-tst.intern-urpi.be
certManager:
enabled: true
issuerRef:
name: letsencrypt-staging
kind: ClusterIssuer

View file

@ -0,0 +1,53 @@
# Default values for go-loose.
# This is where you can override the default values in the chart.
replicaCount: 1
sessionSecret: "local-development-secret-change-me-now"
databaseURL: "postgres://goloose:goloose@go-guess-postgresql:5432/goloose?sslmode=disable"
image:
# Placeholder: needs the real registry path for the go-loose image.
repository: batty1039.startdedicated.net:5000/go-loose
pullPolicy: IfNotPresent
tag: latest
service:
type: ClusterIP
port: 8080
# ingress is off by default. The template reads .Values.ingress.enabled
# directly, so the key has to exist even when ingress is disabled, otherwise
# `helm template` fails with a nil pointer error.
ingress:
enabled: false
className: nginx
annotations: {}
# tls: []
hosts:
- host: go-loose.local
paths:
- path: /
pathType: Prefix
probes:
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
httpGet:
path: /readyz
port: http
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 100m
memory: 128Mi