Giter Club home page Giter Club logo

Comments (5)

prudhvigodithi avatar prudhvigodithi commented on June 16, 2024

More improvement is better if a user can pass as

apiVersion: opensearch.opster.io/v1
kind: OpenSearchCluster
metadata:
  name: my-first-cluster
  namespace: default
spec:
  general:
    serviceName: my-first-cluster
  dashboards:
    enable: true
    resources:
       requests:
          memory: "64Mi"
          cpu: "250m"
       limits:
         memory: "128Mi"
         cpu: "500m"
  nodePools:
    - component: masters
      replicas: 3
      diskSize: 30
      NodeSelector:
      resources:
         requests:
            memory: "64Mi"
            cpu: "250m"
         limits:
            memory: "128Mi"
            cpu: "500m"
      roles:
        - "data"
        - "master"

from opensearch-k8s-operator.

dbason avatar dbason commented on June 16, 2024

So a couple of thoughts here. Functionally for memory the limit and request should be the same. Setting them differently doesn't make sense for an opensearch node. Also we should set the JVM heapsize to be half of whatever the memory limit/request is. I think it's OK to let the user override this (they shouldn't) but set it by default.

from opensearch-k8s-operator.

prudhvigodithi avatar prudhvigodithi commented on June 16, 2024

Hey @dbason yes JVM is currently set as jvm = "-Xmx512M -Xms512M" which is default, but as per my thought it would be good to allow users to set the resource upper and lower limits as per the their own environment.

from opensearch-k8s-operator.

prudhvigodithi avatar prudhvigodithi commented on June 16, 2024

Hey my point is if we have to add resources, it should be the same for both opensearch and opensearch-dashboard
Example as

apiVersion: opensearch.opster.io/v1
kind: OpenSearchCluster
metadata:
  name: my-first-cluster
  namespace: default
spec:
  general:
    serviceName: my-first-cluster
  dashboards:
    enable: true
    resources:
       requests:
          memory: "64Mi"
          cpu: "250m"
       limits:
         memory: "128Mi"
         cpu: "500m"
  nodePools:
    - component: masters
      replicas: 3
      diskSize: 30
      NodeSelector:
      resources:
         requests:
            memory: "64Mi"
            cpu: "250m"
         limits:
            memory: "128Mi"
            cpu: "500m"
      roles:
        - "data"
        - "master"

Key points

  • If we have to remove the option for requests, then it should be for both opensearch and opensearch-dashboard as this makes easy for a user to declare resources for both opensearch and opensearch-dashboard

  • we can consider adding as follows

apiVersion: opensearch.opster.io/v1
kind: OpenSearchCluster
metadata:
  name: my-first-cluster
  namespace: default
spec:
  general:
    serviceName: my-first-cluster
  dashboards:
    enable: true
    resources:
          memory: "64Mi"
          cpu: "250m"
  nodePools:
    - component: masters
      replicas: 3
      diskSize: 30
      NodeSelector:
      resources:
            memory: "64Mi"
            cpu: "250m"
      roles:
        - "data"
        - "master"

This will make sure both the limits and requests are set to values passed in memory: and cpu: fields and allow node.Jvm to be half of this value.
https://github.com/Opster/opensearch-k8s-operator/blob/5c6610a6822cf162601990c7a9969fa11f25808a/opensearch-operator/pkg/builders/cluster.go#L123
(still a user can override this with Jvm field)

  • Its definitely good to have both requests and limits to be passed during runtime, as this allows backend to use the required resources in range of declared requests and limits and not locking the max value even when not needed.

I'm open for any inputs and suggestions here, so that I can modify my PR in accordingly :)
#69

from opensearch-k8s-operator.

prudhvigodithi avatar prudhvigodithi commented on June 16, 2024

Hey Closing this issue, as cluster resources reconciler has been added to the PR, will re-open if required.

from opensearch-k8s-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.