Skip to content

IGN-15047: Add Leased Licensing Terminate-Session-on-Shutdown flag#10

Open
thirdgen88 wants to merge 3 commits intoinductiveautomation:mainfrom
thirdgen88:IGN-15047-add-leased-session-termination
Open

IGN-15047: Add Leased Licensing Terminate-Session-on-Shutdown flag#10
thirdgen88 wants to merge 3 commits intoinductiveautomation:mainfrom
thirdgen88:IGN-15047-add-leased-session-termination

Conversation

@thirdgen88
Copy link
Copy Markdown
Member

@thirdgen88 thirdgen88 commented Apr 2, 2026

📖 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.jvmArgs value 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.leasedActivation handling, specifically adding some value coalescence for when gateway.licensing.primaryLeasedActivation and gateway.licensing.backupLeasedActivation are in use alongside the new leasedActivation.terminateSessionOnShutdown flag. 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):

commissioning:
  edition: standard
  acceptIgnitionEULA: true
  disableQuickstart: true

gateway:

  # Test 1 - Standalone configuration
  licensing:
    leasedActivation:
      secretName: my-leased-license
      terminateSessionOnShutdown: true
  # END Test 1

  # # Test 2 - Redundancy configuration
  # licensing:
  #   primaryLeasedActivation:
  #     secretName: my-leased-license1
  #   backupLeasedActivation:
  #     secretName: my-leased-license2
  #   leasedActivation:
  #     terminateSessionOnShutdown: true
  # # END Test 2

  env:
    GATEWAY_ADMIN_PASSWORD: nimda

certManager:
  enabled: true

When this is working correctly, you should see these log entries on a clean shutdown (such as when deleting the pod):

...
jvm 1    | 2026/04/02 23:02:45 | I [g.ShutdownManager             ] [23:02:45.396]: Starting async shutdown against 1 hooks... 
...
jvm 1    | 2026/04/02 23:02:45 | I [c.i.i.g.l.LeasedActivationStrategy] [23:02:45.948]: Successfully terminated session 
...

Other ideas for testing would be to deploy two [standalone] releases of the chart. After the ignition1 release is up and running (and you can see the license successfully applied), scale it down with k scale sts ignition1-gateway --replicas=0. Then deploy the ignition2 chart with the same values file. If the leased license session was correctly terminated on the scale-down, the ignition2 gateway should successfully activate.

Fixes IGN-15047

@thirdgen88 thirdgen88 added the feature Release notes label indicating a newly added feature label Apr 2, 2026
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.
@thirdgen88 thirdgen88 force-pushed the IGN-15047-add-leased-session-termination branch from f3fb617 to 5b6a444 Compare April 20, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Release notes label indicating a newly added feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant