mirror of
https://github.com/truenas/charts.git
synced 2026-11-14 06:48:09 +00:00
Update nextcloud chart version
This commit is contained in:
1 parent
4b1570fc58
commit
68044d4835
22 files changed
+1
-1
No files matched your search
@@ -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
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v2
|
||||
name: nextcloud
|
||||
version: 1.1.0
|
||||
appVersion: 19.0.3
|
||||
description: A file sharing server that puts the control and security of your own data back into your hands.
|
||||
keywords:
|
||||
- nextcloud
|
||||
- storage
|
||||
- http
|
||||
- web
|
||||
- php
|
||||
home: https://nextcloud.com/
|
||||
icon: https://cdn.rawgit.com/docker-library/docs/defa5ffc7123177acd60ddef6e16bddf694cc35f/nextcloud/logo.svg
|
||||
sources:
|
||||
- https://github.com/nextcloud/docker
|
||||
- https://github.com/nextcloud/helm
|
||||
upstream_version: 2.3.2
|
||||
@@ -0,0 +1,11 @@
|
||||
# nextcloud
|
||||
|
||||
[nextcloud](https://nextcloud.com/) is a file sharing server that puts the control and security of your own data back into your hands.
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps an [nextcloud](https://hub.docker.com/_/nextcloud/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
## Configuration
|
||||
|
||||
Please refer to questions.yaml for a detailed overview on supported configurable values.
|
||||
@@ -0,0 +1,3 @@
|
||||
# nextcloud
|
||||
|
||||
[nextcloud](https://nextcloud.com/) is a file sharing server that puts the control and security of your own data back into your hands.
|
||||
@@ -0,0 +1,198 @@
|
||||
groups:
|
||||
- name: "Container Images"
|
||||
description: "Image to be used for container"
|
||||
- name: "Nextcloud Configuration"
|
||||
description: "Configuration details for Nextcloud workload"
|
||||
- name: "Storage"
|
||||
description: "Configure Storage for Nextcloud"
|
||||
- name: "Container Configuration"
|
||||
description: "Configure nextcloud container parameters"
|
||||
- name: "Postgresql Configuration"
|
||||
description: "Configure Postgresql for nextcloud"
|
||||
|
||||
portals:
|
||||
web_portal:
|
||||
protocols:
|
||||
- "http"
|
||||
host:
|
||||
- "$variable-nextcloud.host"
|
||||
ports:
|
||||
- "$variable-service.nodePort"
|
||||
|
||||
questions:
|
||||
# Image related
|
||||
- variable: image
|
||||
description: "Docker Image Details"
|
||||
label: "Docker Image"
|
||||
group: "Container Images"
|
||||
schema:
|
||||
type: dict
|
||||
required: true
|
||||
attrs:
|
||||
- variable: repository
|
||||
description: "Docker image repository"
|
||||
label: "Image repository"
|
||||
schema:
|
||||
type: string
|
||||
default: "nextcloud"
|
||||
required: true
|
||||
- variable: tag
|
||||
description: "Tag to use for specified image"
|
||||
label: "Image Tag"
|
||||
schema:
|
||||
type: string
|
||||
default: "latest"
|
||||
- variable: pullPolicy
|
||||
description: "Docker Image Pull Policy"
|
||||
label: "Image Pull Policy"
|
||||
schema:
|
||||
type: string
|
||||
default: "IfNotPresent"
|
||||
enum:
|
||||
- value: "IfNotPresent"
|
||||
description: "Only pull image if not present on host"
|
||||
- value: "Always"
|
||||
description: "Always pull image even if present on host"
|
||||
- value: "Never"
|
||||
description: "Never pull image even if it's not present on host"
|
||||
|
||||
- variable: nextcloud
|
||||
description: "Nextcloud configuration details"
|
||||
label: "Nextcloud Configuration"
|
||||
group: "Nextcloud Configuration"
|
||||
schema:
|
||||
type: dict
|
||||
required: true
|
||||
additional_attrs: true
|
||||
attrs:
|
||||
- variable: host
|
||||
description: "Nextcloud host to create application URLs"
|
||||
label: "Nextcloud host"
|
||||
schema:
|
||||
type: string
|
||||
$ref:
|
||||
- "definitions/nodeIP"
|
||||
- variable: username
|
||||
label: "Username"
|
||||
schema:
|
||||
type: string
|
||||
default: "admin"
|
||||
required: true
|
||||
- variable: password
|
||||
label: "Password"
|
||||
schema:
|
||||
type: string
|
||||
private: true
|
||||
default: "changeme"
|
||||
required: true
|
||||
- variable: datadir
|
||||
label: "Nextcloud data directory"
|
||||
schema:
|
||||
type: path
|
||||
default: "/var/www/html/data"
|
||||
required: true
|
||||
- variable: strategy
|
||||
label: "Nextcloud update strategy"
|
||||
schema:
|
||||
type: string
|
||||
default: "Recreate"
|
||||
enum:
|
||||
- value: "RollingUpdate"
|
||||
description: "Create new pods and then kill old ones"
|
||||
- value: "Recreate"
|
||||
description: "Kill existing pods before creating new ones"
|
||||
|
||||
- variable: service
|
||||
description: "Nextcloud Service Configuration"
|
||||
label: "Nextcloud Service Configuration"
|
||||
group: "Nextcloud Configuration"
|
||||
schema:
|
||||
type: dict
|
||||
required: true
|
||||
attrs:
|
||||
- variable: nodePort
|
||||
label: "Node Port to use for Nextcloud"
|
||||
schema:
|
||||
type: int
|
||||
min: 9000
|
||||
max: 65535
|
||||
default: 9001
|
||||
required: true
|
||||
|
||||
- variable: nextcloudDataHostPathEnabled
|
||||
label: "Configure Host Path for Nextcloud data"
|
||||
group: "Storage"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: nextcloudHostPath
|
||||
label: "Specify HostPath for Nextcloud data"
|
||||
schema:
|
||||
type: hostpath
|
||||
|
||||
- variable: nextcloudDataVolume
|
||||
label: "Configure iXVolume"
|
||||
group: "Storage"
|
||||
schema:
|
||||
type: dict
|
||||
$ref:
|
||||
- "normalize/ixVolume"
|
||||
show_if: [["nextcloudDataHostPathEnabled", "=", false]]
|
||||
attrs:
|
||||
- variable: mountPath
|
||||
label: "Mount Path"
|
||||
description: "Path where the volume will be mounted inside the pod"
|
||||
schema:
|
||||
type: path
|
||||
editable: false
|
||||
default: "/var/www"
|
||||
- variable: datasetName
|
||||
label: "Dataset Name"
|
||||
schema:
|
||||
type: string
|
||||
default: "ix-nextcloud_data"
|
||||
editable: false
|
||||
|
||||
- variable: postgresBackupVolume
|
||||
label: "Postgres Backup Volume"
|
||||
group: "Storage"
|
||||
schema:
|
||||
type: dict
|
||||
$ref:
|
||||
- "normalize/ixVolume"
|
||||
attrs:
|
||||
- variable: mountPath
|
||||
label: "Mount Path"
|
||||
schema:
|
||||
type: path
|
||||
editable: false
|
||||
default: "/postgres_backups"
|
||||
- variable: datasetName
|
||||
label: "Dataset Name"
|
||||
schema:
|
||||
type: string
|
||||
default: "ix-postgres_backups"
|
||||
editable: false
|
||||
|
||||
- variable: postgresDataVolume
|
||||
label: "Postgresql Data Volume"
|
||||
group: "Storage"
|
||||
schema:
|
||||
type: dict
|
||||
$ref:
|
||||
- "normalize/ixVolume"
|
||||
attrs:
|
||||
- variable: mountPath
|
||||
label: "Mount Path"
|
||||
schema:
|
||||
type: path
|
||||
editable: false
|
||||
default: "/var/lib/postgresql/data"
|
||||
- variable: datasetName
|
||||
label: "Dataset Name"
|
||||
schema:
|
||||
type: string
|
||||
default: "ix-postgres_data"
|
||||
editable: false
|
||||
@@ -0,0 +1,3 @@
|
||||
1. Get the nextcloud URL by running:
|
||||
|
||||
echo http://{{ .Values.nextcloud.host }}:{{ .Values.service.nodePort }}/
|
||||
Whitespace-only changes.
@@ -0,0 +1,114 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "nextcloud.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.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 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).
|
||||
*/}}
|
||||
{{- define "nextcloud.mariadb.fullname" -}}
|
||||
{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified redis app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "nextcloud.redis.fullname" -}}
|
||||
{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "nextcloud.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Retrieve host path from ix volumes based on dataset name
|
||||
*/}}
|
||||
{{- define "retrieveHostPathFromiXVolume" -}}
|
||||
{{- range $index, $hostPathConfiguration := $.ixVolumes }}
|
||||
{{- $dsName := base $hostPathConfiguration.hostPath -}}
|
||||
{{- if eq $.datasetName $dsName -}}
|
||||
{{- $hostPathConfiguration.hostPath -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Retrieve host path defined in volume
|
||||
*/}}
|
||||
{{- define "configuredHostPath" -}}
|
||||
{{- if .Values.emptyDirVolumes -}}
|
||||
{{- printf "" -}}
|
||||
{{- else if .Values.nextcloudDataHostPathEnabled -}}
|
||||
{{- required "Please specify a host path for nextcloud" .Values.nextcloudHostPath -}}
|
||||
{{- else -}}
|
||||
{{- $volDict := dict "datasetName" $.Values.nextcloudDataVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
|
||||
{{- include "retrieveHostPathFromiXVolume" $volDict -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Retrieve backup postgresql host path defined in volume
|
||||
*/}}
|
||||
{{- define "configuredBackupPostgresHostPath" -}}
|
||||
{{- if .Values.emptyDirVolumes -}}
|
||||
{{- printf "" -}}
|
||||
{{- else -}}
|
||||
{{- $volDict := dict "datasetName" $.Values.postgresBackupVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
|
||||
{{- include "retrieveHostPathFromiXVolume" $volDict -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Retrieve postgresql data host path defined in volume
|
||||
*/}}
|
||||
{{- define "configuredPostgresHostPath" -}}
|
||||
{{- if .Values.emptyDirVolumes -}}
|
||||
{{- printf "" -}}
|
||||
{{- else -}}
|
||||
{{- $volDict := dict "datasetName" $.Values.postgresDataVolume.datasetName "ixVolumes" $.Values.ixVolumes -}}
|
||||
{{- include "retrieveHostPathFromiXVolume" $volDict -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "nextcloud.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Nextcloud service account
|
||||
*/}}
|
||||
{{- define "nextcloud.serviceAccountName" -}}
|
||||
{{- printf "%s-service-account" .Release.Name -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,24 @@
|
||||
{{/*
|
||||
Get Nextloud Postgres Database Name
|
||||
*/}}
|
||||
{{- define "postgres.DatabaseName" -}}
|
||||
{{- print "nextcloud" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Postgres Selector labels
|
||||
*/}}
|
||||
{{- define "nextcloud.postgres.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}-postgres
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}-postgres
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Retrieve postgres backup name
|
||||
This will return a unique name based on revision and chart numbers specified.
|
||||
*/}}
|
||||
{{- define "postgres.backupName" -}}
|
||||
{{- $upgradeDict := .Values.ixChartContext.upgradeMetadata -}}
|
||||
{{- printf "postgres-backup-from-%s-to-%s-revision-%d" $upgradeDict.oldChartVersion $upgradeDict.newChartVersion (int64 $upgradeDict.preUpgradeRevision) -}}
|
||||
{{- end }}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{{/*
|
||||
Retrieve previous chart version from which we are upgrading to a newer chart version
|
||||
*/}}
|
||||
{{- define "tn.chart.old_version" -}}
|
||||
{{- if .Values.ixChartContext.is_upgrade -}}
|
||||
{{- .Values.ixChartContext.upgradeMetadata.oldChartVersion -}}
|
||||
{{- else -}}
|
||||
{{- fail "A chart upgrade is not taking place" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Retrieve new chart version to which we are upgrading from an old chart version
|
||||
*/}}
|
||||
{{- define "tn.chart.new_version" -}}
|
||||
{{- if .Values.ixChartContext.is_upgrade -}}
|
||||
{{- .Values.ixChartContext.upgradeMetadata.newChartVersion -}}
|
||||
{{- else -}}
|
||||
{{- fail "A chart upgrade is not taking place" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "postgres-backup-hook-config-map"
|
||||
annotations:
|
||||
rollme: {{ randAlphaNum 5 | quote }}
|
||||
data:
|
||||
entrypoint.sh: |-
|
||||
#!/bin/sh
|
||||
cmd="/docker-entrypoint.sh postgres"
|
||||
eval "${cmd}" & disown;
|
||||
until pg_isready; do
|
||||
sleep 5;
|
||||
done;
|
||||
pg_dump -U $POSTGRES_USER -d {{ template "postgres.DatabaseName" . }} > /postgres_backups/$BACKUP_NAME;
|
||||
@@ -0,0 +1,57 @@
|
||||
{{- if .Values.ixChartContext.isUpgrade -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: "pre-upgrade-hook2"
|
||||
annotations:
|
||||
"helm.sh/hook": pre-upgrade
|
||||
"helm.sh/hook-weight": "1"
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
rollme: {{ randAlphaNum 5 | quote }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: "pre-upgrade-hook2"
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
serviceAccountName: "{{ template "nextcloud.serviceAccountName" . }}"
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-postgres-backup
|
||||
image: "postgres:13.1"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-details
|
||||
key: db-user
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-details
|
||||
key: db-password
|
||||
- name: BACKUP_NAME
|
||||
value: {{ template "postgres.backupName" . }}
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: postgres-backup
|
||||
mountPath: /postgres_backups
|
||||
- name: backup-script-configmap
|
||||
mountPath: /bin/backup_entrypoint.sh
|
||||
readOnly: true
|
||||
subPath: entrypoint.sh
|
||||
command:
|
||||
- "/bin/backup_entrypoint.sh"
|
||||
volumes:
|
||||
- name: postgres-data
|
||||
hostPath:
|
||||
path: {{ template "configuredPostgresHostPath" . }}
|
||||
- name: postgres-backup
|
||||
hostPath:
|
||||
path: {{ template "configuredBackupPostgresHostPath" . }}
|
||||
- name: backup-script-configmap
|
||||
configMap:
|
||||
defaultMode: 0700
|
||||
name: "postgres-backup-hook-config-map"
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,113 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "nextcloud.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
||||
helm.sh/chart: {{ include "nextcloud.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/component: app
|
||||
{{- if .Values.deploymentAnnotations }}
|
||||
annotations:
|
||||
{{ toYaml .Values.deploymentAnnotations | indent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: {{ .Values.nextcloud.strategy }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/component: app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/component: app
|
||||
annotations:
|
||||
rollme: {{ randAlphaNum 5 | quote }}
|
||||
spec:
|
||||
{{- if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: init-postgresdb
|
||||
image: busybox:latest
|
||||
command: ['sh', '-c', "until nc -w 5 -vz {{ template "nextcloud.fullname" . }}-postgres 5432; do echo waiting for postgres; sleep 2; done"]
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
env:
|
||||
- name: POSTGRES_HOST
|
||||
value: {{ template "nextcloud.fullname" . }}-postgres:5432
|
||||
- name: POSTGRES_DB
|
||||
value: {{ template "postgres.DatabaseName" . }}
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-details
|
||||
key: db-user
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-details
|
||||
key: db-password
|
||||
- name: NEXTCLOUD_ADMIN_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "nextcloud.fullname" . }}
|
||||
key: nextcloud-username
|
||||
- name: NEXTCLOUD_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "nextcloud.fullname" . }}
|
||||
key: nextcloud-password
|
||||
- name: NEXTCLOUD_TRUSTED_DOMAINS
|
||||
value: {{ .Values.nextcloud.host }}
|
||||
- name: NEXTCLOUD_DATA_DIR
|
||||
value: {{ .Values.nextcloud.datadir | quote }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- name: nextcloud-data
|
||||
mountPath: /var/www/
|
||||
subPath: "root"
|
||||
- name: nextcloud-data
|
||||
mountPath: /var/www/html
|
||||
subPath: "html"
|
||||
- name: nextcloud-data
|
||||
mountPath: {{ .Values.nextcloud.datadir }}
|
||||
subPath: "data"
|
||||
- name: nextcloud-data
|
||||
mountPath: /var/www/html/config
|
||||
subPath: "config"
|
||||
- name: nextcloud-data
|
||||
mountPath: /var/www/html/custom_apps
|
||||
subPath: "custom_apps"
|
||||
- name: nextcloud-data
|
||||
mountPath: /var/www/tmp
|
||||
subPath: "tmp"
|
||||
- name: nextcloud-data
|
||||
mountPath: /var/www/html/themes
|
||||
subPath: "themes"
|
||||
volumes:
|
||||
- name: nextcloud-data
|
||||
{{- if ne (include "configuredHostPath" .) "" }}
|
||||
hostPath:
|
||||
path: {{ template "configuredHostPath" . }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
# Will mount configuration files as www-data (id: 33) for nextcloud
|
||||
securityContext:
|
||||
fsGroup: 33
|
||||
@@ -0,0 +1,22 @@
|
||||
{{- if .Values.ixChartContext.isUpgrade -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: "pre-upgrade-hook1"
|
||||
annotations:
|
||||
"helm.sh/hook": pre-upgrade
|
||||
"helm.sh/hook-weight": "-1"
|
||||
"helm.sh/hook-delete-policy": hook-succeeded
|
||||
rollme: {{ randAlphaNum 5 | quote }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: "pre-upgrade-hook1"
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
serviceAccountName: "{{ template "nextcloud.serviceAccountName" . }}"
|
||||
containers:
|
||||
- name: kubectl
|
||||
image: "bitnami/kubectl:1.19"
|
||||
command: ["kubectl", "delete" , "deployment", "{{ template "nextcloud.fullname" . }}", "{{ template "nextcloud.fullname" . }}-postgres"]
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,64 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "nextcloud.fullname" . }}-postgres
|
||||
labels:
|
||||
helm.sh/chart: {{ include "nextcloud.chart" . }}
|
||||
{{- include "nextcloud.postgres.selectorLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: {{ .Values.nextcloud.strategy }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "nextcloud.postgres.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: database
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "nextcloud.postgres.selectorLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: database
|
||||
annotations:
|
||||
rollme: {{ randAlphaNum 5 | quote }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}-postgres
|
||||
image: "postgres:13.1"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-details
|
||||
key: db-user
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-details
|
||||
key: db-password
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: postgres-backup
|
||||
mountPath: /postgres_backups
|
||||
ports:
|
||||
- name: postgres-tcp
|
||||
containerPort: 5432
|
||||
protocol: TCP
|
||||
volumes:
|
||||
- name: postgres-data
|
||||
{{- if ne (include "configuredPostgresHostPath" .) "" }}
|
||||
hostPath:
|
||||
path: {{ template "configuredPostgresHostPath" . }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: postgres-backup
|
||||
{{- if ne (include "configuredBackupPostgresHostPath" .) "" }}
|
||||
hostPath:
|
||||
path: {{ template "configuredBackupPostgresHostPath" . }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: db-details
|
||||
data:
|
||||
db-user: postgres
|
||||
{{- if .Release.IsInstall }}
|
||||
db-password: {{ randAlphaNum 15 | b64enc | quote }}
|
||||
{{ else }}
|
||||
# `index` function is necessary because the property name contains a dash.
|
||||
# Otherwise (...).data.db_password would have worked too.
|
||||
db-password: {{ index (lookup "v1" "Secret" .Release.Namespace "db-details").data "db-password" }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "nextcloud.fullname" . }}-postgres
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}-postgres
|
||||
helm.sh/chart: {{ include "nextcloud.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/component: app
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 5432
|
||||
protocol: TCP
|
||||
name: postgres-tcp
|
||||
selector:
|
||||
{{- include "nextcloud.postgres.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "nextcloud.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
||||
helm.sh/chart: {{ include "nextcloud.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
type: Opaque
|
||||
data:
|
||||
nextcloud-username: {{ .Values.nextcloud.username | b64enc | quote }}
|
||||
{{ if .Values.nextcloud.password }}
|
||||
nextcloud-password: {{ .Values.nextcloud.password | b64enc | quote }}
|
||||
{{ else }}
|
||||
nextcloud-password: {{ randAlphaNum 10 | b64enc | quote }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "nextcloud.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
||||
helm.sh/chart: {{ include "nextcloud.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/component: app
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
nodePort: {{ default "" .Values.service.nodePort}}
|
||||
selector:
|
||||
{{- include "nextcloud.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,39 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: "{{ template "nextcloud.serviceAccountName" . }}"
|
||||
namespace: {{ .Release.Namespace }}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-service-account-role-binding"
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: "{{ template "nextcloud.serviceAccountName" . }}"
|
||||
namespace: {{ .Release.Namespace }}
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: "{{ .Release.Name }}-service-account-role"
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
---
|
||||
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-service-account-role"
|
||||
namespace: {{ .Release.Namespace }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- "apps"
|
||||
resources:
|
||||
- pods
|
||||
- deployments
|
||||
verbs:
|
||||
- delete
|
||||
- get
|
||||
- list
|
||||
@@ -0,0 +1,28 @@
|
||||
## Official nextcloud image version
|
||||
## ref: https://hub.docker.com/r/library/nextcloud/tags/
|
||||
##
|
||||
image:
|
||||
repository: nextcloud
|
||||
tag: 19.0.3-apache
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
nextcloud:
|
||||
host: nextcloud.kube.home
|
||||
username: admin
|
||||
password: changeme
|
||||
datadir: /var/www/html/data
|
||||
strategy: "Recreate"
|
||||
|
||||
postgresql:
|
||||
backupVolume:
|
||||
mountPath: "/postgres_backups"
|
||||
datasetName: "ix-postgres_backups"
|
||||
dataVolume:
|
||||
mountPath: "/var/lib/postgresql/data"
|
||||
datasetName: "ix-postgres_data"
|
||||
|
||||
service:
|
||||
nodePort: 31000
|
||||
|
||||
emptyDirVolumes: true
|
||||
ixChartContext: {}
|
||||
@@ -0,0 +1,17 @@
|
||||
## Official nextcloud image version
|
||||
## ref: https://hub.docker.com/r/library/nextcloud/tags/
|
||||
##
|
||||
image:
|
||||
repository: nextcloud
|
||||
tag: 19.0.3-apache
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
nextcloud:
|
||||
host: nextcloud.kube.home
|
||||
username: admin
|
||||
password: changeme
|
||||
datadir: /var/www/html/data
|
||||
strategy: "Recreate"
|
||||
|
||||
service:
|
||||
nodePort: 9001
|
||||
Reference in new issue
Block a user