Code Monkey home page Code Monkey logo

Comments (5)

juan131 avatar juan131 commented on June 22, 2024

Hi @xqe2011

In my opinion, this secret should contain the username, password, port, host, etc. However, after I review the template, only the password is included.

Are you referring to the secret-external-db.yaml template? Please note this template will be ignored if externalDatabase.existingSecret is set.

In values.yaml, it defines keycloak.databaseSecretHostKey defaults to db-host. But in configmap-env-vars.yaml, it uses .Values.externalDatabase.existingSecretHostKey

Maybe you're using an old values.yaml? There's no keycloak.databaseSecretHostKey parameter in the current values.yaml. Or you might be referring to the function helper defined here.

from charts.

xqe2011 avatar xqe2011 commented on June 22, 2024

Are you referring to the secret-external-db.yaml template? Please note this template will be ignored if externalDatabase.existingSecret is set.

No, I am referring to the statefulset.yaml lines from 160 to 187.

In _helpers.tpl lines from 194 to 221, it defines keycloak.databaseSecretHostKey from default value db-host or .Values.externalDatabase.existingSecretHostKey, but in statefulset.yaml, it uses .Values.externalDatabase.existingSecretHostKey instead which causes the default value doesn't work.

from charts.

juan131 avatar juan131 commented on June 22, 2024

Hi @xqe2011

So you're suggesting that we use set KEYCLOAK_DATABASE_HOST, KEYCLOAK_DATABASE_PORT, ... environment variables if a condition such as the one below is met and fallback into the default values defined in keycloak.databaseSecretXXXKey helpers, am I right?

{{- if and (not .Values.postgresql.enabled)  .Values.externalDatabase.existingSecret }}

from charts.

xqe2011 avatar xqe2011 commented on June 22, 2024

Hi @juan131

Yes. This change can reduce the time spent investigating why externalDatabase.existingSecret, named to suggest it includes full database credentials such as port, host, and password, only uses the password.

from charts.

juan131 avatar juan131 commented on June 22, 2024

@xqe2011 I've been reviewing the logic and it works like this:

  • postgresql.enabled=true: ignore every externalDatabase.*** parameters and rely on the information retrieved from PostgreSQL subchart.
  • postgresql.enabled=false
    • externalDatabase.existingSecret is set:
      • For password: retrieve from existing secret using key set at externalDatabase.existingSecretPasswordKey.
      • For host, port, user & database: retrieve from existing secret ONLY IF corresponding keycloak.databaseSecretXXXKey are set. Otherwise relay on externalDatabase.host, externalDatabase.port, externalDatabase.user and externalDatabase.database (added to the configmap-env-vars.yaml ConfigMap).
    • externalDatabase.existingSecret is NOT set:
      • Rely on externalDatabase.host, externalDatabase.port, externalDatabase.user, externalDatabase.database (values added to the configmap-env-vars.yaml ConfigMap) and externalDatabase.password (value added to the secret-external-db.yaml Secret).

I agree it's over-complicated. Let me review this with the team.

from charts.

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.