From 8a41270190bbef0d7d0ef2fda2765c1cbd36944f Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 27 Jul 2020 15:01:34 -0400 Subject: [PATCH] helmify --- helm/.helmignore | 23 +++++++++++ helm/Chart.yaml | 23 +++++++++++ helm/templates/deploy.yaml | 43 ++++++++++++++++++++ helm/templates/ingress.yaml | 79 +++++++++++++++++++++++++++++++++++++ helm/templates/pvc.yaml | 41 +++++++++++++++++++ helm/templates/service.yaml | 10 +++++ helm/values.yaml | 0 7 files changed, 219 insertions(+) create mode 100644 helm/.helmignore create mode 100644 helm/Chart.yaml create mode 100644 helm/templates/deploy.yaml create mode 100644 helm/templates/ingress.yaml create mode 100644 helm/templates/pvc.yaml create mode 100644 helm/templates/service.yaml create mode 100644 helm/values.yaml diff --git a/helm/.helmignore b/helm/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/helm/.helmignore @@ -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/ diff --git a/helm/Chart.yaml b/helm/Chart.yaml new file mode 100644 index 0000000..cf7bc40 --- /dev/null +++ b/helm/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: helm +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 1.16.0 diff --git a/helm/templates/deploy.yaml b/helm/templates/deploy.yaml new file mode 100644 index 0000000..65163f6 --- /dev/null +++ b/helm/templates/deploy.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} +spec: + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Release.Name }} + image: jellyfin/jellyfin:latest + volumeMounts: + - mountPath: /media + name: media + - mountPath: /config + name: config + - mountPath: /cache + name: cache + resources: + limits: + memory: "4Gi" + cpu: "4" + requests: + memory: "100Mi" + cpu: "1m" + ports: + - containerPort: 8096 + - containerPort: 8920 + volumes: + - name: media + persistentVolumeClaim: + claimName: media-{{ .Release.Name }} + - name: config + persistentVolumeClaim: + claimName: config-{{ .Release.Name }} + - name: cache + persistentVolumeClaim: + claimName: cache-{{ .Release.Name }} \ No newline at end of file diff --git a/helm/templates/ingress.yaml b/helm/templates/ingress.yaml new file mode 100644 index 0000000..ade9c86 --- /dev/null +++ b/helm/templates/ingress.yaml @@ -0,0 +1,79 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-internal-tls + annotations: + kubernetes.io/ingress.class: traefik-internal +spec: + entryPoints: + - websecure + tls: + certResolver: myresolver + domains: + - main: "*.ducoterra.net" + routes: + - match: Host(`jellyfin.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: 8096 + +--- + +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-internal-web + annotations: + kubernetes.io/ingress.class: traefik-internal +spec: + entryPoints: + - web + routes: + - match: Host(`jellyfin.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: 8096 + middlewares: + - name: httpsredirect + +--- + +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-external-tls + annotations: + kubernetes.io/ingress.class: traefik-external +spec: + entryPoints: + - websecure + tls: + certResolver: myresolver + routes: + - match: Host(`jellyfin.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: 8096 + +--- + +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: {{ .Release.Name }}-external-web + annotations: + kubernetes.io/ingress.class: traefik-external +spec: + entryPoints: + - web + routes: + - match: Host(`jellyfin.ducoterra.net`) + kind: Rule + services: + - name: {{ .Release.Name }} + port: 8096 + middlewares: + - name: httpsredirect \ No newline at end of file diff --git a/helm/templates/pvc.yaml b/helm/templates/pvc.yaml new file mode 100644 index 0000000..3a09440 --- /dev/null +++ b/helm/templates/pvc.yaml @@ -0,0 +1,41 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: media-{{ .Release.Name }} + annotations: + "helm.sh/resource-policy": keep +spec: + storageClassName: hdd + accessModes: + - ReadWriteMany + resources: + requests: + storage: 512Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: cache-{{ .Release.Name }} + annotations: + "helm.sh/resource-policy": keep +spec: + storageClassName: nvme + accessModes: + - ReadWriteMany + resources: + requests: + storage: 32Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: config-{{ .Release.Name }} + annotations: + "helm.sh/resource-policy": keep +spec: + storageClassName: nvme + accessModes: + - ReadWriteMany + resources: + requests: + storage: 32Gi \ No newline at end of file diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml new file mode 100644 index 0000000..9c12b8a --- /dev/null +++ b/helm/templates/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} +spec: + selector: + app: {{ .Release.Name }} + ports: + - port: 8096 + targetPort: 8096 \ No newline at end of file diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..e69de29