-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Stateful app in kubernetes YAML files #9576
Comments
Hi @Tonterias,
As for your concern that the data is not persistent. Please keep in mind that the kube configurations we generate is only good for getting started. For production, we recommend that you use a database outside of kubernetes. However you are correct that we could move our default database configuration to StatefulSets. |
Hi Pierre, Thanks for your answer. Sorry, I'm not in my computer these days. I will send you the config files as soon as I get back or test the whole thing when the issue 9572 gets fixed. Here are the Yaml files in case they are of any help in the meantime: https://github.com/Tonterias/jhipsterpress/tree/master/k8s/TestLoadBalancer Please, can you tell me (where is) how to implement that recommendation to use a database outside of K8s? Any blog that explains that point? Before reading your answer, I thought that putting the database inside K8s was the proposed solution by Jhipster!!! What do you recommend? I am trying to finish a production version of open source Spingular.com site made with jhipster and I would like to write a blog about how I did it and explaining why I did it that way. On the other hand, I'm not sure if it is a bug. Again, thanks for your answer. I really need that solution! |
@Tonterias2 It seems that you have a monolith app so deploying on Kubernetes is going to be expensive and complex to maintain. I would recommend you use Google App Engine, we have a subgen for it ( To get back to your issue. Do you mind if we close it. The wording is not precise enough. I think we should improve our kubernetes docs because they are severely lacking. |
Thanks for your answer Pierre, Do what you think it is better. If you want me to be more precise, let me know and I will do it. No problem. I think this is the only way I can help. The subgen looks pretty difficult to me. Do you mind if I ask you if I get lost? I will follow your advice and try it. Where can I contact with you. Sorry for my English |
Please contact me directly on Twitter for help. I see that you have done a lot of work on your spingular project and written a lot of helpful documentation on it. The docs you wrote in https://github.com/Tonterias/jhipsterpress/tree/master/ReadMe would be good to contribute to the official website. Also your work project is a good Jhipster showcase. |
Thanks Pierre, I did that documentation on GitHub because it would be easier to update. Feel free to include it on the official site. It is on the showcase, I just have to modify the name from JhipsterPress to Spingular, but I need to move Spingular to Google |
Overview of the issue
Hi,
I am not sure if I spotted a bug, but I can not make this piece work and I wonder if you can make it work.
PREMISE: I am trying to deploy an jhipster app in Google Cloud Platform using the automatic kubernetes YAML files that are created by Jhipster. Right now, it deploys but as a STATELESS app. I can not think of a mayority of users who wants to deploy Jhipster (with any DB) as Stateless app. Once the db pod is dead, your data is lost. So I think that the default behaviour should be STATEFUL (so this part is also a new feature request).
Said that, I try to modify the automatic generated files to be STATEFUL and here is the posible bug. Why do you use the apiVersion: extensions/v1beta1 for the jhipster-postgresql.yml and the apiVersion: apps/v1 for the jhipster-deployment.yml since both are Deployments. As fas as I know, apps/v1 is for StatefulSets (which makes sense for the databases). On the other hand, I'm no expert on k8s but I think PersistentVolume and PersistentVolumeClaim are needed to have a Stateful app. I created a question at Stack with the case: https://stackoverflow.com/questions/55620417/kubernetes-storageclass-does-not-retain-existing-data/55622803
Anyway, do you have a example where a Statefull database works? I would love to see it.
Thanks for your great job
Motivation for or Use Case
Because every Jhipster App uses a database and if the data is not persistent there is no use in having Kubernetes deployments. Am I wrong in this?
Reproduce the error
When you delete a Pod, the new pod can not find the old database files.
Related issues
No
Suggest a Fix
Do you have a example where a Statefull database works? To demonstrate that it works. I would love to see it. But if not, then there could be a bug (or it may be a feature request) or both.
JHipster Version(s)
Version 5.8.2. I could not test with beta 6.0 cause it give another issue (but I will) #9572
JHipster configuration
Not applicable, those are the YAML files.
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryNot applicable, those are the YAML files.
Browsers and Operating System
Not applicable, those are the YAML files.
The text was updated successfully, but these errors were encountered: