apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: nextcloud-release
  namespace: nextcloud
spec:
  releaseName: nextcloud
  chart:
    spec:
      chart: nextcloud
      sourceRef:
        kind: HelmRepository
        name: nextcloud-repo
      version: "3.5.21"
  interval: 1h0m0s
  values:
    image:
      repository: nextcloud
      flavor: fpm
      tag:  "27-fpm"
    replicaCount: 1
    nextcloud:
      host: cloud.inpt.fr
    nginx:
      enabled: true
    redis:
      enabled: true
      auth:
        enabled: true
    internalDatabase:
      enabled: false
    externalDatabase:
      type: mysql
      host: mysql.bde.inp
      database: nextcloud
      user: nextcloud
      existingSecret:
        enabled: true
        secretName: nextcloud-secrets
        usernameKey: MYSQL_USER
        usernameKey: MYSQL_DATABASE
        passwordKey: MYSQL_PASSWORD
    persistence:
      enabled: true
      storageClass: local-ssd
      nextcloudData: 
        enabled: true
        storageClass: nfs
        size: 100Gi
    ingress:
      enabled: true
      host: cloud.inpt.fr
      path: /
      tls:
        - hosts:
            - cloud.inpt.fr
          secretName: nextcloud-tls
      annotations:
        cert-manager.io/cluster-issuer: letsencrypt-prod
