Giter Site home page Giter Site logo

Comments (4)

jwilander avatar jwilander commented on August 18, 2024 2

I like that solution 👍 Only point I'd make is to make sure we document that field as write-only so that it's clear to users of the spec

from mattermost-operator.

gabrieljackson avatar gabrieljackson commented on August 18, 2024 1

@Szymongib, after thinking about this for a bit I am pretty sure it's a great solution!

It meets all of the criteria that I would be looking for:

  1. By looking at the spec, I could see definitive values for the resources whether I had overridden any or not
  2. Setting a new size would update all the values
  3. Values could be manually tweaked after an initial size value was chosen.

I think this could really work well. What do you think @jwilander?

from mattermost-operator.

gabrieljackson avatar gabrieljackson commented on August 18, 2024

Hello @Born2Bake,

Thanks for bringing this to our attention. You are correct that we do want the operator to scale mattermost installations up and down on demand.

I just tested this and your findings seem to be correct where sizeA -> sizeB does not properly update the underlying resource counts. We will look into this and correct it.

Keep in mind that the size values are always overridden by the specific resource and replica settings. i.e. if you change either of these the operator will scale up or down as requested.

https://github.com/mattermost/mattermost-operator/blob/master/pkg/apis/mattermost/v1alpha1/clusterinstallation_types.go#L30-L36

The same thing goes for the database and minio spec settings.

from mattermost-operator.

Szymongib avatar Szymongib commented on August 18, 2024

Hi @gabrieljackson,
I was thinking that the spec.Size field could be treated as a write-only field.

Setting the field would override Replicas and Resources to appropriate values no matter if they were set manually, but the field itself would not be preserved on the CR, therefore further overrides of Replicas or Resources would not be discarded and they would not be in conflict with the spec.Size field.

The Kubernetes leverages such behavior in for example Secrets, where stringData field is a write-only field that on write is merged with data and no longer present on the Secret object.

Let me know what do you think about such approach!

from mattermost-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.