Requirements Document
Introduction
The current ingress configuration system requires hardcoded domain names and environment-specific annotations scattered across Helm values files and Kubernetes manifests. This creates maintenance overhead, environment coupling, and deployment complexity. We need an environment-aware ingress management system that automatically applies appropriate domain names, TLS configuration, and network-specific annotations based on environment context.
Glossary
- Ingress_Management_System: The automated system that transforms generic ingress definitions into environment-specific configurations using kustomize components
- Environment_Context: The deployment environment (local development, lab cluster) that determines domain and network configuration
- Generic_Ingress: An ingress resource with environment-agnostic configuration using internal service identifiers and management labels
- Environment_Component: A kustomize component that applies environment-specific transformations to ingress resources
- Domain_Template: A pattern for generating environment-specific domain names from service identifiers
- Network_Annotation: Environment-specific ingress annotations for load balancers, TLS, and routing
- Managed_Ingress: An ingress resource that is accessible via internal domain patterns (e.g., *.lab.local.ctoaas.co) and marked with
ingress.ctoaas.co/managed: "true" - Test_System: The automated testing framework that validates kustomize build outputs and ingress transformations to prevent configuration regressions
Requirements
Requirement 1
User Story: As a platform engineer, I want to define ingress resources without hardcoded domain names, so that the same configuration can be deployed across multiple environments.
Acceptance Criteria
- WHEN an ingress resource is created with a generic service identifier, THE Ingress_Management_System SHALL automatically generate the appropriate domain name for the current Environment_Context
- WHEN the same ingress configuration is deployed to different environments, THE Ingress_Management_System SHALL apply different domain suffixes based on Environment_Context
- WHEN a service identifier follows the naming convention, THE Ingress_Management_System SHALL construct predictable subdomain patterns
- WHERE an ingress specifies a custom subdomain preference, THE Ingress_Management_System SHALL respect the preference while applying environment domain suffix
- WHEN parsing service identifiers, THE Ingress_Management_System SHALL validate against the specified naming grammar
Requirement 2
User Story: As a platform engineer, I want environment-specific network annotations to be applied automatically, so that ingress resources work correctly in each deployment environment without manual configuration.
Acceptance Criteria
- WHEN an ingress is deployed to a development environment, THE Ingress_Management_System SHALL apply Traefik-specific annotations for local routing
- WHEN an ingress is deployed to the lab cluster environment, THE Ingress_Management_System SHALL apply cert-manager annotations for automatic TLS certificate provisioning
- WHEN network requirements differ between environments, THE Ingress_Management_System SHALL apply the appropriate ingress class and load balancer configuration
- WHEN TLS is required, THE Ingress_Management_System SHALL automatically configure certificate management based on Environment_Context
- WHEN ingress resources are created, THE Ingress_Management_System SHALL preserve any existing custom annotations while adding environment-specific ones
- WHEN an ingress is deployed to the lab cluster environment, THE Ingress_Management_System SHALL configure internal domain patterns (
.lab.local.ctoaas.co) - WHEN multiple domain patterns are configured, THE Ingress_Management_System SHALL create separate host rules for each domain pattern
- WHEN TLS is enabled with multiple domains, THE Ingress_Management_System SHALL include all domain variants in the certificate configuration
- WHEN local development uses nip.io domains, THE Ingress_Management_System SHALL generate appropriate
.127.0.0.1.nip.iopatterns - WHEN service names contain hyphens or special characters, THE Ingress_Management_System SHALL preserve them in the generated domain names
Requirement 3
User Story: As a developer, I want to use a simple label-based system to mark ingress resources for automatic management, so that I can focus on service logic rather than environment-specific networking details.
Acceptance Criteria
- WHEN an ingress resource includes a management label (
ingress.ctoaas.co/managed: "true"), THE Ingress_Management_System SHALL process it for environment-specific transformation - WHEN an ingress resource lacks any management label, THE Ingress_Management_System SHALL leave it unchanged
- WHEN generating domains, THE Ingress_Management_System SHALL derive the service name from the ingress metadata name
- WHEN custom subdomains are specified in placeholder hosts, THE Ingress_Management_System SHALL preserve them in the generated domain
- WHEN label values are invalid, THE Ingress_Management_System SHALL log errors and skip processing
Requirement 4
User Story: As a platform engineer, I want the system to handle both Helm-generated and direct Kubernetes ingress manifests, so that all ingress resources in the cluster follow consistent patterns regardless of their creation method.
Acceptance Criteria
- WHEN Helm charts generate ingress resources with management annotations, THE Ingress_Management_System SHALL transform them during deployment
- WHEN direct Kubernetes manifests contain ingress resources, THE Ingress_Management_System SHALL apply the same transformation rules
- WHEN ingress resources are updated, THE Ingress_Management_System SHALL reapply environment-specific configurations
- WHEN ingress resources are deleted and recreated, THE Ingress_Management_System SHALL maintain consistent domain and annotation patterns
- WHEN processing ingress resources, THE Ingress_Management_System SHALL preserve the original resource structure while adding environment-specific fields
Requirement 5
User Story: As a platform engineer, I want different environment configurations to be easily maintainable and version-controlled, so that changes to networking configuration can be tracked and deployed systematically.
Acceptance Criteria
- WHEN environment configurations are updated, THE Ingress_Management_System SHALL apply changes to new ingress resources immediately
- WHEN configuration contains syntax errors, THE Ingress_Management_System SHALL report validation failures clearly
- WHEN local development and lab cluster environments exist, THE Ingress_Management_System SHALL maintain separate configurations for each Environment_Context
- WHEN configurations are deployed, THE Ingress_Management_System SHALL validate domain templates and annotation patterns
- WHEN storing configurations, THE Ingress_Management_System SHALL encode them using YAML format for version control compatibility
Requirement 6
User Story: As a platform engineer, I want to configure multiple paths per ingress resource, so that a single service can handle different endpoints with different backend services.
Acceptance Criteria
- WHEN an ingress configuration specifies multiple paths, THE Ingress_Management_System SHALL create path rules for each specified path and backend service combination
- WHEN multiple paths are configured for the same host, THE Ingress_Management_System SHALL include all paths in the same ingress resource
- WHEN different paths point to different services, THE Ingress_Management_System SHALL configure appropriate backend service references for each path
- WHEN path types are specified (Prefix, Exact), THE Ingress_Management_System SHALL apply the correct pathType for each path rule
- WHEN multiple paths are used with TLS, THE Ingress_Management_System SHALL configure TLS for the host covering all paths
Requirement 7
User Story: As a platform engineer, I want to manage ingress resources with a simple label-based system, so that all managed services get consistent internal domain access without manual configuration.
Acceptance Criteria
- WHEN an ingress resource has the label
ingress.ctoaas.co/managed: "true", THE Ingress_Management_System SHALL configure it with internal domain access only - WHEN a managed ingress is processed, THE Ingress_Management_System SHALL create host rules only for internal domain patterns (e.g., *.lab.local.ctoaas.co)
- WHEN an ingress resource lacks the management label, THE Ingress_Management_System SHALL leave it unchanged
- WHEN TLS is configured for a managed ingress, THE Ingress_Management_System SHALL include only the internal domain in the certificate configuration
Requirement 8
User Story: As a developer, I want automatic TLS certificate management for production environments, so that services are secure by default without manual certificate configuration.
Acceptance Criteria
- WHEN an ingress is deployed to the lab cluster environment, THE Ingress_Management_System SHALL automatically configure TLS termination
- WHEN TLS is enabled, THE Ingress_Management_System SHALL generate appropriate certificate secret names based on domain patterns
- WHEN certificate issuers are available, THE Ingress_Management_System SHALL apply the correct issuer annotations for the Environment_Context
- WHEN TLS configuration is applied, THE Ingress_Management_System SHALL ensure certificate secrets are properly referenced
- WHEN development environments are used, THE Ingress_Management_System SHALL optionally disable TLS for simplified local testing
Requirement 9
User Story: As a platform engineer, I want automated unit tests for kustomize build outputs, so that ingress configuration regressions are caught before deployment and I can ensure consistent ingress transformations across all overlays.
Acceptance Criteria
- WHEN kustomize builds are executed for any overlay, THE Test_System SHALL validate that ingress resources are correctly transformed according to environment configuration
- WHEN ingress resources have management labels, THE Test_System SHALL verify that domain transformations match expected patterns for each environment
- WHEN TLS is configured in an environment, THE Test_System SHALL validate that certificate configurations include all required domains
- WHEN testing ArgoCD ingress configurations, THE Test_System SHALL verify internal domain patterns are present in lab overlay builds
- WHEN testing Backstage ingress configurations, THE Test_System SHALL verify internal domain patterns are present in overlay builds
- WHEN testing Kargo ingress configurations, THE Test_System SHALL verify hardcoded domain patterns remain unchanged (no management labels)
- WHEN kustomize build tests are executed, THE Test_System SHALL run as part of continuous integration to prevent regression deployment
- WHEN test failures occur, THE Test_System SHALL provide clear error messages indicating which ingress configurations are incorrect
- WHEN new overlays are added, THE Test_System SHALL automatically include them in the test suite without manual configuration
- WHEN the chart is consumed from external repositories, THE Test_System SHALL validate chart functionality across different repository contexts and git-based import methods
Future Scope
The following requirements are planned for future implementation but are currently out of scope:
Public Domain Access (Future)
User Story: As a platform engineer, I want to distinguish between private and public ingress resources, so that only designated services are exposed externally while maintaining internal accessibility for all managed services.
Future Acceptance Criteria
- WHEN an ingress resource has the label
ingress.ctoaas.co/managed-public: "true", THE Ingress_Management_System SHALL configure it as a Public_Ingress with both internal and external domain access - WHEN a Public_Ingress is processed, THE Ingress_Management_System SHALL create host rules for both internal and external domain patterns (e.g., *.lab.local.ctoaas.co and *.lab.ctoaas.co)
- WHEN TLS is configured for a Public_Ingress, THE Ingress_Management_System SHALL include both internal and external domains in the certificate configuration
- WHEN an ingress resource has both private and public management labels, THE Ingress_Management_System SHALL treat it as a Public_Ingress and log a warning about conflicting labels
External Domain Configuration (Future)
User Story: As a platform engineer, I want external domain access for user-facing applications, so that services can be accessed from outside the internal network.
Future Acceptance Criteria
- WHEN an ingress is deployed to the lab cluster environment, THE Ingress_Management_System SHALL optionally configure external domain patterns (
.lab.ctoaas.co) for public ingresses - WHEN external domain patterns are configured, THE Ingress_Management_System SHALL create separate host rules for both internal and external domains
- WHEN TLS is enabled with dual domains, THE Ingress_Management_System SHALL include both internal and external domains in the certificate configuration