Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

nextcloud

A file sharing server that puts the control and security of your own data back into your hands.

Version: 3.12.0 AppVersion: 34.0.1

Introduction

This chart bootstraps an nextcloud deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

  • Kubernetes 1.9+ with Beta APIs enabled
  • PV provisioner support in the underlying infrastructure
  • Helm >=3.7.0 (for subchart scope exposing)
  • Own Database Operator or alike

Requirements

RepositoryNameVersion
https://charts.bitnami.com/bitnamipostgresql14.3.3
https://charts.bitnami.com/bitnamiredis18.17.0

Installing the Chart

To install the chart with the release name my-release:

helm repo add nextcloud https://nextcloud.github.io/helm/
helm install my-release nextcloud/nextcloud

The command deploys nextcloud on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Values

KeyTypeDefaultDescription
affinityobject{}
cronjob.annotationsobject{}
cronjob.enabledboolfalse
cronjob.failedJobsHistoryLimitint5
cronjob.imageobject{}
cronjob.schedulestring"*/5 * * * *"
cronjob.successfulJobsHistoryLimitint2
deploymentAnnotationsobject{}
externalDatabase.databasestring"nextcloud"
externalDatabase.enabledboolfalse
externalDatabase.existingSecret.enabledboolfalse
externalDatabase.hoststringnil
externalDatabase.passwordstringnil
externalDatabase.typestring"mysql"
externalDatabase.userstring"nextcloud"
fullnameOverridestring""
hpa.cputhresholdint60
hpa.enabledboolfalse
hpa.maxPodsint10
hpa.minPodsint1
image.pullPolicystring"IfNotPresent"
image.repositorystring"docker.io/library/nextcloud"
ingress.annotationsobject{}
ingress.enabledboolfalse
ingress.labelsobject{}
ingress.pathstring"/"
ingress.pathTypestring"Prefix"
internalDatabase.enabledbooltrue
internalDatabase.namestring"nextcloud"
lifecycleobject{}
livenessProbe.enabledbooltrue
livenessProbe.failureThresholdint3
livenessProbe.initialDelaySecondsint10
livenessProbe.periodSecondsint10
livenessProbe.successThresholdint1
livenessProbe.timeoutSecondsint5
mariadb.architecturestring"standalone"
mariadb.auth.databasestring"nextcloud"
mariadb.auth.passwordstring"changeme"
mariadb.auth.usernamestring"nextcloud"
mariadb.enabledboolfalse
mariadb.primary.persistence.accessModestring"ReadWriteOnce"
mariadb.primary.persistence.enabledboolfalse
mariadb.primary.persistence.sizestring"8Gi"
metrics.enabledboolfalse
metrics.httpsboolfalse
metrics.image.pullPolicystring"IfNotPresent"
metrics.image.repositorystring"docker.io/xperimental/nextcloud-exporter"
metrics.image.tagstring"0.9.1"
metrics.replicaCountint1
metrics.service.annotations.“prometheus.io/port”string"9205"
metrics.service.annotations.“prometheus.io/scrape”string"true"
metrics.service.labelsobject{}
metrics.service.typestring"ClusterIP"
metrics.serviceMonitor.enabledboolfalse
metrics.serviceMonitor.intervalstring"30s"
metrics.serviceMonitor.jobLabelstring""
metrics.serviceMonitor.labelsobject{}
metrics.serviceMonitor.namespacestring""
metrics.serviceMonitor.scrapeTimeoutstring""
metrics.timeoutstring"5s"
metrics.tokenstring""
nameOverridestring""
nextcloud.configsobject{}
nextcloud.datadirstring"/var/www/html/data"
nextcloud.defaultConfigs.“.htaccess”booltrue
nextcloud.defaultConfigs.“apache-pretty-urls.config.php”booltrue
nextcloud.defaultConfigs.“apcu.config.php”booltrue
nextcloud.defaultConfigs.“apps.config.php”booltrue
nextcloud.defaultConfigs.“autoconfig.php”booltrue
nextcloud.defaultConfigs.“redis.config.php”booltrue
nextcloud.defaultConfigs.“smtp.config.php”booltrue
nextcloud.existingSecret.enabledboolfalse
nextcloud.extraEnvstringnil
nextcloud.extraInitContainerslist[]
nextcloud.extraVolumeMountsstringnil
nextcloud.extraVolumesstringnil
nextcloud.hoststring"nextcloud.kube.home"
nextcloud.mail.domainstring"domain.com"
nextcloud.mail.enabledboolfalse
nextcloud.mail.fromAddressstring"user"
nextcloud.mail.smtp.authtypestring"LOGIN"
nextcloud.mail.smtp.hoststring"domain.com"
nextcloud.mail.smtp.namestring"user"
nextcloud.mail.smtp.passwordstring"pass"
nextcloud.mail.smtp.portint465
nextcloud.mail.smtp.securestring"ssl"
nextcloud.passwordstring"changeme"
nextcloud.persistence.subPathstringnil
nextcloud.phpConfigsobject{}
nextcloud.strategy.typestring"Recreate"
nextcloud.updateint0
nextcloud.usernamestring"admin"
nginx.config.defaultbooltrue
nginx.enabledboolfalse
nginx.image.pullPolicystring"IfNotPresent"
nginx.image.repositorystring"nginx"
nginx.image.tagstring"alpine"
nginx.resourcesobject{}
nodeSelectorobject{}
persistence.accessModestring"ReadWriteOnce"
persistence.annotationsobject{}
persistence.enabledboolfalse
persistence.nextcloudData.accessModestring"ReadWriteOnce"
persistence.nextcloudData.annotationsobject{}
persistence.nextcloudData.enabledboolfalse
persistence.nextcloudData.sizestring"8Gi"
persistence.nextcloudData.subPathstringnil
persistence.sizestring"8Gi"
phpClientHttpsFix.enabledboolfalse
phpClientHttpsFix.protocolstring"https"
podAnnotationsobject{}
postgresql.enabledboolfalse
postgresql.global.postgresql.auth.databasestring"nextcloud"
postgresql.global.postgresql.auth.passwordstring"changeme"
postgresql.global.postgresql.auth.usernamestring"nextcloud"
postgresql.primary.persistence.enabledboolfalse
rbac.enabledboolfalse
rbac.serviceaccount.annotationsobject{}
rbac.serviceaccount.createbooltrue
rbac.serviceaccount.namestring"nextcloud-serviceaccount"
readinessProbe.enabledbooltrue
readinessProbe.failureThresholdint3
readinessProbe.initialDelaySecondsint10
readinessProbe.periodSecondsint10
readinessProbe.successThresholdint1
readinessProbe.timeoutSecondsint5
redis.auth.enabledbooltrue
redis.auth.passwordstring"changeme"
redis.enabledboolfalse
redis.image.repositorystring"bitnamilegacy/redis"
replicaCountint1
resourcesobject{}
runtimeClassNamestringnil
service.loadBalancerIPstring"nil"
service.nodePortstring"nil"
service.portint8080
service.typestring"ClusterIP"
startupProbe.enabledbooltrue
startupProbe.failureThresholdint600
startupProbe.periodSecondsint10
startupProbe.successThresholdint1
startupProbe.timeoutSecondsint5
tolerationslist[]
ParameterDescriptionDefault
image.repositorynextcloud Image namenextcloud
image.flavornextcloud Image typeapache
image.tagnextcloud Image tag{VERSION}
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsSpecify image pull secretsnil
ingress.classNameName of the ingress class to usenil
ingress.enabledEnable use of ingress controllersfalse
ingress.servicePortIngress’ backend servicePorthttp
ingress.annotationsAn array of service annotationsnil
ingress.labelsAn array of service labelsnil
ingress.pathThe Path to use in Ingress’ paths/
ingress.pathTypeThe PathType to use in Ingress’ pathsPrefix
ingress.tlsIngress TLS configuration[]
nextcloud.hostnextcloud host to create application URLsnextcloud.kube.home
nextcloud.usernameUser of the applicationadmin
nextcloud.passwordApplication passwordchangeme
nextcloud.existingSecret.enabledWhether to use an existing secret or notfalse
nextcloud.existingSecret.secretNameName of the existing secretnil
nextcloud.existingSecret.usernameKeyName of the key that contains the usernamenil
nextcloud.existingSecret.passwordKeyName of the key that contains the passwordnil
nextcloud.existingSecret.smtpUsernameKeyName of the key that contains the SMTP usernamenil
nextcloud.existingSecret.smtpPasswordKeyName of the key that contains the SMTP passwordnil
nextcloud.updateTrigger update if custom command is used0
nextcloud.containerPortCustomize container port when not running as root80
nextcloud.datadirnextcloud data dir location/var/www/html/data
nextcloud.mail.enabledWhether to enable/disable email settingsfalse
nextcloud.mail.fromAddressnextcloud mail send from fieldnil
nextcloud.mail.domainnextcloud mail domainnil
nextcloud.mail.smtp.hostSMTP hostnamenil
nextcloud.mail.smtp.secureSMTP connection ssl or empty''
nextcloud.mail.smtp.portOptional SMTP portnil
nextcloud.mail.smtp.authtypeSMTP authentication methodLOGIN
nextcloud.mail.smtp.nameSMTP username''
nextcloud.mail.smtp.passwordSMTP password''
nextcloud.configsConfig files created in /var/www/html/config{}
nextcloud.persistence.subPathSet the subPath for nextcloud to use in volumenil
nextcloud.phpConfigsPHP Config files created in /usr/local/etc/php/conf.d{}
nextcloud.defaultConfigs.\.htaccessDefault .htaccess to protect /var/www/html/configtrue
nextcloud.defaultConfigs.redis\.config\.phpDefault Redis configurationtrue
nextcloud.defaultConfigs.apache-pretty-urls\.config\.phpDefault Apache configuration for rewrite urlstrue
nextcloud.defaultConfigs.apcu\.config\.phpDefault configuration to define APCu as local cachetrue
nextcloud.defaultConfigs.apps\.config\.phpDefault configuration for appstrue
nextcloud.defaultConfigs.autoconfig\.phpDefault auto-configuration for databasestrue
nextcloud.defaultConfigs.smtp\.config\.phpDefault configuration for smtptrue
nextcloud.strategyspecifies the strategy used to replace old Pods by new onestype: Recreate
nextcloud.extraEnvspecify additional environment variables{}
nextcloud.extraInitContainersspecify additional init containers[]
nextcloud.extraVolumesspecify additional volumes for the NextCloud pod{}
nextcloud.extraVolumeMountsspecify additional volume mounts for the NextCloud pod{}
nginx.enabledEnable nginx (requires you use php-fpm image)false
nginx.image.repositorynginx Image namenginx
nginx.image.tagnginx Image tagalpine
nginx.image.pullPolicynginx Image pull policyIfNotPresent
nginx.config.defaultWhether to use nextclouds recommended nginx configtrue
nginx.config.customSpecify a custom config for nginx{}
nginx.resourcesnginx resources{}
lifecycle.postStartCommandSpecify deployment lifecycle hook postStartCommandnil
lifecycle.preStopCommandSpecify deployment lifecycle hook preStopCommandnil
internalDatabase.enabledWhether to use internal sqlite databasetrue
internalDatabase.databaseName of the existing databasenextcloud
externalDatabase.enabledWhether to use external databasefalse
externalDatabase.typeExternal database type: mysql, postgresqlmysql
externalDatabase.hostHost of the external database in form of host:portnil
externalDatabase.databaseName of the existing databasenextcloud
externalDatabase.userExisting username in the external dbnextcloud
externalDatabase.passwordPassword for the above usernamenil
externalDatabase.existingSecret.enabledWhether to use a existing secret or notfalse
externalDatabase.existingSecret.secretNameName of the existing secretnil
externalDatabase.existingSecret.usernameKeyName of the key that contains the usernamenil
externalDatabase.existingSecret.passwordKeyName of the key that contains the passwordnil
mariadb.enabledWhether to use the MariaDB chartfalse
mariadb.auth.databaseDatabase name to createnextcloud
mariadb.auth.passwordPassword for the databasechangeme
mariadb.auth.usernameDatabase user to createnextcloud
mariadb.auth.rootPasswordMariaDB admin passwordnil
postgresql.enabledWhether to use the PostgreSQL chartfalse
postgresql.global.postgresql.auth.usernameDatabase user to createnextcloud
postgresql.global.postgresql.auth.passwordPassword for the databasechangeme
postgresql.global.postgresql.auth.databaseDatabase name to createnextcloud
postgresql.primary.persistence.enabledWhether or not to use PVC on PostgreSQL primaryfalse
redis.enabledWhether to install/use redis for lockingfalse
redis.auth.enabledWhether to enable password authentication with redistrue
redis.auth.passwordThe password redis uses''
cronjob.enabledWhether to enable/disable cronjobfalse
cronjob.scheduleSchedule for the CronJob*/15 * * * *
cronjob.annotationsAnnotations to add to the cronjob{}
cronjob.curlInsecureSet insecure (-k) option to curlfalse
cronjob.failedJobsHistoryLimitSpecify the number of failed Jobs to keep5
cronjob.successfulJobsHistoryLimitSpecify the number of completed Jobs to keep2
cronjob.resourcesCronjob Resourcesnil
cronjob.nodeSelectorCronjob Node selectornil
cronjob.tolerationsCronjob tolerationsnil
cronjob.affinityCronjob affinitynil
service.typeKubernetes Service typeClusterIP
service.loadBalancerIPLoadBalancerIp for service type LoadBalancernil
service.nodePortNodePort for service type NodePortnil
persistence.enabledEnable persistence using PVCfalse
persistence.annotationsPVC annotations{}
persistence.storageClassPVC Storage Class for nextcloud volumenil (uses alpha storage class annotation)
persistence.existingClaimAn Existing PVC name for nextcloud volumenil (uses alpha storage class annotation)
persistence.accessModePVC Access Mode for nextcloud volumeReadWriteOnce
persistence.sizePVC Storage Request for nextcloud volume8Gi
persistence.nextcloudData.enabledCreate a second PVC for the data folder in nextcloudfalse
persistence.nextcloudData.annotationssee persistence.annotations{}
persistence.nextcloudData.storageClasssee persistence.storageClassnil (uses alpha storage class annotation)
persistence.nextcloudData.existingClaimsee persistence.existingClaimnil (uses alpha storage class annotation)
persistence.nextcloudData.accessModesee persistence.accessModeReadWriteOnce
persistence.nextcloudData.sizesee persistence.size8Gi
phpClientHttpsFix.enabledSets OVERWRITEPROTOCOL for https ingress redirectfalse
phpClientHttpsFix.protocolSets OVERWRITEPROTOCOL for https ingress redirecthttps
resourcesCPU/Memory resource requests/limits{}
rbac.enabledEnable Role and rolebinding for priveledged PSPfalse
rbac.serviceaccount.createWether to create a serviceaccount or use an existing one (requires rbac)true
rbac.serviceaccount.nameThe name of the sevice account that the deployment will use (requires rbac)nextcloud-serviceaccount
rbac.serviceaccount.annotationsServiceaccount annotations{}
livenessProbe.enabledTurn on and off liveness probetrue
livenessProbe.initialDelaySecondsDelay before liveness probe is initiated10
livenessProbe.periodSecondsHow often to perform the probe10
livenessProbe.timeoutSecondsWhen the probe times out5
livenessProbe.failureThresholdMinimum consecutive failures for the probe3
livenessProbe.successThresholdMinimum consecutive successes for the probe1
readinessProbe.enabledTurn on and off readiness probetrue
readinessProbe.initialDelaySecondsDelay before readiness probe is initiated10
readinessProbe.periodSecondsHow often to perform the probe10
readinessProbe.timeoutSecondsWhen the probe times out5
readinessProbe.failureThresholdMinimum consecutive failures for the probe3
readinessProbe.successThresholdMinimum consecutive successes for the probe1
startupProbe.enabledTurn on and off startup probefalse
startupProbe.initialDelaySecondsDelay before readiness probe is initiated30
startupProbe.periodSecondsHow often to perform the probe10
startupProbe.timeoutSecondsWhen the probe times out5
startupProbe.failureThresholdMinimum consecutive failures for the probe30
startupProbe.successThresholdMinimum consecutive successes for the probe1
hpa.enabledBoolean to create a HorizontalPodAutoscalerfalse
hpa.cputhresholdCPU threshold percent for the HorizontalPodAutoscale60
hpa.minPodsMin. pods for the Nextcloud HorizontalPodAutoscaler1
hpa.maxPodsMax. pods for the Nextcloud HorizontalPodAutoscaler10
deploymentLabelsLabels to be added at ‘deployment’ levelnot set
deploymentAnnotationsAnnotations to be added at ‘deployment’ levelnot set
podLabelsLabels to be added at ‘pod’ levelnot set
podAnnotationsAnnotations to be added at ‘pod’ levelnot set
metrics.enabledStart Prometheus metrics exporterfalse
metrics.httpsDefines if https is used to connect to nextcloudfalse (uses http)
metrics.tokenUses token for auth instead of username/password""
metrics.timeoutWhen the scrape times out5s
metrics.image.repositoryNextcloud metrics exporter image namexperimental/nextcloud-exporter
metrics.image.tagNextcloud metrics exporter image tag0.5.1
metrics.image.pullPolicyNextcloud metrics exporter image pull policyIfNotPresent
metrics.podAnnotationsAdditional annotations for metrics exporternot set
metrics.podLabelsAdditional labels for metrics exporternot set
metrics.service.typeMetrics: Kubernetes Service typeClusterIP
metrics.service.loadBalancerIPMetrics: LoadBalancerIp for service type LoadBalancernil
metrics.service.nodePortMetrics: NodePort for service type NodePortnil
metrics.service.annotationsAdditional annotations for service metrics exporter{prometheus.io/scrape: "true", prometheus.io/port: "9205"}
metrics.service.labelsAdditional labels for service metrics exporter{}
metrics.serviceMonitor.enabledCreate ServiceMonitor Resource for scraping metrics using PrometheusOperatorfalse
metrics.serviceMonitor.namespaceNamespace in which Prometheus is running``
metrics.serviceMonitor.jobLabelThe name of the label on the target service to use as the job name in prometheus``
metrics.serviceMonitor.intervalInterval at which metrics should be scraped30s
metrics.serviceMonitor.scrapeTimeoutSpecify the timeout after which the scrape is ended``
metrics.serviceMonitor.labelsExtra labels for the ServiceMonitor`{}

Note:

For nextcloud to function correctly, you should specify the nextcloud.host parameter to specify the FQDN (recommended) or the public IP address of the nextcloud service.

Optionally, you can specify the service.loadBalancerIP parameter to assign a reserved IP address to the nextcloud service of the chart. However please note that this feature is only available on a few cloud providers (f.e. GKE).

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

helm install --name my-release \
  --set nextcloud.username=admin,nextcloud.password=password \
    nextcloud/nextcloud

The above command sets the nextcloud administrator account username and password to admin and password respectively.

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

helm install --name my-release -f values.yaml nextcloud/nextcloud

Tip: You can use the default values.yaml

Persistence

The Nextcloud image stores the nextcloud data and configurations at the /var/www/html paths of the container.

Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. See the Configuration section to enable persistence and configuration of the PVC.

Cronjob

This chart can utilize Kubernetes CronJob resource to execute background tasks.

To use this functionality, set cronjob.enabled parameter to true and switch background mode to Webcron in your nextcloud settings page. See the Configuration section for further configuration of the cronjob resource.

Note: For the cronjobs to work correctly, ingress must be also enabled (set ingress.enabled to true) and nextcloud.host has to be publicly resolvable.

Multiple config.php file

Nextcloud supports loading configuration parameters from multiple files. You can add arbitrary files ending with .config.php in the config/ directory. See documentation.

For example, following config will configure Nextcloud with S3 as primary storage by creating file /var/www/html/config/s3.config.php:

nextcloud:
  configs:
    s3.config.php: |-
      <?php
      $CONFIG = array (
        'objectstore' => array(
          'class' => '\\OC\\Files\\ObjectStore\\S3',
          'arguments' => array(
            'bucket'     => 'my-bucket',
            'autocreate' => true,
            'key'        => 'xxx',
            'secret'     => 'xxx',
            'region'     => 'us-east-1',
            'use_ssl'    => true
          )
        )
      );

Preserving Source IP

  • Make sure your loadbalancer preserves source IP, for bare metal, metalb does and klipper-lb doesn’t.
  • Make sure your Ingress preserves source IP. If you use ingress-nginx, add the following annotations:
ingress:
  annotations:
   nginx.ingress.kubernetes.io/enable-cors: "true"
   nginx.ingress.kubernetes.io/cors-allow-headers: "X-Forwarded-For"
  • The next layer is nextcloud pod’s nginx if you use nextcloud-fpm, this can be left at default
  • Add some PHP config for nextcloud as mentioned above in multiple config.phps section:
  configs:
    proxy.config.php: |-
      <?php
      $CONFIG = array (
        'trusted_proxies' => array(
          0 => '127.0.0.1',
          1 => '10.0.0.0/8',
        ),
        'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
      );

Hugepages

If your node has hugepages enabled, but you do not map any into the container, it could fail to start with a bus error in Apache. This is due to Apache attempting to memory map a file and use hugepages. The fix is to either disable huge pages on the node or map hugepages into the container:

nextcloud:
  extraVolumes:
    - name: hugepages
      emptyDir:
        medium: HugePages-2Mi
  extraVolumeMounts:
    - name: hugepages
      mountPath: /dev/hugepages
  resources:
    requests:
      hugepages-2Mi: 500Mi
      # note that Kubernetes currently requires cpu or memory requests and limits before hugepages are allowed.
      memory: 500Mi
    limits:
      # limit and request must be the same for hugepages. They are a fixed resource.
      hugepages-2Mi: 500Mi
      # note that Kubernetes currently requires cpu or memory requests and limits before hugepages are allowed.
      memory: 1Gi

HPA (Clustering)

If you want to have multiple Nextcloud containers, regardless of dynamic or static sizes, you need to use shared persistence between the containers.

Minimum cluster compatible persistence settings:

persistence:
  enabled: true
  accessMode: ReadWriteMany