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

Helm podAntiAffinity templating error #12790

Closed
StefanCenusa opened this issue Mar 26, 2019 · 4 comments
Closed

Helm podAntiAffinity templating error #12790

StefanCenusa opened this issue Mar 26, 2019 · 4 comments
Assignees
Milestone

Comments

@StefanCenusa
Copy link

Describe the bug

Helm charts fail to generate proper podAntiAffinity.

In my values.yaml file I define the following:

mixer:

  podAntiAffinityTermLabelSelector:
    - key: istio
      operator: In
      values: mixer
      topologyKey: kubernetes.io/hostname

and after running helm template I noticed it generates the following output:

        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: istio
                  operator: In
              topologyKey: kubernetes.io/hostname
            weight: 100

https://github.com/istio/istio/blob/release-1.1/install/kubernetes/helm/istio/templates/_affinity.tpl#L83

If I change .value in .values I get the expected output.

Thanks!

Expected behavior

        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: istio
                  operator: In
                  values:
                  - mixer
              topologyKey: kubernetes.io/hostname
            weight: 100

Version
branch: release-1.1

Installation
helm

@linsun
Copy link
Member

linsun commented Mar 26, 2019

@morvencao can you help this?

@linsun linsun added this to the 1.1 milestone Mar 26, 2019
@morvencao
Copy link
Member

@StefanCenusa Yes, you need to update value to values, since we can define multiple values separated by comma, check the example settings: https://github.com/istio/istio/blob/release-1.1/install/kubernetes/helm/istio/charts/mixer/values.yaml#L65

@StefanCenusa
Copy link
Author

StefanCenusa commented Mar 26, 2019

@morvencao I am confused. In my opinion there is a bug in _affinity.tpl file because this if will always be falsy, unless I have a weird definition like this in values.yaml:

mixer:

  podAntiAffinityTermLabelSelector:
    - key: istio
      operator: In
      value: mixer
      values: mixer
      topologyKey: kubernetes.io/hostname

Am I doing something wrong?

@morvencao
Copy link
Member

@StefanCenusa Got it, I missed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants