Giter Site home page Giter Site logo

Comments (6)

mjnagel avatar mjnagel commented on August 18, 2024 1

@paddatrapper I have done this in the past to override the init container:

spec:
  podExtensions:
    initContainers:
      - command:
           - /bin/sh
           - -c
           - until pg_isready --dbname="$DB_CONNECTION_CHECK_URL"; do echo waiting for database; sleep 5; done;
         image: postgres
         name: db-readiness-check
         env:
           - name: DB_CONNECTION_CHECK_URL
              valueFrom:
                secretKeyRef:
                  key: DB_CONNECTION_CHECK_URL
                  name: 'my-db-secret'
  database:
    disableReadinessCheck: true

In your case you could reference a secret with the username/password for your DB and change the command to utilize those ENVs. I may have gotten some of the indentation off since I was copying this over from another format inside of a helm chart. Hope this helps...its pretty simple to make a "clone" of the default init container and then modify as you need.

from mattermost-operator.

paddatrapper avatar paddatrapper commented on August 18, 2024

Adding to that, it would be great if Mattermost interpreted environment variables in the connection string correctly, so that this worked in the mattermost container too.

from mattermost-operator.

Szymongib avatar Szymongib commented on August 18, 2024

Hey @paddatrapper,

I do not think we would like to pass those envs to the Init Containers as they are meant to be specific for Mattermost.

What you can do tho, is to define your own init containers for which you can define your own envs:

apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
  name: mm-example-anywhere
spec:
  ...
  podExtensions:
    initContainers:
      - [YOUR CONTAINER DEFINITION HERE]

from mattermost-operator.

paddatrapper avatar paddatrapper commented on August 18, 2024

Are those extensions patched in or does it require a full definition of the initContainer?

from mattermost-operator.

Szymongib avatar Szymongib commented on August 18, 2024

They require full definition, you can probably copy the default one and adjust.

from mattermost-operator.

paddatrapper avatar paddatrapper commented on August 18, 2024

Hmm... It seems this is pointless until mattermost supports interpreting the environment variables within the connection string anyway. Thanks for the guidance!

from mattermost-operator.

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.