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

[BUG] Node pool and Dashboard pod affinity settings are not taken into account when deploying via Helm #699

Open
dmantas opened this issue Jan 14, 2024 · 3 comments · May be fixed by #754
Labels
bug Something isn't working

Comments

@dmantas
Copy link

dmantas commented Jan 14, 2024

What is the bug?

When deploying a cluster via Helm chart, defining affinity under dashboards or under one of the nodePools is not taken into account. Checking the Dashboards Deployment or the Node Pool StatefulSet shows that the pods do not have any affinity settings at all.

If the cluster is deployed by using kubectl apply on the OpenSearchCluster manifest, affinity is applied to the pods.

How can one reproduce the bug?

Create a values.yaml file where under nodePools: the following exists:

    - component: data-nodes
      diskSize: "5Gi"
      replicas: 3
      roles:
        - "data"
      resources:
        requests:
          memory: "2Gi"
          cpu: "500m"
        limits:
          memory: "2Gi"
          cpu: "500m"
    - component: cluster-managers
      diskSize: "1Gi"
      replicas: 3
      roles:
        - "cluster_manager"
      resources:
        limits:
          memory: "2Gi"
          cpu: "500m"
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - labelSelector:
                matchExpressions:
                  - key: "opster.io/opensearch-nodepool"
                    operator: In
                    values:
                      - "cluster-managers"
              topologyKey: "kubernetes.io/hostname"

What is the expected behavior?

When checking the cluster-managers StatefulSet definition:

 k get statefulset.apps/caas-opensearch-cluster-managers -o yaml   

we expect to see the affinity settings:

    spec:
      affinity:
        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: opster.io/opensearch-nodepool
                operator: In
                values:
                - cluster-managers
            topologyKey: kubernetes.io/hostname

However, there is no affinity key at all under spec.

What is your host/environment?

Opensearch k8s operator version: 2.4.0
Opensearch version: 2.8.0

@dmantas dmantas added bug Something isn't working untriaged Issues that have not yet been triaged labels Jan 14, 2024
@evheniyt
Copy link
Contributor

I have also prepared PR #640 with a fully refactored helm chart that solves such kind of issues (not only affinity but in general issues with missing templated configuration)

@prudhvigodithi
Copy link
Collaborator

@prudhvigodithi prudhvigodithi removed the untriaged Issues that have not yet been triaged label Mar 5, 2024
@evheniyt evheniyt linked a pull request Mar 7, 2024 that will close this issue
@evheniyt
Copy link
Contributor

evheniyt commented Mar 7, 2024

@prudhvigodithi it was closed by my mistake, now I have reopened it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

3 participants