Current Situation
Environment variables are currently duplicated across multiple files and deployment types:
- Kubernetes manifests (deployments and jobs)
- Docker Compose files (production, development, and jobs)
- Multiple service definitions (Superset, Clickhouse, Aspects, Ralph)
For example, Superset's environment variables are duplicated in:
- K8s deployment
- K8s worker deployment
- K8s jobs
- Docker Compose base service
- Docker Compose development overrides
Problems
- Maintenance Overhead: Changes require updates in multiple places
- Risk of Inconsistency: Different environments might drift apart if updates are missed
- Poor DRY Practice: Same configuration repeated across different files
- Mixed Approaches: Some services use env_files, others use direct environment variables
Proposed Solution
- Create a centralized environment configuration structure.
- Use Kubernetes ConfigMaps and Docker Compose env_files to load these configurations
- Implement a clear override hierarchy for environment-specific settings
Benefits
- Single source of truth for configurations
- Easier maintenance and updates
- Consistent configuration across environments
- Clear separation between base and environment-specific settings
Related Files
tutoraspects/patches/k8s-deployments
tutoraspects/patches/k8s-jobs
tutoraspects/templates/base-docker-compose-services
tutoraspects/patches/local-docker-compose-*
Current Situation
Environment variables are currently duplicated across multiple files and deployment types:
For example, Superset's environment variables are duplicated in:
Problems
Proposed Solution
Benefits
Related Files
tutoraspects/patches/k8s-deploymentstutoraspects/patches/k8s-jobstutoraspects/templates/base-docker-compose-servicestutoraspects/patches/local-docker-compose-*