Giter Site home page Giter Site logo

Comments (12)

hubwoop avatar hubwoop commented on September 7, 2024 3

Could we use this as a solution?

{{- if .Values.mariadb.enabled }}
initContainers:
- name: mariadb-isalive
  image: bitnami/mariadb
  env:
    - name: MYSQL_USER
      valueFrom:
        secretKeyRef:
          name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
          key: {{ .Values.externalDatabase.existingSecret.usernameKey | default "db-username" }}
    - name: MYSQL_PASSWORD
      valueFrom:
        secretKeyRef:
          name: {{ .Values.externalDatabase.existingSecret.secretName | default (printf "%s-%s" .Release.Name "db") }}
          key: {{ .Values.externalDatabase.existingSecret.passwordKey | default "db-password" }}
  command:
    - "sh"
    - "-c"
    - {{ printf "until mysql --host=%s-mariadb --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --execute=\"SELECT 1;\"; do echo waiting for mysql; sleep 2; done;" .Release.Name }}
{{- end }}

from helm.

tvories avatar tvories commented on September 7, 2024 2

OK, I think I see the issue here. 2.5.5 adds a test to validate that MySQL is up before the nextcloud pod starts. It appears that using an existing secret must not interpolate the value mariadb.db.password to the helm chart values.

I'm not familiar enough with how exactly helm populates that value to the initContainers if the value is an existing secret.

I could add a check to the helm template to only run that if the password is defined, but maybe there's a way to incorporate both features.

from helm.

tvories avatar tvories commented on September 7, 2024 1

I will write up a conditional for the maria.db.password check just to have a solution, but it would be nice to look into what's possible.

from helm.

tvories avatar tvories commented on September 7, 2024

Can you provide some of your values (removing sensitive data)?

from helm.

hubwoop avatar hubwoop commented on September 7, 2024

Sure, here you go, thanks for taking the time:

image:
  tag: 21-beta

nextcloud:
  host: nextcloud.mydomain.internet
  existingSecret:
    enabled: true
    secretName: nextcloud-helm-chart
    usernameKey: nextcloud-username
    passwordKey: nextcloud-password
  phpConfigs: {}
  defaultConfigs:
    .htaccess: true
    redis.config.php: true
    apache-pretty-urls.config.php: true
    apcu.config.php: true
    apps.config.php: true
    autoconfig.php: true
    smtp.config.php: true
  configs:
    https.config.php: |-
      <?php
      $CONFIG = array (
        'overwriteprotocol' => 'https',
      );
  strategy:
    type: Recreate
  extraEnv:
  extraVolumes:
  extraVolumeMounts:
internalDatabase:
  enabled: false
externalDatabase:
  enabled: true
  type: mysql
  database: nextcloud
  existingSecret:
    enabled: true
    secretName: nextcloud-database
    usernameKey: mariadb-username
    passwordKey: mariadb-password
mariadb:
  enabled: true
  existingSecret: nextcloud-database
  db:
    name: nextcloud
    user: nextcloud
  master:
    persistence:
      enabled: true
persistence:
  enabled: true
  annotations: {}
  size: 200Gi
metrics:
  enabled: true
  https: true
  service:
    annotations: {}
    labels:
      app: nextcloud-metrics

from helm.

tvories avatar tvories commented on September 7, 2024

Just to clarify, this was working on release 2.5.4 (or earlier)?

from helm.

hubwoop avatar hubwoop commented on September 7, 2024

Yep, we've set the version to 2.5.* in argo-cd so it went to 2.5.5 from 2.5.4 just after the latest release

from helm.

hubwoop avatar hubwoop commented on September 7, 2024

Yep, looks like the root cause, I will also look for a solution.

from helm.

tvories avatar tvories commented on September 7, 2024

@hubwoop that's a great solution! Would you want to submit a PR for that? I can take care of it later if you can't for some reason.

from helm.

hubwoop avatar hubwoop commented on September 7, 2024

Cool! Sure, I'll open a PR later today (GMT).

from helm.

markusschuettler avatar markusschuettler commented on September 7, 2024

Hi,
any progress on this?

from helm.

mariusziemke avatar mariusziemke commented on September 7, 2024

Hey guys, templating the Release.Name (--host=%s-mariadb) inside the initContainer is creating trouble for external databases which use another url.

Maybe use _helpers.tpl to check wether the externalDatabase is set and use its url instead.

EDIT: Only applies if you still use the .Values.mariadb.enabled option, but e.g. change its fullNameOverride option or you want to use a specific pod of the StatefulSet.

from helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.