-
-
Notifications
You must be signed in to change notification settings - Fork 114
Added option for st2packs-PersistentVolumes to allow for seamless pack updates #160
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
Conversation
Hmm, as packs are on a PersistentVolume, no packs (or their contents) will be removed, even if packs are not present in st2packs-container anymore. So e.g.:
Case 1:
Case 2:
I've had a look on current st2actionrunner-image and found Would this be acceptable as a solution? |
Sure, |
@armab I have a question regarding your desired size of pull requests: In detail: We'd like to add the option, defaulting to current behaviour, of providing a list of st2packs-images to pull. |
@moonrail Might be temporary issue as I restarted the e2e build and it's ✔️ now. Good that you asked! Based on that data, tradeoffs, overall experience, feedback and discussions we might collectively choose with community the path forward. For instance, we definitely don't want to maintain many conflicting options for distributing st2 pack content: immutable containerized packs as is, containerized packs with persistent volumes, NFS-like approach. Having said that, this all may take time to evaluate. Hope that gives an idea. |
name: st2-venv-pvol | ||
spec: | ||
accessModes: | ||
- ReadWriteMany |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so that looks like the main point behind the implementation.
ReadWriteMany
(https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) means that some kind of network-like filesystem is still required for this to work. Does it mean it's a new possible point of failure that may affect overall availability formula?
I guess it's a hybrid between the current immutable containerized pack content approach vs mutable/dynamic way demonstrated in #118 when packs are installed in-place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering it's ReadWriteMany
volume shared between all the Pods that need it, do you think live pack install
may work in such environment as well?
I mean getting "hybrid" best from the 2 approaches when user can have all the options and satisfy all the needs:
- Installing the packs in-place with
st2 pack install
and from the UI (easiest & best experience for the majority of users - can solve a lot of community pain points as a default solution) - Optionally relying on pre-built docker images for packs (best for deployment, repeatability, versioning, availability?)
- Can do
1
or2
or both.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly - this approach requires a storageClass supporting ReadWriteMany - this should be added to README.md as well.
Hmmm, you're right - why going the container-direction on packs, that hinders from using API & UI-Pack-Handling?
Well, its the k8s way, the containerized way.
You enforce IaaC, that users strictly define their packs, versions, e.g. via code.
If you allow changes on the fly, via API/UI, there would be a "split-brain" between your code and actual installed & configured packs.
Our PR here is only aimed to improve resilience and availability by not modifying and re-creating System-Important-Containers for Packs. This leads to interrupts in the Service.
Concerning your described Approaches:
1.
Would lead to inconsistencies, but would allow to use API & UI to install/update/remove Packs.
Slower approach for sure, but more resilient as long as users are hindered from using API & UI to modify/add Packs-Contents.
Scales better for (internal) Self-Service-Deployments with several Stakeholders/Departments (Our case).
Would be somewhat OK, as long as one only handles Custom Packs (those not on Exchange) via Containers, everything else via API & UI.
I do not see how StackStorm could properly distinct between "containerized" Packs and "modifyiable" Packs for API & UI.
So this would lead to inconsistencies.
Our & My opinion:
I think there is no right or wrong answer to it.
For me personally I was confused when I saw how StackStorm handles Packs (Enterprise-UI and API), in combination with Git-Packs.
The user is able to modify Actions (Workflows) and Rules via API & UI for Git-Packs, but those will be discarded the moment, the user updates the Pack from Git.
I do see problems arising from this, so I've already planned, how I could limit Users via RBAC to not handle any resources that reside in Packs.
I would stick to building containers and would like to be able to configure an option in StackStorm itself for hindering/locking API & UI-Pack-(Un-)Installations, or Modifications to Actions, Rules altogether.
This way Packs would always be consistent with external Versions and Users could be shown a proper error message. Right now the error messages are not optimal due to simply setting Filesystem to ReadOnly :)
So either Approach 1 or 2, but not both and certainly not FreeForAll via Option 3, from my point of view.
@armab This is currently a breaking change, as What do you think of this? |
Reverted from rsync to cp command, as st2packs-runtime is based on alpine and is not shipped with it. |
@moonrail Yeah, right. Having the The situation is already pretty difficult here in |
@armab
I do not know how to modify this PR to fit your plans, please give me some hints. :) |
@moonrail It's best to keep this PR as is and so I could rely on #118 and #160 conflicting stories in future research and try to find some middle ground between them. FYI your other changes were released in If you're interested to include |
…tom pack-updates without job-impact
@armab |
Edit: I had a 5 second look, I will have a better look tonight and see if I can figure it out. @moonrail I think its erroring at chart.yaml I would say where the api version has been set to v2.. I think this has been mixed with PR #163 where I updated the charts to Helm v3 Circle CI log shows Error: 1 chart(s) linted, 1 chart(s) failed Exited with code exit status 1 |
@Christopher-Russell |
@moonrail I think a rebase against the current master branch might have this one sorted. |
Hi @moonrail Is it possible for you to use StatefulSet with persistentVolumeTemplate instead?
& it works fine until we reinstall the chart which fails with:
Or is there any way we can resuse PV with dynamic provisioning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier today, I submitted #199. I'd seen #118, but I missed this one when I was researching the earlier conversations about how to change the packs volumes.
It looks like this PR and #199 are somewhat similar. But, in #199, I opted for treating the volume definition as an opaque value, leaving the admin to manage whatever storage solution they are using in their cluster (persistentVolumeClaims, NFS, rook-ceph, or any of the other many storage solutions available now).
Maybe there's a way we could merge the two approaches so that this chart can still create persistentVolumeClaims like this one does, if an admin requests that?
Also, it looks like some of these changes in this PR have already been merged, like the packs-initContainers
and packs-volumes
templates. So, the next step might be to rebase this on master to trim it down to the core persistentVolumeClaims bits?
@cognifloyd |
Thanks for taking a look! I hope it goes forward too :) |
I will hopefully have time to test next week against AKS, I'll report back once done |
Hello altogether
we have the requirement to frequently change st2packs via various pipelines and therefore found the default solution via initContainers/Sidecar not fitting, as actionrunner, sensor & api-containers were restarted on update.
Restarts are undesirable as Executions/Workflows will be "Abandoned", so we've searched for a k8s-native solution.
This Pull Request adds the option to use two shared PersistentVolumes (one for Packs, one for VirtualEnvironments) instead of initContainers per component.
Container
job-st2-register-content
is the only Container allowed to RW onto these PVs and will register content as usual after each upgrade/install via initContainers.We've successfully updated packs and virtual environments while running Executions/Workflows and had no negative impact with this solution.
As not everybody can use PersistentVolumes and this should be held compatible to existing installations, the default pack-handling via initContainers is untouched.
Thanks to @angrydeveloper in #118 for the idea to deduplicate initContainer & Volume.
Tested with 3.3dev on kubernetes 1.17, 1.18 & 1.19.
Please let me know, if there is something to improve. :)