Merge pull request 'main' (#2) from alice/helm-charts:main into main

Reviewed-on: coo-ops.space/helm-charts#2
This commit is contained in:
alice 2023-06-26 11:11:53 +00:00
commit 51ab27ecbc
17 changed files with 550 additions and 9 deletions

View File

@ -0,0 +1,25 @@
name: checks
on:
- push
- pull_request
jobs:
lint:
name: check and test
runs-on: ubuntu-latest
steps:
- uses: https://gitea.com/actions/checkout@v3
- name: install tools
run: |
apt update -y
apt install -y curl
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list
apt update -y
apt install -y python helm python3-pip apt-transport-https
- name: lint charts
run: |
make ci

View File

@ -32,8 +32,16 @@ jobs:
run: | run: |
# FIXME: use upstream after https://github.com/technosophos/helm-gpg/issues/1 is solved # FIXME: use upstream after https://github.com/technosophos/helm-gpg/issues/1 is solved
helm plugin install https://github.com/pat-s/helm-gpg helm plugin install https://github.com/pat-s/helm-gpg
helm plugin install https://github.com/chartmuseum/helm-push
make all make all
- name: Deploy to Gitea helm
run: |
helm repo add --username ${{ secrets.repo_user }} --password ${{ secrets.repo_password }} cooopsspace https://git.coo-ops.space/api/packages/coo-ops.space/helm
for filename in ./_build/*.tgz; do
helm cm-push $filename cooopsspace
done
- name: Deploy to FTP Server - name: Deploy to FTP Server
uses: https://github.com/SamKirkland/FTP-Deploy-Action@v4.3.4 uses: https://github.com/SamKirkland/FTP-Deploy-Action@v4.3.4
with: with:

View File

@ -5,14 +5,22 @@ configure:
@mkdir -p _build/ @mkdir -p _build/
helm repo add bitnami https://charts.bitnami.com/bitnami helm repo add bitnami https://charts.bitnami.com/bitnami
homebox: configure homebox_ci: configure
helm lint charts/stable/homebox/
helm dependency build charts/stable/homebox/ helm dependency build charts/stable/homebox/
helm lint charts/stable/homebox/
homebox: configure homebox_ci
helm package charts/stable/homebox/ -d _build/ helm package charts/stable/homebox/ -d _build/
romm_ci: configure
helm dependency build charts/stable/romm/
helm lint charts/stable/romm/
romm: configure romm_ci
helm package charts/stable/romm/ -d _build/
index: index:
curl -L -o _build/index.yaml https://charts.coo-ops.space/index.yaml curl -L -o _build/index.yaml https://charts.coo-ops.space/index.yaml
helm repo index _build/ --url https://charts.coo-ops.space --merge index.yaml helm repo index _build/ --url https://charts.coo-ops.space --merge index.yaml
stable: homebox ci: homebox_ci romm_ci
stable: homebox romm
all: stable index all: stable index

View File

@ -3,3 +3,4 @@
| Chart | Description | | Chart | Description |
| ----- | ----------- | | ----- | ----------- |
| [homebox](stable/homebox) | Homebox is the inventory and organization system built for the Home User | | [homebox](stable/homebox) | Homebox is the inventory and organization system built for the Home User |
| [romm](stable/romm) | Romm is a rom manager for all your local rom backup needs |

View File

@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
name: homebox name: homebox
# This is the chart version. # This is the chart version.
version: 0.1.0 version: 0.1.2
# A SemVer range of compatible Kubernetes versions (optional) # A SemVer range of compatible Kubernetes versions (optional)
# kubeVersion: ">=1.16.0-0" # kubeVersion: ">=1.16.0-0"
# What is this Application? # What is this Application?

View File

@ -18,10 +18,10 @@ metadata:
{{- end }} {{- end }}
spec: spec:
accessModes: accessModes:
{{- range .Values.persistence.accessModes }} {{- range .Values.persistence.accessModes }}
- {{ . | quote }} - {{ . | quote }}
{{- end }} {{- end }}
{{- include "homebox.persistence.storageClass" . | indent 8 }} {{- include "homebox.persistence.storageClass" . | indent 2 }}
resources: resources:
requests: requests:
storage: {{ .Values.persistence.size | quote }} storage: {{ .Values.persistence.size | quote }}

View File

@ -0,0 +1,6 @@
dependencies:
- name: mariadb
repository: https://charts.bitnami.com/bitnami
version: 11.0.14
digest: sha256:ecbf12680948a285c2fa529ab2096ee8f46d056382cecc16db4b469ed8b17216
generated: "2023-06-25T19:08:44.147546695Z"

View File

@ -0,0 +1,40 @@
apiVersion: v2
name: romm
# This is the chart version.
version: 0.1.0
# A SemVer range of compatible Kubernetes versions (optional)
# kubeVersion: ">=1.16.0-0"
# What is this Application?
description: "ROMM (Rom Manager) is a web based retro roms manager integrated with IGDB. "
type: application
# Meta Keywords
keywords:
- organisation
- inventory
- ROMs
- Backups
# The URL of this projects home page
home: https://github.com/zurdi15/romm
# A list of URLs to source code for this project
sources:
- https://hub.docker.com/r/zurdi15/romm
dependencies:
- name: mariadb
version: 11.0.14
repository: https://charts.bitnami.com/bitnami
condition: mariadb.enabled
# Who's looking after this Chart?
maintainers:
- name: Kyle Coo-ops
email: kyle@coo-ops.space
url: https://git.coo-ops.space/cooper
- name: Alice
email: alice@stacktonic.com.au
url: https://github.com/HunterNyan
# A URL to an SVG or PNG image to be used as an icon (optional).
icon: https://raw.githubusercontent.com/zurdi15/romm/master/romm.svg
# This is the version number of the application being deployed. This version number should be
appVersion: "v1.8.4"
# Whether this chart is deprecated (optional, boolean)
deprecated: false

Binary file not shown.

View File

@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "Speedtest-Tracker.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "Speedtest-Tracker.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "Speedtest-Tracker.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "Speedtest-Tracker.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}

View File

@ -0,0 +1,138 @@
{{/*
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).
*/}}
{{- define "romm.mariadb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Return the MariaDB Hostname
*/}}
{{- define "romm.databaseHost" -}}
{{- if .Values.mariadb.enabled }}
{{- if eq .Values.mariadb.architecture "replication" }}
{{- printf "%s-%s" (include "romm.mariadb.fullname" .) "primary" | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s" (include "romm.mariadb.fullname" .) -}}
{{- end -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.host -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Port
*/}}
{{- define "romm.databasePort" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "3306" -}}
{{- else -}}
{{- printf "%d" (.Values.externalDatabase.port | int ) -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Database Name
*/}}
{{- define "romm.databaseName" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" .Values.mariadb.auth.database -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.database -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB User
*/}}
{{- define "romm.databaseUser" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" .Values.mariadb.auth.username -}}
{{- else -}}
{{- printf "%s" .Values.externalDatabase.user -}}
{{- end -}}
{{- end -}}
{{/*
Return the MariaDB Secret Name
*/}}
{{- define "romm.databaseSecretName" -}}
{{- if .Values.mariadb.enabled }}
{{- printf "%s" (include "romm.mariadb.fullname" .) -}}
{{- else if .Values.externalDatabase.existingSecret -}}
{{- printf "%s" .Values.externalDatabase.existingSecret -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name "externaldb" -}}
{{- end -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "romm.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 "romm.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 "romm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "romm.labels" -}}
helm.sh/chart: {{ include "romm.chart" . }}
{{ include "romm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "romm.selectorLabels" -}}
app.kubernetes.io/name: {{ include "romm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Storage Class
*/}}
{{- define "romm.persistence.storageClass" -}}
{{- $storageClass := .Values.persistence.storageClass }}
{{- if $storageClass }}
storageClassName: {{ $storageClass | quote }}
{{- end }}
{{- end -}}
{{- define "romm.container-additional-mounts" -}}
{{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}}
{{- if gt (len .Values.extraContainerVolumeMounts) 0 -}}
{{- toYaml .Values.extraContainerVolumeMounts -}}
{{- else if gt (len .Values.extraVolumeMounts) 0 -}}
{{- toYaml .Values.extraVolumeMounts -}}
{{- end -}}
{{- end -}}

View File

@ -0,0 +1,109 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "romm.fullname" . }}
namespace: {{ .Values.namespace }}
labels:
{{- include "romm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "romm.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "romm.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.www.image }}:{{ .Values.www.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.www.pullPolicy }}
env:
- name: ROMM_DB_DRIVER
value: mariadb
- name: DB_HOST
value: {{ include "romm.databaseHost" .}}:{{include "romm.databasePort" .}}
- name: DB_NAME
value: {{ include "romm.databaseName" . | quote }}
- name: DB_PASSWD
valueFrom:
secretKeyRef:
key: mariadb-password
name: {{ include "romm.databaseSecretName" . | quote }}
- name: DB_USER
value: {{ include "romm.databaseUser" . | quote }}
- name: CLIENT_ID
valueFrom:
secretKeyRef:
key: CLIENT_ID
name: {{ .Release.Name }}-config
- name: CLIENT_SECRET
valueFrom:
secretKeyRef:
key: CLIENT_SECRET
name: {{ .Release.Name }}-config
- name: STEAMGRIDDB_API_KEY
valueFrom:
secretKeyRef:
key: STEAMGRIDDB_API_KEY
name: {{ .Release.Name }}-config
ports:
- name: http
containerPort: 80
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: data
mountPath: /romm
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
volumes:
{{- if gt (len .Values.extraVolumes) 0 }}
{{- toYaml .Values.extraVolumes | nindent 8 }}
{{- end }}
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
- name: data
persistentVolumeClaim:
{{- with .Values.persistence.existingClaim }}
claimName: {{ tpl . $ }}
{{- end }}
{{- else if not .Values.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
- name: data
persistentVolumeClaim:
claimName: {{ include "romm.fullname" . }}-pvc
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := .Release.Name -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: 80
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,28 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: {{ .Values.namespace }}
name: {{ include "romm.fullname" . }}-pvc
{{- with .Values.persistence.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- with .Values.persistence.labels }}
labels:
{{- range $key, $value := . }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
spec:
accessModes:
{{- range .Values.persistence.accessModes }}
- {{ . | quote }}
{{- end }}
{{- include "romm.persistence.storageClass" . | indent 8 }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end }}

View File

@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-config
namespace: {{ .Values.namespace }}
data:
{{- toYaml .Values.romm.env | nindent 2 }}

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
namespace: {{ .Values.namespace }}
labels:
app: {{ .Release.Name }}
spec:
ports:
- port: 80
selector:
app: {{ .Release.Name }}

View File

@ -0,0 +1,97 @@
# Default values for homebox.
# This is a YAML-formatted file.
# Namespace to use.
namespace: romm
# Replica's to Deploy.
replicaCount: 1
# Image to use.
www:
image: zurdi15/romm
pullPolicy: Always
tag: "v1.8.4"
# Overrides.
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
romm:
env:
CLIENT_ID
CLIENT_SECRET
STEAMGRIDDB_API_KEY
ingress:
enabled: true
className: "nginx"
tls:
- secretName: romm-domain-tls
hosts:
- romm.example.com
hosts:
- host: romm.example.com
paths:
- path: /
pathType: Prefix
persistence:
enabled: true
existingClaim:
size: 10Gi
accessModes:
- ReadWriteOnce
labels: {}
annotations: {}
storageClass:
subPath:
extraVolumes: []
extraContainerVolumeMounts: []
## MariaDB chart configuration
## https://github.com/bitnami/charts/blob/main/bitnami/mariadb/values.yaml
##
mariadb:
enabled: true
primary:
persistence:
enabled: true
storageClass: ""
accessModes:
- ReadWriteOnce
size: 8Gi
## Use an existing PVC
##
existingClaim: ""
auth:
username: "dmarc"
password: "password"
database: dmarc
## External database configuration
##
externalDatabase:
## @param externalDatabase.existingSecret Name of the database existing Secret Object
## NOTE: When it's set, the `externalDatabase.password` parameter is ignored
##
existingSecret: ""
## @param externalDatabase.host Host of the existing database
##
host: ""
## @param externalDatabase.port Port of the existing database
##
port: 3306
## @param externalDatabase.user Existing username in the external db
##
user: dmarc
## @param externalDatabase.password Password for the above username
##
password: ""
## @param externalDatabase.database Name of the existing database
##
database: dmarc