Initial chart commit
Some checks failed
Publish Helm Chart / publish (push) Failing after 10s

This commit is contained in:
2025-12-10 20:29:40 +01:00
commit 55bf81ff14
10 changed files with 250 additions and 0 deletions

62
templates/_helpers.tpl Normal file
View File

@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "solidtime.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "solidtime.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "solidtime.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "solidtime.labels" -}}
helm.sh/chart: {{ include "solidtime.chart" . }}
{{ include "solidtime.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "solidtime.selectorLabels" -}}
app.kubernetes.io/name: {{ include "solidtime.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "solidtime.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "solidtime.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

11
templates/configmap.yaml Normal file
View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "solidtime.fullname" . }}-env
data:
APP_URL: "https://{{ .Values.domain }}"
DB_CONNECTION: "pgsql"
DB_HOST: "{{ .Release.Name }}-postgresql" # Connects to the dependency
DB_PORT: "5432"
DB_DATABASE: "{{ .Values.postgresql.auth.database }}"
DB_USERNAME: "{{ .Values.postgresql.auth.username }}"

View File

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "solidtime.fullname" . }}-app
spec:
replicas: 1
selector:
matchLabels:
app: solidtime-app
template:
metadata:
labels:
app: solidtime-app
spec:
containers:
- name: solidtime
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
ports:
- containerPort: 80
envFrom:
- configMapRef:
name: {{ include "solidtime.fullname" . }}-env
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "solidtime.fullname" . }}-secret
key: DB_PASSWORD
- name: APP_KEY
valueFrom:
secretKeyRef:
name: {{ include "solidtime.fullname" . }}-secret
key: APP_KEY

View File

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "solidtime.fullname" . }}-worker
spec:
replicas: 1
selector:
matchLabels:
app: solidtime-worker
template:
metadata:
labels:
app: solidtime-worker
spec:
containers:
- name: worker
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
# Override the default command to run the queue worker
command: ["php", "/var/www/html/artisan", "queue:work"]
envFrom:
- configMapRef:
name: {{ include "solidtime.fullname" . }}-env
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "solidtime.fullname" . }}-secret
key: DB_PASSWORD
- name: APP_KEY
valueFrom:
secretKeyRef:
name: {{ include "solidtime.fullname" . }}-secret
key: APP_KEY

0
templates/ingress.yaml Normal file
View File

8
templates/secret.yaml Normal file
View File

@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "solidtime.fullname" . }}-secret
type: Opaque
stringData:
APP_KEY: {{ .Values.appKey | quote }}
DB_PASSWORD: {{ .Values.postgresql.auth.password | quote }}

16
templates/service.yaml Normal file
View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "solidtime.fullname" . }}
labels:
{{- include "solidtime.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
# Matches the labels in deployment-app.yaml
app: solidtime-app