Component C28 – Kustomize
By Raj Marni. March 23, 2025. Revised. Version: 0.1.06
1. Overview
C28 – Kubernetes Kustomize is responsible for applying environment-specific customizations to the base Kubernetes manifests (typically generated by C24 – Helm Chart Artifact) in the k8or Orbit ecosystem. Kustomize provides a flexible, declarative approach to managing Kubernetes configurations without modifying the original Helm charts. This enables the customization of deployments across multiple environments (dev, test, prod) without creating separate sets of YAML files.

2. Internal Architecture
2.1 Core Modules
Base Manifest Handler
Function: Manages the base Kubernetes manifests, which are typically generated by C24 as Helm charts or provided directly as templates.
Process:
Retrieves the base Helm chart or Kubernetes YAML files.
Ensures that these base resources are consistent and are properly formatted before any customization is applied.
Overlay Engine
Function: Allows environment-specific modifications by applying overlays on top of the base manifests.
Process:
Receives overlays from environment configuration files (for dev, test, or prod).
Applies changes like replica scaling, environment variable overrides, and resource limits to base resources.
Keeps overlays separate, allowing easy management of multiple environments.
Uses patch files (YAML) to adjust properties in the base manifests.
Resource Generator
Function: Generates Kubernetes resources from the overlaid and customized manifests.
Process:
Combines base and overlay files to generate a final, environment-specific set of Kubernetes resources (e.g., Deployments, Services, ConfigMaps).
Outputs the final YAML files that can be directly applied to Kubernetes clusters.
Validation & Consistency Checker
Function: Ensures that the final, customized manifests are valid, properly formatted, and adhere to Kubernetes best practices.
Process:
Validates that all required fields (e.g., replicas, ports, environment variables) are set properly in the final generated manifests.
Checks for compatibility between the base and overlay files, making sure that the overlays don't conflict with the base resources.
CLI/API Interface
Function: Provides a command-line interface (CLI) or API for users to interact with the Kustomize component.
Process:
Accepts requests for generating the customized manifests based on the current environment.
Supports features like "kustomize build" to generate YAML files, "kustomize edit" to modify base/overlay files, and "kustomize apply" to deploy resources directly to the cluster.
3. External Interactions
3.1 Interactions with k8or Orbit Components
From C24 – Helm Chart Artifact
Purpose:
C28 takes the Helm chart artifacts generated by C24 as its base manifests for further customization.
The Helm charts contain Kubernetes resource templates that need to be adjusted based on the environment (e.g., dev, test, prod).
Mechanism:
The base Helm chart files (in YAML format) are fetched from C24 for the customization process, and C28 applies overlays and environment-specific settings to these files.
To C8 – K8or Portal
Purpose:
C28 receives environment-specific inputs and configuration requests from the K8or Portal (C8).
Users interact with the portal to specify deployment environments (dev, test, prod), which are passed to C28 for manifest generation.
Mechanism:
The K8or Portal sends environment data, and C28 applies the necessary overlays to the base manifests for the specific environment.
To C12 – Manifestor
Purpose:
The Manifestor (C12) may trigger the customization process if it needs to generate manifests based on image data or additional deployment settings.
C28 can be invoked by the Manifestor to apply environment-specific changes to the Helm charts.
Mechanism:
C12 hands off the necessary metadata and image references to C28, which applies them to the base manifests.
To C20 – Chart Store
Purpose:
After C28 customizes the Helm charts, it can push these final, environment-specific charts back to the Chart Store (C20) for storage and versioning.
This ensures that the customized charts are available for future use in deployment or scaling operations.
Mechanism:
Once the overlay is applied, C28 stores the final manifest in C20, tagging it for the relevant environment (e.g., dev, test, prod).
4. Technology & Protocols
Kubernetes Manifests:
Kustomize uses Kubernetes YAML files and modifies them based on environment-specific overlays, providing a declarative method to customize resources without changing the base templates.
Patch Files:
Kustomize relies on patches (in YAML format) to modify existing resource definitions. The patching system is flexible and enables different values for different environments while maintaining a central template.
API Integration:
Kustomize can be integrated via RESTful API calls from other components (e.g., C8 or C12) to automatically generate or apply manifests programmatically.
5. Benefits & Impact
Environment-Specific Customization
C28 allows Kubernetes manifests to be customized for different environments (dev, test, prod) while maintaining the same base template, ensuring consistency across environments.
Seamless Integration with CI/CD
The ability to automate the customization of Helm charts as part of CI/CD pipelines ensures that the right configurations are always applied to the correct environment during deployment.
Minimizing Configuration Drift
By separating base configurations from environment-specific overlays, C28 ensures that different environments use the same underlying templates, reducing configuration drift and making it easier to maintain consistency.
Reduced Complexity in Multi-Environment Management
Instead of managing separate YAML files for each environment, C28 allows you to define overlays that adjust base templates dynamically. This greatly simplifies the configuration management process across multiple environments.
Flexible, Declarative Configuration
Kustomize's declarative nature allows teams to easily see the changes and track the environment-specific differences in configuration, making it easy to maintain and audit Kubernetes manifests over time.
Last updated