This commit is contained in:
43
.gitea/workflows/publish-chart.yaml
Normal file
43
.gitea/workflows/publish-chart.yaml
Normal file
@ -0,0 +1,43 @@
|
||||
name: Publish Helm Chart
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'Chart.yaml' # Only trigger if version changes or main is updated
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest # Or whatever label your runner uses
|
||||
container:
|
||||
image: alpine/helm:3.12.0 # Use an image with Helm pre-installed
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Dependencies
|
||||
run: helm dependency update .
|
||||
|
||||
- name: Package Chart
|
||||
run: helm package .
|
||||
|
||||
- name: Login to Registry
|
||||
run: |
|
||||
# Gitea automatically provides the token and actor variables
|
||||
echo ${{ secrets.GITEA_TOKEN }} | helm registry login ${{ gitea.server_url }} \
|
||||
--username ${{ gitea.actor }} \
|
||||
--password-stdin
|
||||
|
||||
- name: Push to Gitea Registry
|
||||
run: |
|
||||
# Clean the protocol (https://) from the URL for OCI
|
||||
DOMAIN=${{ gitea.server_url }}
|
||||
DOMAIN=${DOMAIN#*//}
|
||||
|
||||
# Find the packaged .tgz file
|
||||
CHART_FILE=$(ls *.tgz)
|
||||
|
||||
# Push to the OCI registry
|
||||
# URL Format: oci://<domain>/<user/org>/charts
|
||||
helm push $CHART_FILE oci://$DOMAIN/${{ gitea.actor }}/charts
|
||||
11
Chart.yaml
Normal file
11
Chart.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: v2
|
||||
name: solidtime
|
||||
description: A Helm chart for Solidtime Time Tracker
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0.0"
|
||||
dependencies:
|
||||
- name: postgresql
|
||||
version: 12.x.x
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
condition: postgresql.enabled
|
||||
62
templates/_helpers.tpl
Normal file
62
templates/_helpers.tpl
Normal 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
11
templates/configmap.yaml
Normal 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 }}"
|
||||
33
templates/deployment-app.yaml
Normal file
33
templates/deployment-app.yaml
Normal 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
|
||||
33
templates/deployment-worker.yaml
Normal file
33
templates/deployment-worker.yaml
Normal 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
0
templates/ingress.yaml
Normal file
8
templates/secret.yaml
Normal file
8
templates/secret.yaml
Normal 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
16
templates/service.yaml
Normal 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
|
||||
33
values.yaml
Normal file
33
values.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
domain: "time.northernlighthouseinteractive.com"
|
||||
|
||||
image:
|
||||
repository: solidtime/solidtime
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "latest" # Pin this to a specific version in production!
|
||||
|
||||
# Generates the Laravel App Key. Change this!
|
||||
# Run `php artisan key:generate --show` locally to get one.
|
||||
appKey: "base64:YOUR_GENERATED_KEY_HERE"
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
className: "nginx"
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
hosts:
|
||||
- host: time.northernlighthouseinteractive.com
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
|
||||
# Database Dependency Configuration
|
||||
postgresql:
|
||||
enabled: true
|
||||
auth:
|
||||
username: solidtime
|
||||
password: securepassword
|
||||
database: solidtime
|
||||
primary:
|
||||
persistence:
|
||||
enabled: true
|
||||
size: 10Gi
|
||||
Reference in New Issue
Block a user