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 Chart values not parsed correctly (PodSpec.nodeSelector: got "map", expected "string") #9249

Closed
vizzard opened this issue Nov 18, 2021 · 8 comments · Fixed by #9865
Closed
Labels
area/e2e area/helm kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this size/3 Size Estimate 3
Milestone

Comments

@vizzard
Copy link

vizzard commented Nov 18, 2021

Rancher Server Setup

  • Rancher version: v2.6.2
  • Installation option (Docker install/Helm Chart): Helm Chart
    • If Helm Chart, Kubernetes Cluster and version (RKE1, RKE2, k3s, EKS, etc): RKE1, Kubernetes v1.19.10
  • Proxy/Cert Details: Nginx Ingress Controller (came with RKE1 cluster), Rancher-generated TLS certificate (cert-manager installed)

Information about the Cluster

  • Kubernetes version: v1.21.5
  • Cluster Type (Local/Downstream): Downstream
    • If downstream, what type of cluster? (Custom/Imported or specify provider for Hosted/Infrastructure Provider): VMware vSphere provider

Describe the bug
Unable to deploy Nginx Ingress Controller on downstream cluster (VMware vSphere provider) from Rancher UI (Apps & Marketplace) with controller.nodeSelector set to node-role.kubernetes.io/worker: 'true'.
Deployment with the same values is successful when deploying with helm from CLI:

cat > nginx-controller-load-balancer-service.yaml <<EOF
controller:
  nodeSelector:
    node-role.kubernetes.io/worker: 'true'
EOF

helm install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx -f nginx-controller-load-balancer-service.yaml --version=4.0.8

Since it works from CLI, this seems to be Rancher issue.

To Reproduce

  • Add ingress-nginx repository to Rancher (Apps & Marketplace) using this URL (from their docs): https://kubernetes.github.io/ingress-nginx
  • Try to deploy Nginx Ingress Controller from Rancher UI (Helm Chart version 4.0.8) changing controller.nodeSelector to in values yaml (single change in line 149):
  nodeSelector:
    node-role.kubernetes.io/worker: 'true'

Result
Helm install error:

helm install --namespace=ingress-nginx --timeout=10m0s --values=/home/shell/helm/values-ingress-nginx-4.0.8.yaml --version=4.0.8 --wait=true ingress-nginx /home/shell/helm/ingress-nginx-4.0.8.tgz
Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: ValidationError(Deployment.spec.template.spec.nodeSelector.kubernetes): invalid type for io.k8s.api.core.v1.PodSpec.nodeSelector: got "map", expected "string"

Expected Result
Successful installation.

Additional context
Default selector only works:

  nodeSelector:
    kubernetes.io/os: linux

Keeping default selector works:

  nodeSelector:
    kubernetes.io/os: linux
    node-role.kubernetes.io/worker: 'true'

Does not work:

  nodeSelector:
    node-role.kubernetes.io/worker: true
  nodeSelector:
    node-role.kubernetes.io/worker: 'true'
  nodeSelector:
    node-role.kubernetes.io/worker: "true"
@stale
Copy link

stale bot commented Jan 17, 2022

This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 60 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions.

@stale stale bot added the status/stale label Jan 17, 2022
@stale stale bot closed this as completed Feb 2, 2022
@h0tw1r3
Copy link

h0tw1r3 commented Mar 18, 2022

I'm experiencing the same issue with helm 3.5.0 and kubernetes v1.23.4+k3s1.

helm upgrade --install kubernetes-dashboard --set priorityClassName=system-node-critical --set metricsScraper.enabled=true   --set nodeSelector."node-role\\.kubernetes\\.io/master"=true  --namespace kubernetes-dashboard   kubernetes-dashboard/kubernetes-dashboard --version 5.3.1
Error: UPGRADE FAILED: failed to create resource: Deployment in version "v1" cannot be handled as a Deployment: json: cannot unmarshal number into Go struct field PodSpec.spec.template.spec.nodeSelector of type string

@tomthetommy
Copy link

Why was this closed? I'm still having this issue also.

@kinarashah
Copy link
Member

Still seeing this issue on v2.7.5. My steps are similar to issue description:

  • Added repository https://kubernetes.github.io/cloud-provider-aws
  • Installing chart and enabled Customize Helm options before install
  • Updated nodeSelector to change the label:
nodeSelector:
  node-role.kubernetes.io/controlplane: 'true'
  • Install chart fails with
    failed to create resource: DaemonSet in version "v1" cannot be handled as a DaemonSet: json: cannot unmarshal object into Go struct field PodSpec.spec.template.spec.nodeSelector of type string

Note:

  • Confirmed that the values.yml is valid
  • Looks like a UI issue based on request json, somehow extra values are added to the above nodeSelector field
nodeSelector:
  node-role.kubernetes.io/control-plane: ''
  node-role:
    kubernetes:
      io/control-plane: null
  node-role.kubernetes.io/controlplane: 'true'

This could be related to the default chart values because the original value was

nodeSelector:
 node-role.kubernetes.io/control-plane: ''
Screenshot 2023-06-30 at 3 36 19 PM

@gaktive
Copy link
Member

gaktive commented Aug 9, 2023

Per @kinarashah's notes, we're allowing duplicate values in through the editor somehow. We should look at the install component first, where there's code to merge new values into the resource class.

@gaktive gaktive added size/2 Size Estimate 2 area/e2e QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this size/3 Size Estimate 3 [zube]: Groomed and removed size/2 Size Estimate 2 [zube]: Backlog labels Aug 9, 2023
@nwmac nwmac assigned ghost Aug 10, 2023
@ghost ghost added [zube]: Working and removed [zube]: Next Up labels Aug 31, 2023
@slickwarren
Copy link
Contributor

not sure who is assigned this issue, but manually testing this is working following the aws out-of-tree documentation

@izaac
Copy link
Contributor

izaac commented Nov 17, 2023

Hey @slickwarren do you mean this was covered by these other issues validation?

#9110
rancher/rancher-docs#844

@izaac
Copy link
Contributor

izaac commented Nov 17, 2023

Automation coverage is here #9865
Closing as the automation coverage looks right.

@izaac izaac closed this as completed Nov 17, 2023
@zube zube bot removed the [zube]: Done label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/e2e area/helm kind/bug QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this size/3 Size Estimate 3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants