Skip to content

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.

2 participants