airflow-helm / charts

The User-Community Airflow Helm Chart is the standard way to deploy Apache Airflow on Kubernetes with Helm. Originally created in 2017, it has since helped thousands of companies create production-ready deployments of Airflow on Kubernetes.
https://github.com/airflow-helm/charts/tree/main/charts/airflow
Apache License 2.0
660 stars 475 forks source link

YAML parse error on chart job-upgrade-db.yaml #360

Closed valx closed 3 years ago

valx commented 3 years ago

What is the bug?

When running helm install command, I get the error:

Error: YAML parse error on airflow/templates/jobs/job-upgrade-db.yaml: error converting YAML to JSON: yaml: line 26: mapping values are not allowed in this context

The helm install command I run is:

helm install airflow4 airflow-stable/airflow --version 8.4.1 -n "****" -f "****.yaml" \
  --set ingress.web.host="****” \
  --set web.baseUrl="http://***” \
  --set airflow.image.repository="********.amazonaws.com/airflow/********” \
  --set airflow.image.tag="***-airflow-upgrade-211-1.0.1” \
  --set postgresql.enabled=true

What version of the chart are you using?:

chart 8.4.1

What is your Kubernetes Version?:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.13-eks-8df270", GitCommit:"8df2700a72a2598fa3a67c05126fa158fd839620", GitTreeState:"clean", BuildDate:"2021-07-31T01:36:57Z", GoVersion:"go1.15.14", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.21) and server (1.19) exceeds the supported minor version skew of +/-1

What is your Helm version?:

$ helm version
version.BuildInfo{Version:"v3.6.3", GitCommit:"d506314abfb5d21419df8c7e7e68012379db2354", GitTreeState:"dirty", GoVersion:"go1.16.5"}

Please copy your custom Helm values file:

airflow:
  ## configs for the docker image of the web/scheduler/worker
  ##
  image:
    repository: ""
    tag: ""
    ## values: Always or IfNotPresent
    pullPolicy: IfNotPresent
    pullSecret: ""

  extraEnv:
    - name: ***
      valueFrom:
        secretKeyRef:
          name: airflow-secrets
          key: ***
    - name: ***
      valueFrom:
        secretKeyRef:
          name: airflow-secrets
          key: ***
    - name: ***
      value: "***"

scheduler:
  livenessProbe:
    enabled: true
    initialDelaySeconds: 300
    periodSeconds: 30
    failureThreshold: 5
  requests:
    cpu: "1000m"
    memory: "500Mi"

web:
  replicas: 1
  resources:
    requests:
      cpu: "250m"
      memory: "500Mi"
  securityContext:
    fsGroup: 65534
  baseUrl: ""
  service:
    type: NodePort
    externalPort: 80
valx commented 3 years ago

the problem was due to wrong quote char in my command. the error message was misleading

aprettyloner commented 3 years ago

FWIW i am also getting this suddenly, I now see my own error but agreed that the error is misleading

thesuperzapper commented 3 years ago

@aprettyloner can you clarify the issue you were running into?

Also, if this issue is related to the job-upgrade-db.yaml file, please note that this will be removed in 8.5.0 of the chart, and replaced with a deployment, see PR: https://github.com/airflow-helm/charts/pull/345

aprettyloner commented 3 years ago

@thesuperzapper the root issue was that in my CD pipeline (via GCP cloudbuild), the substitution variable ${_TAG} was mistakenly set to "" so it caused downstream issues, but I got the same error as OP. The upgrade-db was unrelated.

    /builder/helm/helm upgrade --install ${_NAME} \
    -f values.yaml \
    -f helm/$(echo $PROJECT_ID | cut -d'-' -f3).yaml \
    --timeout=5m0s \
    --namespace=${_NAMESPACE} \
    --set=DOMAIN_SUFFIX=${_DOMAIN_SUFFIX} \
    --set=airflow.scheduler.replicas=${_SCHEDULER_REPLICAS} \
    --set=airflow.serviceAccount.name=${_KSA_NAME} \
    --set=airflow.serviceAccount.annotations."iam\.gke\.io/gcp-service-account"="${_KSA_EMAIL}" \
    --set=airflow.airflow.image.repository=gcr.io/${PROJECT_ID}/${_IMAGE} \
    --set=airflow.airflow.image.tag=${_TAG} \
    {...some other set values...}
    .