initialize heimdall

This commit is contained in:
2025-08-23 10:35:48 +02:00
commit d335eabf4f
9 changed files with 270 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
name: Publish Helm Chart
on:
workflow_dispatch:
jobs:
call-helm-ci:
uses: helm/common-workflows/.gitea/workflows/release.yaml@master
secrets:
CI_BOT_USERNAME: ${{ secrets.CI_BOT_USERNAME }}
CI_BOT_TOKEN: ${{ secrets.CI_BOT_TOKEN }}

94
README.md Normal file
View File

@@ -0,0 +1,94 @@
# Heimdall
## Basic stuff
### Install
```shell
helm install heimdall ./helm --namespace heimdall --create-namespace
```
### Update
```shell
helm -n heimdall upgrade heimdall .\helm\
```
### Check
```shell
kubectl -n heimdall get cm,pvc,pod,svc
```
### Tail Log
```shell
kubectl -n heimdall logs -f heimdall-0
```
### Delete
```shell
kubectl delete ns heimdall
```
## Immigration
We need to find the location for the files
### Step 1
```shell
kubectl -n heimdall get pvc data-heimdall-0 -o wide
```
Output:
```
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE VOLUMEMODE
data-heimdall-0 Bound pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040 1Gi RWO microk8s-hostpath <unset> 1m Filesystem
```
we need the volume name in this case `pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040`
### Step 2
```shell
kubectl get pv pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040 -o yaml
```
Output:
```
apiVersion: v1
kind: PersistentVolume
metadata:
...
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 1Gi
claimRef:
...
hostPath:
path: /var/snap/microk8s/common/default-storage/heimdall-data-heimdall-0-pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040
type: DirectoryOrCreate
nodeAffinity:
...
persistentVolumeReclaimPolicy: Delete
storageClassName: microk8s-hostpath
volumeMode: Filesystem
status:
...
```
We need `spec -> hostPath -> path` in this case `/var/snap/microk8s/common/default-storage/heimdall-data-heimdall-0-pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040`
### Step 2
Login to the old server. and use rsync, don't forget stuff like puid, pgid, file access and stuff.
```shell
rsync -avz -e ssh ./ username@0.0.0.0:/var/snap/microk8s/common/default-storage/heimdall-data-heimdall-0-pvc-b84dce5e-bc04-456c-83c1-6f6f5f326040
```

23
helm/.helmignore Normal file
View File

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

6
helm/Chart.yaml Normal file
View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: heimdall
description: A Helm chart for Heimdall (linuxserver/heimdall)
type: application
version: 0.1.0
appVersion: "2.7.4"

View File

@@ -0,0 +1,7 @@
{{ define "heimdall.name" -}}
{{ .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{ define "heimdall.environment" -}}
{{ printf "environment-%s" .Chart.Name | trunc 51 | trimSuffix "-" }}
{{- end }}

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "heimdall.environment" . }}
data:
PGID: {{ .Values.environment.PGID | quote }}
PUID: {{ .Values.environment.PUID | quote }}
TZ: {{ .Values.environment.TIME_ZONE | quote }}
ALLOW_INTERNAL_REQUESTS: {{ .Values.environment.ALLOW_INTERNAL_REQUESTS | quote }}

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "heimdall.name" . }}
labels:
app: {{ include "heimdall.name" . }}
spec:
type: {{ .Values.service.type }}
{{- if and .Values.service.loadBalancerIP (ne .Values.service.loadBalancerIP "") }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
selector:
app: {{ include "heimdall.name" . }}
ports:
- name: http
port: {{ .Values.service.portHttp }}
targetPort: 80
- name: https
port: {{ .Values.service.portHttps }}
targetPort: 443

View File

@@ -0,0 +1,64 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "heimdall.name" . }}
labels:
app: {{ include "heimdall.name" . }}
spec:
serviceName: {{ include "heimdall.name" . }}
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "heimdall.name" . }}
template:
metadata:
labels:
app: {{ include "heimdall.name" . }}
spec:
containers:
- name: heimdall
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "heimdall.environment" . }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
volumeMounts:
- name: data
mountPath: /config
{{- if .Values.resources }}
resources:
{{- if .Values.resources.requests }}
requests:
{{- if .Values.resources.requests.cpu }}
cpu: "{{ .Values.resources.requests.cpu }}"
{{- end }}
{{- if .Values.resources.requests.memory }}
memory: "{{ .Values.resources.requests.memory }}"
{{- end }}
{{- end }}
{{- if .Values.resources.limits }}
limits:
{{- if .Values.resources.limits.cpu }}
cpu: "{{ .Values.resources.limits.cpu }}"
{{- end }}
{{- if .Values.resources.limits.memory }}
memory: "{{ .Values.resources.limits.memory }}"
{{- end }}
{{- end }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: {{ .Values.persistence.accessModes }}
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- if and .Values.persistence.storageClass (ne .Values.persistence.storageClass "") }}
storageClassName: {{ .Values.persistence.storageClass | quote }}
{{- end }}

36
helm/values.yaml Normal file
View File

@@ -0,0 +1,36 @@
replicaCount: 1
image:
repository: lscr.io/linuxserver/heimdall
tag: 2.7.4
pullPolicy: IfNotPresent
service:
type: ClusterIP
portHttp: 80
portHttps: 443
persistence:
enabled: true
size: 1Gi
storageClass:
accessModes:
- ReadWriteOnce
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "250m"
memory: "256Mi"
nodeSelector: {}
tolerations: []
affinity: []
environment:
PGID: 1000
PUID: 1000
ALLOW_INTERNAL_REQUESTS: false
TIME_ZONE: "Etc/UTC"