Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/nginx-ingress] Helm install nginx-ingress with parameter controller.nodeSelector does not work #12961

Closed
wwyhy opened this issue Apr 10, 2019 · 4 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@wwyhy
Copy link

wwyhy commented Apr 10, 2019

Version of Helm and Kubernetes:
Kubernetes: v1.14.0
Helm: v2.13.1

Which chart:
stable/nginx-ingress

What happened:

helm install stable/nginx-ingress \

--namespace ingress-nginx
--name nginx-ingress
--set controller.hostNetwork=true
--set controller.kind=DaemonSet
--set controller.service.type=""
--set controller.daemonset.useHostPort=true
--set controller.daemonset.hostPorts.http=80
--set controller.daemonset.hostPorts.https=443
--set controller.nodeSelector.master=true

I have labeled the 3 master with "master=true", I got the error:
Error: release nginx-ingress failed: DaemonSet in version "v1beta1" cannot be handled as a DaemonSet: v1beta1.DaemonSet.Spec: v1beta1.DaemonSetSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.NodeSelector: ReadString: expects " or n, but found t, error found in #10 byte of ...|"master":true},"serv|..., bigger context ...|rst","hostNetwork":true,"nodeSelector":{"master":true},"serviceAccountName":"nginx-ingress","termina|...

What you expected to happen:
The nginx-ingress-controller should be assigned the 3 master which labeled "master=true".
but it seems that the parameter "--set controller.nodeSelector" does not work.

How to reproduce it (as minimally and precisely as possible):

  1. label 3 master with "master=true"
  2. run install

helm install stable/nginx-ingress \

--namespace ingress-nginx
--name nginx-ingress
--set controller.hostNetwork=true
--set controller.kind=DaemonSet
--set controller.service.type=""
--set controller.daemonset.useHostPort=true
--set controller.daemonset.hostPorts.http=80
--set controller.daemonset.hostPorts.https=443
--set controller.nodeSelector.master=true

Anything else we need to know:
In this case, i expect the nginx-ingress-controller only running on the 3 master, but nodes.
so I used the parameter " --set controller.nodeSelector "

@wwyhy wwyhy changed the title Helm install nginx-ingress with parameter controller.nodeSelector does not work [stable/nginx-ingress] Helm install nginx-ingress with parameter controller.nodeSelector does not work Apr 10, 2019
@stale
Copy link

stale bot commented May 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 10, 2019
@ChiefAlexander
Copy link
Collaborator

The issue here is that true is getting evaluated as a boolean instead of what kubernetes expects (a string). This is a limitation of the --set flag: https://helm.sh/docs/using_helm/#the-format-and-limitations-of-set

Helm will cast certain values specified with --set to integers. For example, --set foo=true results Helm to cast true into an int64 value. In case you want a string, use a --set’s variant named --set-string. --set-string foo=true results in a string value of "true".

Using set-string this will work as intended. However while looking into this issue I found that we are not wrapping the annotations field of the daemonset which will produce an error if it is not set. I will create another issue to fix that up. For now you will have to pass in:

--namespace ingress-nginx
--name nginx-ingress
--set controller.hostNetwork=true
--set controller.kind=DaemonSet
--set controller.service.type=""
--set controller.daemonset.useHostPort=true
--set controller.daemonset.hostPorts.http=80
--set controller.daemonset.hostPorts.https=443
--set-string controller.nodeSelector.master=true
--set controller.podAnnotations.something=something

@stale stale bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 22, 2019
@stale
Copy link

stale bot commented Jun 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 21, 2019
@stale
Copy link

stale bot commented Jul 5, 2019

This issue is being automatically closed due to inactivity.

@stale stale bot closed this as completed Jul 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

2 participants