From b149fbd85e367e7a3cb9d460c56eafd4daec9d4e Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 15 Mar 2024 02:00:46 -0600 Subject: [PATCH] add tubearchivist --- charts/tubearchivist/Chart.yaml | 15 ++++ charts/tubearchivist/README.md | 16 ++++ .../tubearchivist/templates/deployment.yaml | 82 +++++++++++++++++++ charts/tubearchivist/templates/ingress.yaml | 32 ++++++++ .../templates/persistent-volume-claim.yaml | 21 +++++ .../templates/service-account.yaml | 11 +++ charts/tubearchivist/templates/service.yaml | 22 +++++ charts/tubearchivist/values.yaml | 72 ++++++++++++++++ 8 files changed, 271 insertions(+) create mode 100644 charts/tubearchivist/Chart.yaml create mode 100644 charts/tubearchivist/README.md create mode 100644 charts/tubearchivist/templates/deployment.yaml create mode 100644 charts/tubearchivist/templates/ingress.yaml create mode 100644 charts/tubearchivist/templates/persistent-volume-claim.yaml create mode 100644 charts/tubearchivist/templates/service-account.yaml create mode 100644 charts/tubearchivist/templates/service.yaml create mode 100644 charts/tubearchivist/values.yaml diff --git a/charts/tubearchivist/Chart.yaml b/charts/tubearchivist/Chart.yaml new file mode 100644 index 0000000..cca890b --- /dev/null +++ b/charts/tubearchivist/Chart.yaml @@ -0,0 +1,15 @@ +apiVersion: v2 +name: tubearchivist +version: 0.0.1 +sources: + - https://github.com/tubearchivist/tubearchivist + - https://github.com/bitnami/charts/tree/main/bitnami/redis + - https://github.com/bitnami/charts/tree/main/bitnami/elasticsearch +dependencies: + - name: redis + version: 18.19.2 + repository: https://charts.bitnami.com/bitnami + - name: elasticsearch + version: 19.5.12 + repository: https://charts.bitnami.com/bitnami +appVersion: v0.4.6 diff --git a/charts/tubearchivist/README.md b/charts/tubearchivist/README.md new file mode 100644 index 0000000..ea2c405 --- /dev/null +++ b/charts/tubearchivist/README.md @@ -0,0 +1,16 @@ +## Introduction + +[Tube Archivist](https://github.com/tubearchivist/tubearchivist) + +Your self hosted YouTube media server + +This chart bootstraps an [Outline](https://github.com/tubearchivist/tubearchivist) deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- Kubernetes +- Helm + +## Parameters + +See the [values files](values.yaml). diff --git a/charts/tubearchivist/templates/deployment.yaml b/charts/tubearchivist/templates/deployment.yaml new file mode 100644 index 0000000..fa79d39 --- /dev/null +++ b/charts/tubearchivist/templates/deployment.yaml @@ -0,0 +1,82 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: web + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + revisionHistoryLimit: 3 + replicas: {{ .Values.deployment.replicas }} + strategy: + type: {{ .Values.deployment.strategy }} + selector: + matchLabels: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + serviceAccountName: {{ .Release.Name }} + automountServiceAccountToken: true + containers: + - name: {{ .Release.Name }} + image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" + imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.http.port }} + protocol: TCP + env: + - name: TA_PORT + value: {{ .Values.service.http.port }} + {{- range $k,$v := .Values.deployment.env }} + - name: {{ $k }} + value: {{ $v | quote }} + {{- end }} + {{- with .Values.deployment.envFrom }} + envFrom: + {{- toYaml . | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.deployment.resources | nindent 12 }} + volumeMounts: + - name: "{{ .Release.Name }}-cache" + mountPath: /cache + - name: "{{ .Release.Name }}-youtube" + mountPath: /youtube + livenessProbe: + tcpSocket: + port: {{ .Values.service.http.port }} + initialDelaySeconds: 0 + failureThreshold: 3 + timeoutSeconds: 1 + periodSeconds: 10 + readinessProbe: + tcpSocket: + port: {{ .Values.service.http.port }} + initialDelaySeconds: 0 + failureThreshold: 3 + timeoutSeconds: 1 + periodSeconds: 10 + startupProbe: + tcpSocket: + port: {{ .Values.service.http.port }} + initialDelaySeconds: 0 + failureThreshold: 30 + timeoutSeconds: 1 + periodSeconds: 5 + volumes: + - name: "{{ .Release.Name }}-cache" + persistentVolumeClaim: + claimName: "{{ .Release.Name }}-cache" + - name: "{{ .Release.Name }}-youtube" + persistentVolumeClaim: + claimName: {{ .Values.persistence.youtube.claimName }} diff --git a/charts/tubearchivist/templates/ingress.yaml b/charts/tubearchivist/templates/ingress.yaml new file mode 100644 index 0000000..39757f7 --- /dev/null +++ b/charts/tubearchivist/templates/ingress.yaml @@ -0,0 +1,32 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: web + app.kubernetes.io/part-of: {{ .Release.Name }} + annotations: + {{- toYaml .Values.ingress.annotations | nindent 4 }} +spec: + ingressClassName: {{ .Values.ingress.className }} + tls: + - hosts: + - {{ .Values.ingress.host }} + secretName: {{ .Release.Name }}-tls-secret + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ .Release.Name }} + port: + name: http +{{- end }} diff --git a/charts/tubearchivist/templates/persistent-volume-claim.yaml b/charts/tubearchivist/templates/persistent-volume-claim.yaml new file mode 100644 index 0000000..a67dd31 --- /dev/null +++ b/charts/tubearchivist/templates/persistent-volume-claim.yaml @@ -0,0 +1,21 @@ +{{- if .Values.persistence.cache.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: "{{ .Release.Name }}-cache" + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: storage + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + accessModes: + - {{ .Values.persistence.cache.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.cache.storageSize }} + storageClassName: {{ .Values.persistence.cache.storageClassName }} + volumeMode: {{ .Values.persistence.cache.volumeMode }} +{{- end }} diff --git a/charts/tubearchivist/templates/service-account.yaml b/charts/tubearchivist/templates/service-account.yaml new file mode 100644 index 0000000..a437092 --- /dev/null +++ b/charts/tubearchivist/templates/service-account.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: web + app.kubernetes.io/part-of: {{ .Release.Name }} diff --git a/charts/tubearchivist/templates/service.yaml b/charts/tubearchivist/templates/service.yaml new file mode 100644 index 0000000..aa34498 --- /dev/null +++ b/charts/tubearchivist/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: web + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + type: ClusterIP + externalTrafficPolicy: + ports: + - port: {{ .Values.service.http.port }} + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/charts/tubearchivist/values.yaml b/charts/tubearchivist/values.yaml new file mode 100644 index 0000000..d40d0cc --- /dev/null +++ b/charts/tubearchivist/values.yaml @@ -0,0 +1,72 @@ +deployment: + replicas: 1 + strategy: Recreate + image: + repository: bbilly1/tubearchivist + tag: v0.4.6 + imagePullPolicy: IfNotPresent + env: + TZ: UTC + envFrom: + resources: + requests: + memory: 512Mi + cpu: 50m + limits: + memory: 1Gi + cpu: 1000m +service: + http: + port: 8000 +ingress: + enabled: false + className: + annotations: + host: +persistence: + cache: + enabled: false + storageClassName: default + storageSize: 5Gi + accessMode: ReadWriteOnce + volumeMode: Filesystem + youtube: + claimName: +redis: + architecture: standalone + auth: + enabled: false + commonConfiguration: |- + # Enable AOF https://redis.io/topics/persistence#append-only-file + appendonly yes + # Disable RDB persistence, AOF persistence already enabled. + save "" + # Enable Redis Json module + loadmodule /opt/redis-stack/lib/rejson.so +elasticsearch: + global: + storageClass: default + extraEnvVars: + - name: "discovery.type" + value: "single-node" + - name: xpack.security.enabled + value: "true" + extraEnvVarsSecret: + extraConfig: + path: + repo: /usr/share/elasticsearch/data/snapshot + extraVolumes: + extraVolumeMounts: + - name: snapshot + mountPath: /usr/share/elasticsearch/data/snapshot + snapshotRepoPath: /usr/share/elasticsearch/data/snapshot + master: + masterOnly: false + replicaCount: 1 + data: + replicaCount: 0 + coordinating: + replicaCount: 0 + ingest: + enabled: false + replicaCount: 0