Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bitnami/postgresql default username and password #29478

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

dnskr
Copy link
Contributor

@dnskr dnskr commented Feb 11, 2023

The PR changes default username and password values used by bitnami/postgresql subchart, because current null values don't allow to install simple Airflow deployment using Argo CD.
BTW, bitnami/postgresql chart uses empty strings "" for auth.username and auth.password by default.

How to reproduce

Install Argo CD

helm install argocd argo/argo-cd --set applicationSet.enabled=false --version 5.20.3

Create Application file airflow.yaml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: airflow
spec:
  project: default
  source:
    repoURL: https://github.com/apache/airflow.git
    targetRevision: 7ee1a5624497fc457af239e93e4c1af94972bbe6
    path: chart
    helm:
      version: v3
      valueFiles:
        - values.yaml
      values: |
        pgbouncer:
          enabled: true
        workers:
          persistence:
            enabled: false
        createUserJob:
          useHelmHooks: false
          applyCustomEnv: false
        migrateDatabaseJob:
          useHelmHooks: false
          applyCustomEnv: false
          jobAnnotations:
            "argocd.argoproj.io/hook": Sync
  destination:
    server: https://kubernetes.default.svc
    namespace: airflow
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

Create Airflow Application

kubectl apply -f airflow.yaml

Check that airflow-postgresql-0 pod cannot start. Both livenessProbe and readinessProbe are broken: username is empty in command scripts, i.e. -U ""

apiVersion: v1
kind: Pod
metadata:
  name: airflow-postgresql-0
  namespace: airflow
spec:
  containers:
    - name: postgresql
      livenessProbe:
        exec:
          command:
            - /bin/sh
            - '-c'
            - exec pg_isready -U "" -h 127.0.0.1 -p 5432
      readinessProbe:
        exec:
          command:
            - /bin/sh
            - '-c'
            - '-e'
            - >
              exec pg_isready -U "" -h 127.0.0.1 -p 5432
              [ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]

How to test

Use the following Application definition which points to fixed helm chart

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: airflow
spec:
  project: default
  source:
    repoURL: https://github.com/dnskr/airflow.git
    targetRevision: dee81abf62369ef4fa1c2001f62fe8f395746cf3
    path: chart
    helm:
      version: v3
      valueFiles:
        - values.yaml
      values: |
        pgbouncer:
          enabled: true
        workers:
          persistence:
            enabled: false
        createUserJob:
          useHelmHooks: false
          applyCustomEnv: false
        migrateDatabaseJob:
          useHelmHooks: false
          applyCustomEnv: false
          jobAnnotations:
            "argocd.argoproj.io/hook": Sync
  destination:
    server: https://kubernetes.default.svc
    namespace: airflow
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

@boring-cyborg boring-cyborg bot added the area:helm-chart Airflow Helm Chart label Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants