Skip to content
Snippets Groups Projects
Verified Commit 9bb6cd6d authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

feat: add jellyfin chart

parent 4f5331f7
Branches
No related tags found
No related merge requests found
Pipeline #2777 passed
apiVersion: v2
name: jellyfin
description: Helm Chart for Jellyfin
type: application
version: 1.0.0
appVersion: "10.7.7"
lint-jellyfin:
stage: lint
script:
- helm lint jellyfin
release-jellyfin:
stage: release
script:
- apk add --no-cache git
- helm plugin install https://github.com/chartmuseum/helm-push.git
- helm repo add --username gitlab-ci-token --password $CI_JOB_TOKEN repo ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/stable
- helm cm-push jellyfin repo
{{/*
Expand the name of the chart.
*/}}
{{- define "jellyfin-helm.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 "jellyfin-helm.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 "jellyfin-helm.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "jellyfin-helm.labels" -}}
helm.sh/chart: {{ include "jellyfin-helm.chart" . }}
{{ include "jellyfin-helm.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "jellyfin-helm.selectorLabels" -}}
app.kubernetes.io/name: {{ include "jellyfin-helm.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "jellyfin-helm.sslPath" -}}
/certs
{{- end }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "jellyfin-helm.fullname" . }}
labels:
{{- include "jellyfin-helm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "jellyfin-helm.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "jellyfin-helm.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: config
{{- toYaml .Values.volumes.config | nindent 10 }}
- name: data
{{- toYaml .Values.volumes.data | nindent 10 }}
- name: media
{{- toYaml .Values.volumes.media | nindent 10 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8096
protocol: TCP
startupProbe:
httpGet:
path: /
port: metrics
livenessProbe:
httpGet:
path: /
port: metrics
readinessProbe:
httpGet:
path: /
port: metrics
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /config
name: config
- mountPath: /config/data
name: data
- mountPath: /media
name: media
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "jellyfin-helm.fullname" . }}-antispam
labels:
{{- include "jellyfin-helm.labels" . | nindent 4 }}
component: antispam
annotations:
{{- .Values.ingress.annotations | toYaml | nindent 4 }}
spec:
rules:
- host: "{{ .Values.ingress.host }}"
http:
paths:
- path: "{{ .Values.ingress.path }}"
backend:
service:
name: {{ include "jellyfin-helm.fullname" . }}
port:
name: http
pathType: Prefix
apiVersion: v1
kind: Service
metadata:
name: {{ include "jellyfin-helm.fullname" . }}
labels:
{{- include "jellyfin-helm.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
{{- include "jellyfin-helm.selectorLabels" . | nindent 4 }}
replicaCount: 1
image:
repository: jellyfin/jellyfin
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: [ ]
nameOverride: ""
fullnameOverride: ""
service:
type: ClusterIP
ingress:
host: "example.com"
path: "/"
annotations: {}
volumes:
data: |-
emptyDir: {}
config: |-
emptyDir: {}
media: |-
emptyDir: {}
podAnnotations: { }
podSecurityContext:
fsGroup: 2000
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
resources:
limits:
cpu: "2"
memory: 2Gi
requests:
cpu: 400Mi
memory: 512Mi
nodeSelector: { }
tolerations: [ ]
affinity: { }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment