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

Question on setting nodeAffinity using a set array in helm_release #1433

Open
cychoi34 opened this issue Jul 16, 2024 · 4 comments
Open

Question on setting nodeAffinity using a set array in helm_release #1433

cychoi34 opened this issue Jul 16, 2024 · 4 comments
Assignees
Labels

Comments

@cychoi34
Copy link

cychoi34 commented Jul 16, 2024

Terraform version, Kubernetes provider version and Kubernetes version

Terraform version: Terraform v1.9.2
Helm Provider version: v3.14.3+gf03cc04
Kubernetes version: 1.29

Terraform configuration

resource "helm_release" "nginx-ingress-external" {

  name      = "blahblah"
  chart     = "argo-cd"
  version   = "0.35.4"
  namespace = "${var.argocd}"

...
  set {
    name  = "controller.replicaCount"
    value = "2"
  }

  set {
    name  = "controller.minAvailable"
    value = "1"
  }
...

  set {
    name  = "controller.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].key"
    value = "Name"
  }

  set {
    name  = "controller.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].operator"
    value = "In"
  }

  set {
    name  = "controller.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].labelSelector.matchExpressions[0].values[0]"
    value = "something"
  }
}

Question

Hi, I want the ArgoCD pods to run on the node group.
Other pods are all good for nodeAffinity setup.
In the second image, you may see that the row (tfstate file) indicates that nodeAffinity is adjusted, but it's not actually applied.
From the first image, you can see there's only podAntiAffinity.

image01
image02

@BBBmau
Copy link
Contributor

BBBmau commented Jul 17, 2024

@cychoi34 it seems like this could be due to some syntax typos. Can you attempt setting the values through the helm CLI to compare the results?

@cychoi34
Copy link
Author

cychoi34 commented Jul 18, 2024

@BBBmau Yeah, that’s right. It seems a bit clearer now. I was using affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key=Name instead of controller.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key=Name,
I could found it using helm template command.
so you’re right. It was a syntax typo.
Thanks for your time, BBBmau!
image

@cychoi34 cychoi34 reopened this Jul 23, 2024
@cychoi34
Copy link
Author

cychoi34 commented Jul 23, 2024

Hi, @BBBmau I have a further question here.
It seems it's been adjusted at the StatefulSet but not at the Pod level (even for the Deployment)
How can I solve this?

@BBBmau
Copy link
Contributor

BBBmau commented Jul 23, 2024

@cychoi34 you may want to refer to the Argo chart, from my initial investigation I didn't come across anything helpful as to why it wouldn't adjust to the pod level.

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

No branches or pull requests

3 participants