diff --git a/nextcloud-linode/.helmignore b/nextcloud-linode/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/nextcloud-linode/.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/nextcloud-linode/Chart.lock b/nextcloud-linode/Chart.lock new file mode 100644 index 0000000..f7629e9 --- /dev/null +++ b/nextcloud-linode/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: nextcloud + repository: https://nextcloud.github.io/helm/ + version: 6.1.1 +digest: sha256:7057ec0c1f4a92a850c29ffa87725bbe1d503af867970c42e17e3ecbbc1fd118 +generated: "2024-10-21T22:36:15.165743497+01:00" diff --git a/nextcloud-linode/Chart.yaml b/nextcloud-linode/Chart.yaml new file mode 100644 index 0000000..170f826 --- /dev/null +++ b/nextcloud-linode/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: nextcloud-linode +description: Deploying nextcloud's helm chart on linode k8s +type: application +version: 0.1.0 +appVersion: "30.1" +dependencies: + - name: nextcloud + version: ~6.1 + repository: "https://nextcloud.github.io/helm/" diff --git a/nextcloud-linode/charts/nextcloud-6.1.1.tgz b/nextcloud-linode/charts/nextcloud-6.1.1.tgz new file mode 100644 index 0000000..441d09d Binary files /dev/null and b/nextcloud-linode/charts/nextcloud-6.1.1.tgz differ diff --git a/nextcloud-linode/templates/_helpers.tpl b/nextcloud-linode/templates/_helpers.tpl new file mode 100644 index 0000000..7851a38 --- /dev/null +++ b/nextcloud-linode/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "nextcloud-linode.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 "nextcloud-linode.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 "nextcloud-linode.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "nextcloud-linode.labels" -}} +helm.sh/chart: {{ include "nextcloud-linode.chart" . }} +{{ include "nextcloud-linode.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "nextcloud-linode.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nextcloud-linode.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "nextcloud-linode.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "nextcloud-linode.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/nextcloud-linode/templates/db-cluster.yaml b/nextcloud-linode/templates/db-cluster.yaml new file mode 100644 index 0000000..1af3fb9 --- /dev/null +++ b/nextcloud-linode/templates/db-cluster.yaml @@ -0,0 +1,8 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: nextcloud-db +spec: + instances: 3 + storage: + size: 4Gi diff --git a/nextcloud-linode/templates/secret.yaml b/nextcloud-linode/templates/secret.yaml new file mode 100644 index 0000000..c1d0e6e --- /dev/null +++ b/nextcloud-linode/templates/secret.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Secret +metadata: + name: nextcloud-config +type: Opaque +data: + nc-admin-username: {{ printf "%s" .Values.initialNextcloudAdminUsername | b64enc }} + nc-admin-password: {{ printf "%s" .Values.initialNextcloudAdminPassword | b64enc }} diff --git a/nextcloud-linode/templates/ts-ingress.yaml b/nextcloud-linode/templates/ts-ingress.yaml new file mode 100644 index 0000000..00f5f30 --- /dev/null +++ b/nextcloud-linode/templates/ts-ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: ts-nextcloud + annotations: + tailscale.com/funnel: "false" +spec: + defaultBackend: + service: + name: {{ .Release.Name }} + port: + number: 8080 + ingressClassName: tailscale + tls: + - hosts: + - "{{ .Values.tailscaleHostName }}" diff --git a/nextcloud-linode/values.yaml b/nextcloud-linode/values.yaml new file mode 100644 index 0000000..7cf4be8 --- /dev/null +++ b/nextcloud-linode/values.yaml @@ -0,0 +1,36 @@ +tailscaleHostName: +initialNextcloudAdminUsername: +initialNextcloudAdminPassword: + +nextcloud: + nextcloud: + host: + existingSecret: + enabled: true + secretName: nextcloud-config + usernameKey: nc-admin-username + passwordKey: nc-admin-password + redis: + enabled: true + auth: + enabled: false + cronjob: + enabled: true + internalDatabase: + enabled: false + externalDatabase: + enabled: true + type: postgresql + existingSecret: + enabled: true + secretName: nextcloud-db-app + usernameKey: user + passwordKey: password + databaseKey: dbname + hostKey: host + persistence: + enabled: true + size: 8Gi + nextcloudData: + enabled: true + size: 8Gi