IGN-15047: Add Leased Licensing Terminate-Session-on-Shutdown flag#10
Open
thirdgen88 wants to merge 3 commits intoinductiveautomation:mainfrom
Open
IGN-15047: Add Leased Licensing Terminate-Session-on-Shutdown flag#10thirdgen88 wants to merge 3 commits intoinductiveautomation:mainfrom
thirdgen88 wants to merge 3 commits intoinductiveautomation:mainfrom
Conversation
This enables coalescing with leasedActivation configurations while also simplifying the statefulset template by pulling some of the logic out into helper templates. Additionally, it is also a little smarter about shared license secret objects. Backed it all up with unit tests, including enhancing some existing ones surrounding the redundancy preparation script inclusion.
f3fb617 to
5b6a444
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 Background
Ignition has a feature behind a JVM system property for attempting to terminate active leased license sessions on a graceful shutdown. Previously, you could leverage
gateway.jvmArgsvalue in the Helm Chart to add this system property. We wanted to make this easier for folks to find and enable via direct support in the chart (and have it handle applying the underlying system prop to the JVM args, similar to some of the other auto-applied args).⚙️ Changes
We had to refactor the
gateway.licensing.leasedActivationhandling, specifically adding some value coalescence for whengateway.licensing.primaryLeasedActivationandgateway.licensing.backupLeasedActivationare in use alongside the newleasedActivation.terminateSessionOnShutdownflag. This refactor involved pulling out some of the logic within the StatefulSet template YAML to new helper functions.After additional unit tests were written to support the refactor, the flag was added to inject the appropriate JVM arg when enabled. Additionally, there is deduplication for the cases where users may already be applying it via
gateway.jvmArgs.📝 Reviewer Notes
The refactor is broken out separately via 5b9bbed. The feature is much smaller in f3fb617.
☑️ QA Notes
Given the refactor, we'll probably want to work a matrix of varying combinations of
gateway.licensing.leasedActivation(and the primary/backup variants). There is now significant unit test coverage in this area, but a functional test seems prudent. It doesn't really matter what kind of license you use (it could be a Maker license, as long as it gets applied that should be all we need to validate). See Configuring Leased Activation Licensing docs page for helpful reference on creating the secret.Here is a baseline values file to get you started (you'll need to create the license secrets separately):
When this is working correctly, you should see these log entries on a clean shutdown (such as when deleting the pod):
Other ideas for testing would be to deploy two [standalone] releases of the chart. After the
ignition1release is up and running (and you can see the license successfully applied), scale it down withk scale sts ignition1-gateway --replicas=0. Then deploy theignition2chart with the same values file. If the leased license session was correctly terminated on the scale-down, theignition2gateway should successfully activate.Fixes IGN-15047