happy-keyboard-52115
08/01/2025, 8:54 AMmaster/
(central components) and fleet/
(edge components) folders
β’ Need dev/prod environments running on the same physical clusters (resource constraints)
β’ Want GitOps workflow: work on develop
branch β merge to main
for production
The Problem: When merging develop
β main
, we get conflicts because environment-specific configs (NodePorts, namespaces, experiment names) differ between environments:
yaml
# develop branch: nodePort: 30500
# main branch: nodePort: 31500
# After merge: π₯ CONFLICT!
Solution 1: Using Fleet's base + overlays pattern:
master/
βββ base/ # Common resources (identical in both branches)
β βββ deployments/
β βββ internal-services/
βββ overlays/
β βββ development/ # Dev-specific configs (ports 30xxx)
β βββ production/ # Prod-specific configs (ports 31xxx)
βββ fleet.yaml
Solution 1bis: Fleet's base = production and overlays apply changes only for development:
Easier to manage and to implement
main branch (Production):
βββ base/ # Production configs (default/stable)
β βββ deployments/
β βββ services/
βββ fleet.yaml # No overlays needed
develop branch (Development):
βββ base/ # Same production configs
βββ overlays/development/ # Dev-specific overrides only
β βββ dev-configs.yaml # Different ports, namespaces, etc.
βββ fleet.yaml # Uses development overlays
4 GitRepo resources total (master-dev, master-prod, fleet-dev, fleet-prod) pointing to different branches and using different overlays.
Handling Fleet.yaml Merge Conflicts: Using .gitattributes
with merge=ours
to automatically keep production fleet.yaml during merges:
# .gitattributes
*/fleet.yaml merge=ours
This ensures when merging develop
β main
, Git automatically keeps the main branch fleet.yaml (production config) and discards the develop branch version.
Questions:
1. Is one of this solution the right approach for our use case? base=prod + overlay=dev approach a Fleet best practice?
2. Any issues with our .gitattributes merge=ours
strategy for fleet.yaml files?
3. Any better patterns for same-cluster dev/prod separation?
4. Best practices for managing environment-specific configs in Fleet?
5. Alternative solutions we should consider?
We're fairly new to Fleet, so any guidance from experienced users would be greatly appreciated! π
Thanks in advance!witty-honey-18052
08/11/2025, 4:55 PM