Coder Social home page Coder Social logo

Create Helm Chart for K8s Deployment about lynx HOT 11 OPEN

uvulpos avatar uvulpos commented on September 28, 2024 1
Create Helm Chart for K8s Deployment

from lynx.

Comments (11)

Clivern avatar Clivern commented on September 28, 2024

Hi @uvulpos, That makes sense indeed. My knowledge with Helm is limited so i need to check if is it better to have PostgresSQL as dependency to run inside the cluster? or shall i let the user to decide whether to use PostgreSQL from outside the cluster. Honestly i would feel much better having PostgresSQL outside the cluster. but if there is such a thing in helm to let user decide whether to have PostgresSQL inside or provide PostgresSQL connection string, I would like to go for it.

from lynx.

uvulpos avatar uvulpos commented on September 28, 2024

Hi @Clivern ,
general speaking is both possible, but it's rather common to just release your helm configuration for your applications and dependencies as postgres is managed elsewhere e.g. with an kubernetes operator. So you would need a kubernetes deployment and a service definition and place helm variables in it

from lynx.

uvulpos avatar uvulpos commented on September 28, 2024

I can do a basic pr to create the structure. We can finalize it later, but let's do an MVP first

from lynx.

Clivern avatar Clivern commented on September 28, 2024

from lynx.

ankek avatar ankek commented on September 28, 2024

Hi there, some updates from my side. K8S is not a good place to store data. There are a lot of examples with data loss. My suggestion to use external (outside of K8S) Database and store data there to avoid data loss for Production-ready environments.

from lynx.

uvulpos avatar uvulpos commented on September 28, 2024

@ankek I would agree, speaking about deploying a own database. But this is not the case and not the wanted solution. If you have already deployed an application to k3s / k8s, you most likely deployed an application with some sort of need for storage. Then you either deploy a database as stateful set on a specific node on your not-production-environment, or, if you really need to scale, there are hosted databases as elastic postgres in azure (as an example). And we only ship the application. No database. So the user is responsible for how to store that kind of data and only specify the database credentials as parameter / template values

from lynx.

ankek avatar ankek commented on September 28, 2024

@uvulpos I do not argue with you. For test cases/ scenarios of course we would need DB in helm deployment. I meant that it would be great to let the people make decisions about the DB backend and its location (inside or outside K8S).
And if we are talking about the Helm chart it makes sense to have this option from the very beginning.

from lynx.

uvulpos avatar uvulpos commented on September 28, 2024

You can just start the DB from docker compose file in root and connect to this for testing. Why do you want to deploy a db in k8s for testing purposes. Use Kubernetes inside Docker for testing

docker compose up db

from lynx.

ankek avatar ankek commented on September 28, 2024

@uvulpos Not sure that we are on the same page. By default, Lynx Helm chart could install PostgreSQL DB as a separate pod inside the K8S cluster and configure it as the default database.

However, it is common practice to allow people to use external DB within Helm deployment. As an example, WordPress CMS
I.e. allow to decide: to use an externally managed (outside of K8S) database or use the default (inside of K8S) PostgreSQL DB. In this part, I agree with Ahmed

Honestly i would feel much better having PostgresSQL outside the cluster. but if there is such a thing in helm to let user decide whether to have PostgresSQL inside or provide PostgresSQL connection string, I would like to go for it.

From my understanding, I see a lot of benefits if Lynx has such an option in the first version of Lynx Helm Chart.

Would be PostgreSQL running in Docker, as SaaS in Azure, or some other solution? It is another question.

I have no experience with Helm Chart development but can assist with K8S deployment (i.e. prepare YAML files)

from lynx.

uvulpos avatar uvulpos commented on September 28, 2024

Of course, you can define the connection string as a value in helm. There is the concept of variables. But including a database is still silly for our use case and would just mean lots of extra work.

How I mentioned: you can do a simple stateful set deployment with a single node (for playing around) and put it inside the helm chart, but we can't scale anyway and so many important features as backups or different storage providers would be missing or have no support. Also, you would waste resources if every single application would bring their own database. Lynx will never be the only application inside the cluster. It would just add tickets from unsatisfied users

Victor from DOT also explained it very well:

https://youtu.be/Ny9RxM6H6Hg?si=pgNV9cjHznlEKhav

from lynx.

uvulpos avatar uvulpos commented on September 28, 2024

When you want to deploy a database at the same time, I would recommend helmfiles

https://github.com/helmfile/helmfile

And a postgres operator

https://github.com/zalando/postgres-operator

from lynx.

Related Issues (14)

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.