-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
286 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
name: common | ||
version: "1.0.0" | ||
kubeVersion: ">=1.23.0-0" | ||
description: The common chart | ||
appVersion: "v1" | ||
home: https://github.com/wattos/home-lab-charts | ||
maintainers: | ||
- email: [email protected] | ||
name: wattos | ||
sources: | ||
- https://github.com/wattos/home-lab-charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{/* | ||
Main entrypoint for the common library chart. It will render all underlying templates based on the provided values. | ||
*/}} | ||
{{- define "common.all" -}} | ||
|
||
{{- include "common.values.setup" . }} | ||
|
||
{{ include "common.volume" . | nindent 0 }} | ||
|
||
{{ include "common.deployment" . | nindent 0 }} | ||
|
||
{{ include "common.service" . | nindent 0 }} | ||
|
||
{{ include "common.ingress" . | nindent 0 }} | ||
|
||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{- define "common.deployment" -}} | ||
{{- if .Values.deployment.enabled -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ include "common.names.fullname" . }} | ||
replicas: {{ default 1 .Values.deployment.replicaCount | int }} | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ include "common.names.fullname" . }} | ||
spec: | ||
containers: | ||
- name: {{ include "common.names.fullname" . }} | ||
image: {{ .Values.deployment.image }} | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: {{ .Values.deployment.port | int }} | ||
env: | ||
{{- toYaml .Values.deployment.env | nindent 8 }} | ||
volumeMounts: | ||
{{- if .Values.storage.mounts.config.enabled }} | ||
- name: {{ include "common.names.name" . }}-config | ||
mountPath: /config | ||
{{- end }} | ||
{{- if .Values.storage.mounts.media.enabled }} | ||
- name: {{ include "common.names.name" . }}-media | ||
mountPath: /media | ||
{{- end }} | ||
volumes: | ||
{{- if .Values.storage.mounts.config.enabled }} | ||
- name: {{ include "common.names.name" . }}-config | ||
persistentVolumeClaim: | ||
claimName: {{ include "common.names.name" . }}-config | ||
{{- end }} | ||
{{- if .Values.storage.mounts.media.enabled }} | ||
- name: {{ include "common.names.name" . }}-media | ||
nfs: | ||
server: "{{ .Values..storage.mounts.media.volume.nfs.server }}" | ||
path: "{{ .Values..storage.mounts.media.volume.nfs.path }}" | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{{- define "common.ingress" -}} | ||
{{- if .Values.ingress.enabled -}} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
labels: | ||
app: {{ include "common.names.fullname" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
annotations: | ||
kubernetes.io/tls-acme: "true" | ||
{{- toYaml .Values.ingress.annotations | nindent 4 }} | ||
spec: | ||
rules: | ||
- host: {{ .Values.ingress.host }} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: {{ include "common.names.fullname" . }} | ||
port: | ||
number: 80 | ||
tls: | ||
- secretName: {{ include "common.names.name" . }}-cert | ||
hosts: | ||
- {{ .Values.ingress.host }} | ||
{{- end -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{- define "common.service" -}} | ||
{{- if .Values.service.enabled -}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "common.names.fullname" . }} | ||
labels: | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" | ||
spec: | ||
ports: | ||
- name: {{ include "common.names.fullname" . }} | ||
port: 80 | ||
targetPort: {{ .Values.deployment.port | int }} | ||
|
||
selector: | ||
app: {{ include "common.names.fullname" . }} | ||
|
||
{{- end -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- define "common.volume" -}} | ||
{{- if .Values.storage.mounts.config.enabled }} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ include "common.names.name" . }}-config | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClassName: "{{ .Values.storage.mounts.config.storageClassName }}" | ||
resources: | ||
requests: | ||
storage: "{{ .Values.storage.mounts.config.size }}" | ||
{{- end -}} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- define "common.names.name" -}} | ||
{{- $globalNameOverride := "" -}} | ||
{{- if hasKey .Values "global" -}} | ||
{{- $globalNameOverride = (default $globalNameOverride .Values.global.nameOverride) -}} | ||
{{- end -}} | ||
{{- default .Chart.Name (default .Values.nameOverride $globalNameOverride) | 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 "common.names.fullname" -}} | ||
{{- $name := include "common.names.name" . -}} | ||
{{- $globalFullNameOverride := "" -}} | ||
{{- if hasKey .Values "global" -}} | ||
{{- $globalFullNameOverride = (default $globalFullNameOverride .Values.global.fullnameOverride) -}} | ||
{{- end -}} | ||
{{- if or .Values.fullnameOverride $globalFullNameOverride -}} | ||
{{- $name = default .Values.fullnameOverride $globalFullNameOverride -}} | ||
{{- else -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- $name = .Release.Name -}} | ||
{{- else -}} | ||
{{- $name = printf "%s-%s" .Release.Name $name -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- trunc 63 $name | trimSuffix "-" -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{/* Merge the local chart values and the common chart defaults */}} | ||
{{- define "common.values.setup" -}} | ||
{{- if .Values.common -}} | ||
{{- $defaultValues := deepCopy .Values.common -}} | ||
{{- $userValues := deepCopy (omit .Values "common") -}} | ||
{{- $mergedValues := mustMergeOverwrite $defaultValues $userValues -}} | ||
{{- $_ := set . "Values" (deepCopy $mergedValues) -}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
deployment: | ||
enabled: true | ||
image: | ||
port: | ||
replicaCount: 1 | ||
env: [] | ||
|
||
ingress: | ||
enabled: true | ||
annotations: {} | ||
host: | ||
|
||
service: | ||
enabled: false | ||
|
||
storage: | ||
mounts: | ||
config: | ||
enabled: false | ||
storageClassName: | ||
size: 200Mi | ||
|
||
media: | ||
enabled: false | ||
volume: | ||
nfs: | ||
path: | ||
server: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 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 | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
name: sabnzbd | ||
version: "1.0.0" | ||
kubeVersion: ">=1.23.0-0" | ||
description: Helm Chart to deploy sabnzbd | ||
appVersion: "v3" | ||
home: https://github.com/wattos/home-lab-charts | ||
maintainers: | ||
- email: [email protected] | ||
name: wattos | ||
dependencies: | ||
- name: common | ||
version: "1.0.0" | ||
repository: "file://../common" | ||
sources: | ||
- https://github.com/wattos/home-lab-charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ include "common.all" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
deployment: | ||
enabled: true | ||
image: "lscr.io/linuxserver/sabnzbd:latest" | ||
port: 8080 | ||
replicaCount: 1 | ||
env: | ||
- name: PUID | ||
value: 1000 | ||
- name: PGID | ||
value: 1000 | ||
- name: TZ | ||
value: CET | ||
|
||
ingress: | ||
enabled: true | ||
annotations: {} | ||
host: | ||
|
||
service: | ||
enabled: true | ||
|
||
storage: | ||
mounts: | ||
config: | ||
enabled: true | ||
storageClassName: | ||
size: 500Mi | ||
|
||
media: | ||
enabled: true | ||
volume: | ||
nfs: | ||
path: | ||
server: | ||
|