Comments (4)
As you can observe in zammad/templates/statefulset.yaml, the application shares some persistent state across its containers.
Managing updates to deployments with attached volumes with access modes other than "ReadWriteMany" becomes problematic, where the new pod will only start up if it can attach the volume claim, which is never free'd by the existing pod, causing the upgrade to deadlock.
This is why Deployments are not meant for applications that maintain any persistent state, whereas the StatefulSet controller ensures that a pod with a volume attached is terminated before starting up the new one.
In addition, StatefulSetSpec contains a field for creating PersistentVolumeClaims from inside the STS spec, which conveniently concentrates configuration and removes the need to create explicit PersistentVolume/PVC objects.
For more information about the benefits of StatefulSets for applications that need to maintain internal state, please refer to https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/.
from zammad-helm.
I know of very few deployments without persistent state. If two instances running at the same time are problematic, use {strategy: {type: Recreate}}
.
With only one replica, technically you can use both StatefulSet and Deployment. So, it is mainly a documentation issue. (And I asked it mainly to understand Zammad better in order to deploy it at my company.)
With StatefulSet, you declare that your application needs distinguishable pods, with unique and stable network names and each with a distinct pesistent storage. (Or at least, one of these properties.) Like with memcached: The client chooses which memcached pod to contact. It does matter.
Once Zammad grows the ability to scale horizontally, I would have naively expected the Deployment approach: Each pod storing its persistence in PostgreSQL (with soft persistence in Elasicsearch/memcached), so that the loadbalancer does not have to worry to which pod it should route the request. It does not matter.
Which way will Zammad go?
from zammad-helm.
The usage of PVs for state is due to Zammad storing its entire source files and runtime in /opt/zammad, serving static assets from subdirectories of that path, and also not being able to store user-uploaded static assets in any external object storage or database, thus storing files inside its operations directory to remain persistent. To be honest, this could be split up to externalize such assets from the particular application but requires larger refactoring, I assume. Hence, it needs to store them locally. This again makes Zammad a stateful application, for which StatefulSets are the designated resource kind to use.
The partitioning of such uploaded static assets is what I would suspect the largest limiting factor in scaling out.
This is, to my understanding, more of a conceptual issue of Zammad itself and less of the corresponding Helm chart, which uses a StatefulSet because it solves the hassle with coupling PVCs and Pods for you.
When any state can be assumed to be external, Deployments will semantically be the right choice, but until then, StatefulSet will likely remain the best choice to counteract design shortcomings in the main application.
from zammad-helm.
Thank you for your information! I understand it now, and stay tuned for future improvements on the scaling matter.
from zammad-helm.
Related Issues (20)
- After upgrading to Helm Chart 9.0.3: "ERROR: #<Errno::EROFS: Read-only file system @ dir_s_mkdir - /opt/zammad/storage>" HOT 1
- Unable to upgrade 8.3.1 -> 9.0.0 HOT 2
- Storage path after upgrade zammad to 6.X HOT 16
- Can not add Logo at setup or in settings HOT 8
- Existing volumeclaim creates volume with wrong name HOT 7
- Cannot upload attachments - read only file system HOT 2
- Upload Failed Internal Server Error
- Locales table in PostgreSQL without any record on container creation HOT 1
- Unable to attach or mount volumes: unmounted volumes=[zammad-var] HOT 3
- Unable to restart due `elasticsearch-init` container HOT 1
- auto_wizard settings do not work HOT 3
- BUG/Enhancement - Elastic-search init container HOT 4
- Feature Request - Add ssl option to postgres HOT 11
- Elasticsearch configured in discovery mode, even though it is single-node HOT 4
- Authentication for memcached? HOT 4
- [FR] customization settings persistent file HOT 3
- customInit: Can't find config setting HOT 2
- Running zammad with `replicas > 1` HOT 14
- Missing probes for scheduler HOT 1
- Locale and Translation updates missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zammad-helm.