Pochatkin opened a new pull request, #6384: URL: https://github.com/apache/ignite-3/pull/6384
# Bootstrap Configuration Feature Design Document ## Overview This document describes the introduction of the `--bootstrap-config` command-line option to GridGain 9, which enables users to provide read-only configuration directly as a string parameter instead of relying on configuration files. ## Background Previously, GridGain nodes could only be configured using configuration files specified via the `--config-path` option. This approach presented challenges in containerized environments, particularly with Kubernetes, where: - Configuration files might be mounted as read-only volumes - Dynamic configuration injection is limited by file system constraints - Container orchestration platforms prefer configuration-as-code approaches - Immutable infrastructure patterns require configuration to be baked into deployment descriptors ## Feature Description ### New Command Line Option The `--bootstrap-config` option allows users to provide node configuration directly as a string parameter containing HOCON (Human-Optimized Config Object Notation) formatted configuration. **Usage:** ```bash # Traditional file-based configuration java -jar gridgain-server.jar --node-name myNode --work-dir /opt/gridgain/work --config-path /path/to/config.hocon # New bootstrap configuration approach java -jar gridgain-server.jar --node-name myNode --work-dir /opt/gridgain/work --bootstrap-config "{ node: { network: { port: 3322 } } }" ``` ### Key Benefits 1. **Container-Native Configuration**: Enables seamless integration with container orchestration platforms 2. **Immutable Infrastructure**: Supports configuration-as-code practices where configuration is embedded in deployment manifests 3. **Simplified Deployment**: Eliminates the need for separate configuration file management in containerized environments 4. **Read-Only Compliance**: Works with read-only file systems and security-hardened environments ## Technical Implementation ### Configuration Architecture The implementation introduces a new abstraction layer through the `NodeConfig` interface that supports multiple configuration sources: - **File-based Configuration**: Traditional approach using `FileNodeConfig` - **Bootstrap Configuration**: New approach using `BootstrapNodeConfig` ### Command Line Interface The command line interface now uses mutually exclusive configuration options: - Either `--config-path` for file-based configuration - Or `--bootstrap-config` for inline configuration This ensures users cannot accidentally specify both options simultaneously. ### Configuration Processing The system uses a visitor pattern to handle different configuration types uniformly, allowing the same downstream processing logic to work with both file-based and bootstrap configurations. ### Configuration Storage and Persistence Bootstrap configuration works differently from file-based configuration in terms of storage and mutability: - **Vault Storage**: Bootstrap configuration is stored in the GridGain vault (persistent key-value storage) rather than in files - **Initial Population**: The bootstrap configuration string is used to populate the vault storage during node startup - **Read-Only Nature**: Bootstrap configuration cannot be modified through REST API or CLI commands once the node is started - **No File Updates**: Unlike file-based configuration, changes are not written back to any configuration files - **Restart Required**: Any configuration changes require restarting the node with a new bootstrap configuration string - **Immutable Operations**: Administrative operations that attempt to modify configuration will be rejected with appropriate error messages This design ensures consistency with containerized deployment patterns where configuration is expected to be immutable and managed through infrastructure-as-code practices. ## Use Cases ### Container Orchestration **Kubernetes Deployment:** ```yaml apiVersion: apps/v1 kind: Deployment metadata: name: gridgain-cluster spec: template: spec: containers: - name: gridgain image: gridgain/gridgain:9.x args: - --node-name=$(POD_NAME) - --work-dir=/opt/gridgain/work - --bootstrap-config={ "cluster": { "name": "my-cluster" }, "network": { "port": 3322 } } ``` ### Cloud-Native Deployments **Docker Compose:** ```yaml services: gridgain-node: image: gridgain/gridgain:9.x command: > --node-name=node1 --work-dir=/opt/gridgain/work --bootstrap-config={"cluster":{"name":"docker-cluster"},"network":{"port":3322}} ``` ### Development and Testing Developers can quickly spin up nodes with specific configurations without creating temporary configuration files, making testing and development more efficient. ## Migration Strategy ### Backward Compatibility The existing `--config-path` option remains fully supported. All existing deployments and scripts will continue to work without modification. ### Transition Path 1. **Phase 1**: Teams can evaluate the new option in development environments 2. **Phase 2**: Migrate containerized deployments to use bootstrap configuration 3. **Phase 3**: Consider transitioning production workloads based on operational requirements ## Future Enhancements ### Potential Extensions 1. **Environment Variable Integration**: Support for configuration templates with environment variable substitution 2. **Remote Configuration**: Integration with configuration management systems 3. **Configuration Encryption**: Built-in support for encrypted configuration strings 4. **Multi-Source Configuration**: Ability to combine bootstrap configuration with file-based overrides ## Conclusion The bootstrap configuration feature significantly enhances GridGain's cloud-native capabilities while maintaining full backward compatibility. It enables modern deployment patterns and simplifies configuration management in containerized environments, making GridGain more suitable for modern infrastructure and DevOps practices. This enhancement aligns with industry trends toward immutable infrastructure and configuration-as-code, positioning GridGain as a container-first data platform solution. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org