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

Mapping key "cluster-autoscaler.kubernetes.io/safe-to-evict" already defined #38183

Closed
2 tasks done
nuvme-devops opened this issue Mar 15, 2024 · 8 comments
Closed
2 tasks done
Assignees
Labels
area:helm-chart Airflow Helm Chart kind:bug This is a clearly a bug

Comments

@nuvme-devops
Copy link

nuvme-devops commented Mar 15, 2024

Official Helm Chart version

1.13.0 (latest released)

Apache Airflow version

2.8

Kubernetes Version

2.8.2

Helm Chart configuration

apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
  name: airflow
  namespace: airflow
spec:
  interval: 5m
  chart:
    spec:
      version: 1.13.0
      chart: airflow
      sourceRef:
        kind: HelmRepository
        name: airflow-charts
        namespace: flux-system
      interval: 1m
  values:
    createUserJob:
      useHelmHooks: false
      applyCustomEnv: false
    migrateDatabaseJob:
      useHelmHooks: false
      applyCustomEnv: false
    useStandardNaming: true 

Docker Image customizations

No response

What happened

I get the error below when deploying Flux with version 1.13.0.

Helm install failed for release airflow/airflow with chart
        airflow@1.13.0: error while running post render on files:
        map[string]interface {}(nil): yaml: unmarshal errors:
          line 45: mapping key "cluster-autoscaler.kubernetes.io/safe-to-evict" already defined at line 44

In version 1.11.0 everything works fine, and in version 1.12.0 we get the same error but for "ports"

Without Flux, we have no problems with version 1.13.0, but I noticed something similar in version 1.12.0.
#37356

What you think should happen instead

No response

How to reproduce

Flux helm-controller:v0.37.4

apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
  name: airflow
  namespace: airflow
spec:
  interval: 5m
  chart:
    spec:
      version: 1.13.0
      chart: airflow
      sourceRef:
        kind: HelmRepository
        name: airflow-charts
        namespace: flux-system
      interval: 1m
  values:
    createUserJob:
      useHelmHooks: false
      applyCustomEnv: false
    migrateDatabaseJob:
      useHelmHooks: false
      applyCustomEnv: false
    useStandardNaming: true 

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@nuvme-devops nuvme-devops added area:helm-chart Airflow Helm Chart kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Mar 15, 2024
Copy link

boring-cyborg bot commented Mar 15, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@nuvme-devops
Copy link
Author

Update:
We succeeded in the installation using the values below:

    workers:
      safeToEvict: false
    scheduler:
      safeToEvict: false
    triggerer:
      safeToEvict: false
    dagProcessor:
      safeToEvict: false
    redis:
      safeToEvict: false

@hussein-awala
Copy link
Member

I wonder if you have a webhook or Flux Kustomization (for ex) that patches your deployments to add the safe to evict label.

@nuvme-devops
Copy link
Author

Hi @hussein-awala not yet, I'm researching it now.

@jrderuiter
Copy link

jrderuiter commented Mar 18, 2024

This also happens in a vanilla build of the helm chart using kustomize, so I don't think it's related to @nuvme-devops setup.

You can reproduce this by creating the following kustomization.yml:

# kustomization.yml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: airflow

helmCharts:
- name: airflow
  releaseName: airflow
  version: "1.13.0"
  repo: https://airflow.apache.org

And trying to build the template using kustomize with --enable-helm:

kustomize build --enable-helm .

Which gives the following error:

Error: map[string]interface {}(nil): yaml: unmarshal errors:
  line 44: mapping key "cluster-autoscaler.kubernetes.io/safe-to-evict" already defined at line 43

This indicates that the generated templates are invalid due to this duplicate key (which is maybe not checked in other contexts). The workaround @nuvme-devops works here as well, probably by avoiding those labels entirely.

@sgrzemski
Copy link

It has nothing to do with flux. When I template the helm locally the annotations are doubled. Same goes for podAnnotations in each of the components.

@hussein-awala hussein-awala removed the needs-triage label for new issues that we didn't triage yet label Mar 19, 2024
@hussein-awala hussein-awala self-assigned this Mar 19, 2024
@hussein-awala
Copy link
Member

I cannot reproduce it on the main branch, the issue was fixed by #37917 just after releasing 1.13.0.

@jedcunningham it's worth a patch release.

@eladkal eladkal added Can't Reproduce The problem cannot be reproduced pending-response labels Mar 20, 2024
@hussein-awala hussein-awala removed Can't Reproduce The problem cannot be reproduced pending-response labels Mar 20, 2024
@hussein-awala
Copy link
Member

We will release a patch version in the coming days, I am closing the issue as fixed by #37917.

I recommend testing the RC version once it is released to make sure the version fixes your issue.

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 kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

5 participants