feat: introduce environment-aware JVM resource profiles#138
Open
RustamSheoran wants to merge 2 commits into
Open
feat: introduce environment-aware JVM resource profiles#138RustamSheoran wants to merge 2 commits into
RustamSheoran wants to merge 2 commits into
Conversation
- Introduce layered Helm composition for PH-EE (base + profile overlays) - Implement host-RAM auto-detection (Micro < 8GB, Std 8-32GB, Perf > 32GB) - Switch to container-aware JVM ergonomics (-XX:MaxRAMPercentage=75.0) - Leverage JVM internal ergonomics for auto-GC selection based on K8s limits - Fix Helm list-merging risks by isolating overlays to map-based resources - Resolve DMP 2026 Issue openMF#103
Contributor
|
👋 Hi @RustamSheoran — thank you for your pull request. This PR is currently blocked because we do not have a Contributor License Agreement (CLA) on file for your GitHub account. To get unblocked:
|
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.
Overview
This PR introduces environment-aware JVM and Kubernetes resource profiles for PH-EE deployments in Mifos Gazelle.
The current deployment configuration relies heavily on static JVM sizing and duplicated service-level heap configuration, despite Gazelle targeting deployment environments with dramatically different runtime characteristics:
constrained Raspberry Pi / ARM systems
single-node VM deployments
larger multi-node Kubernetes clusters
This PR introduces a profile-driven deployment model (
micro/std/perf) with container-aware JVM ergonomics and layered Helm configuration composition to improve deployment portability, operational safety, and maintainability.Key Changes
Environment-Aware Deployment Profiles
Introduces layered PH-EE deployment profiles:
microstdperflocated under:
These overlays provide environment-specific Kubernetes resource requests/limits while preserving compatibility with existing deployment flows.
Automatic Profile Resolution
Adds automatic profile selection logic based on detected host memory:
Profile | Detected RAM -- | -- micro | < 8GB std | 8GB – 32GB perf | > 32GBProfile selection remains overrideable and defaults safely when overlays are unavailable.
Implemented in:
Container-Aware JVM Ergonomics
Replaces hardcoded JVM heap sizing (
-Xms/-Xmx) with container-aware JVM ergonomics:This allows JVM heap allocation to scale dynamically according to Kubernetes resource limits instead of relying on static service-specific heap sizing.
Additional JVM cleanup includes:
removal of duplicated hardcoded GC configuration
removal of duplicated heap sizing fragments
preservation of existing service-level overrides where required
Helm Merge Safety Improvements
During implementation, a critical Helm merge issue was identified:
Helm replaces YAML lists rather than deep-merging them.
Injecting
JAVA_TOOL_OPTIONSthrough profile overlays would have overwritten existingdeployment.extraEnvsdefinitions and silently removed critical configuration values (AWS credentials, S3 configuration, service-specific env vars, etc.).To avoid this:
JVM ergonomics are now centralized in base configuration
overlays only modify map-based resource structures and scalar overrides
existing environment lists remain fully preserved
This significantly reduces deployment risk and improves long-term maintainability.
Files Modified
Added
config/profiles/phee/micro.yamlconfig/profiles/phee/std.yamlconfig/profiles/phee/perf.yamlUpdated
config/ph_values.yamlsrc/environmentSetup/helpers.shsrc/deployer/phee.shsrc/commandline/commandline.shValidation
Validated:
shell syntax (
bash -n)profile fallback behavior
Helm overlay merge safety
backwards compatibility with existing deployment flow
JVM/container resource alignment
preservation of existing environment variables
Operational Impact
This PR improves:
deployment portability across hardware classes
JVM behavior under Kubernetes cgroup limits
maintainability of PH-EE runtime configuration
operational consistency across environments
resource safety for constrained deployments
deployment ergonomics for future scaling/profiling work
Related
Addresses DMP 2026 JVM optimization work / Issue #103.