Naming Conventions
Purpose: Define consistent naming patterns for all files, resources, and identifiers in the urbalurba-infrastructure project.
Principle: Predictable names enable automation and make the codebase easier to navigate.
File Naming Conventions
Manifest Files (manifests/*.yaml)
Pattern: NNN-component-type.yaml
Number Ranges:
- 000-029: Core infrastructure (storage, ingress, DNS, networking)
- 030-039: Monitoring and observability
- 040-069: Data services (databases, caches, message queues)
- 070-079: Authentication and authorization
- 080-099: Reserved for future core services
- 200-229: AI and ML services
- 230-299: Application services
- 600-799: Management and admin tools
- 800-899: Development and testing
- 900-999: Reserved for custom/experimental
Type Suffixes:
-config.yaml- Helm values configuration-ingressroute.yaml- Traefik IngressRoute definition-configmap.yaml- Kubernetes ConfigMap-secret.yaml- Kubernetes Secret (never committed)-dashboards.yaml- Grafana dashboard ConfigMaps
Examples:
030-prometheus-config.yaml # Prometheus Helm values
031-tempo-config.yaml # Tempo Helm values
032-loki-config.yaml # Loki Helm values
033-otel-collector-config.yaml # OTEL Collector Helm values
034-grafana-config.yaml # Grafana Helm values
035-grafana-dashboards.yaml # Installation test dashboards
036-grafana-sovdev-verification.yaml # sovdev-logger verification dashboard
037-grafana-loggeloven-dashboards.yaml # Loggeloven test suite
038-grafana-ingressroute.yaml # Grafana UI ingress
039-otel-collector-ingressroute.yaml # OTEL ingress
040-postgresql-config.yaml # PostgreSQL
041-mysql-config.yaml # MySQL
042-mongodb-config.yaml # MongoDB
043-redis-config.yaml # Redis
070-authentik-config.yaml # Authentik SSO
071-authentik-blueprints.yaml # Authentik user/group definitions
076-authentik-csp-middleware.yaml # CSP headers middleware
200-openwebui-config.yaml # OpenWebUI
201-ollama-config.yaml # Ollama
202-litellm-config.yaml # LiteLLM
Numbering Rules:
- Main component gets base number (e.g., 030 for Prometheus)
- Related configs use sequential numbers (031, 032, 033...)
- IngressRoutes use component's number + 8 (e.g., Grafana=034, Ingress=038)
- Dashboards use component's number + variations (035, 036, 037)
- Leave gaps for future expansion within each range
Ansible Playbooks (ansible/playbooks/*.yml)
Pattern: NNN-action-component.yml
Number: Must match corresponding manifest file number
Actions:
setup-- Deploy/install componentremove-- Uninstall/delete componentupdate-- Modify existing componenttest-- Verification/testing playbook
Examples:
030-setup-prometheus.yml # Deploys using manifests/030-prometheus-config.yaml
030-remove-prometheus.yml # Removes Prometheus
031-setup-tempo.yml # Deploys using manifests/031-tempo-config.yaml
031-remove-tempo.yml # Removes Tempo
033-setup-otel-collector.yml # Deploys OTEL Collector
033-remove-otel-collector.yml # Removes OTEL Collector
034-setup-grafana.yml # Deploys Grafana
034-remove-grafana.yml # Removes Grafana
Pattern Rules:
- Setup playbook references external manifest via
values_files: ["{{ config_file }}"]or-f {{ config_file }} - Remove playbook just removes Helm chart
- Number MUST match manifest file (030 playbook uses 030 manifest)
- Never use inline Helm values - always reference external manifest
Shell Scripts (provision-host/kubernetes//)
Pattern: NN-action-component.sh
Script Number: Sequential within directory (01, 02, 03...)
Actions: Same as playbooks (setup-, remove-, update-, test-)
Relationship to Playbooks:
- Script number is independent of playbook number
- Script wraps Ansible playbook call
- Script provides proper context and parameters
Examples:
provision-host/kubernetes/11-monitoring/not-in-use/
├── 00-setup-all-monitoring.sh # Orchestrates all setup scripts
├── 00-remove-all-monitoring.sh # Orchestrates all remove scripts
├── 01-setup-prometheus.sh # Calls ansible/playbooks/030-setup-prometheus.yml
├── 01-remove-prometheus.sh # Calls ansible/playbooks/030-remove-prometheus.yml
├── 02-setup-tempo.sh # Calls ansible/playbooks/031-setup-tempo.yml
├── 02-remove-tempo.sh # Calls ansible/playbooks/031-remove-tempo.yml
├── 03-setup-loki.sh # Calls ansible/playbooks/032-setup-loki.yml
├── 03-remove-loki.sh # Calls ansible/playbooks/032-remove-loki.yml
├── 04-setup-otel-collector.sh # Calls ansible/playbooks/033-setup-otel-collector.yml
├── 04-remove-otel-collector.sh # Calls ansible/playbooks/033-remove-otel-collector.yml
├── 05-setup-grafana.sh # Calls ansible/playbooks/034-setup-grafana.yml
└── 05-remove-grafana.sh # Calls ansible/playbooks/034-remove-grafana.yml
Script Content Pattern:
#!/bin/bash
# Description of what this script does
# Check if target host provided
if [ -z "$1" ]; then
echo "Usage: $0 <target_host>"
exit 1
fi
TARGET_HOST="$1"
# Call Ansible playbook
ansible-playbook /mnt/urbalurbadisk/ansible/playbooks/030-setup-prometheus.yml \
-e "target_host=${TARGET_HOST}"
Directory Structure
Pattern: Numbered directories for deployment order
Examples:
provision-host/kubernetes/
├── 00-system/ # Core system setup
├── 01-storage/ # Storage provisioners
├── 02-ingress/ # Traefik ingress
├── 03-dns/ # DNS services
├── 11-monitoring/ # Monitoring stack
│ └── not-in-use/ # Testing/development area
├── 12-databases/ # Database services
├── 13-auth/ # Authentication services
└── 20-applications/ # Application deployments
Rules:
- Two-digit prefix for ordering
- Descriptive name after number
not-in-use/subdirectory for scripts under development
Kubernetes Resource Naming
Namespaces
Pattern: lowercase-descriptive
Examples:
monitoring # Monitoring stack (Prometheus, Grafana, Loki, Tempo, OTEL)
databases # Database services
authentik # Authentik SSO
openwebui # OpenWebUI and AI services
kube-system # Kubernetes system (default)
traefik # Traefik ingress controller
Rules:
- Single word or hyphenated
- All lowercase
- Descriptive of purpose
- No version numbers
Helm Release Names
Pattern: component-name
Examples:
prometheus # Prometheus monitoring
tempo # Tempo tracing
loki # Loki log aggregation
otel-collector # OpenTelemetry Collector
grafana # Grafana visualization
authentik # Authentik SSO
openwebui # OpenWebUI
Rules:
- Match component name
- Lowercase with hyphens
- No namespace prefix (namespace is separate)
- Use official chart name when possible
ConfigMap Names
Pattern: component-purpose or component-purpose-generated
Examples:
grafana-dashboards-installation # Installation test dashboards
grafana-dashboards-sovdev # sovdev-logger verification
grafana-dashboards-loggeloven # Loggeloven test suite
otel-collector-config # OTEL Collector configuration
Rules:
- Start with component name
- Add descriptive suffix
- Use
-generatedsuffix for auto-generated content - All lowercase with hyphens
IngressRoute Names
Pattern: component or component-variant
Examples:
grafana # Grafana UI ingress
otel-collector # OTEL Collector ingress
prometheus # Prometheus UI ingress (if needed)
authentik # Authentik SSO ingress
whoami-protected # Test service with auth
whoami-public # Test service without auth
Rules:
- Match component name
- Add variant suffix if multiple routes for same component
- Use descriptive suffixes:
-protected,-public,-api,-ui
Git and Version Control
Branch Names
Pattern: type/description
Types:
feature/- New feature developmentfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringtest/- Testing changes
Examples:
feature/monitoring-stack-migration
feature/sovdev-logger-integration
fix/authentik-csp-headers
docs/development-workflow
refactor/monitoring-030-039
Rules:
- Lowercase with hyphens
- Descriptive but concise
- Type prefix required
- No ticket numbers (use PR description)
Commit Messages
Pattern:
<type>: <subject>
<body>
<footer>
Types:
feat:- New featurefix:- Bug fixdocs:- Documentationrefactor:- Code refactoringtest:- Testschore:- Maintenance
Examples:
feat: Add sovdev-logger TypeScript implementation
- Multi-transport architecture (Console + File + OTLP)
- Smart defaults for production vs development
- Full Loggeloven compliance with credential filtering
Closes #123
---
fix: OTLP collector ingress Host header routing
Add missing Host header to OTEL Collector IngressRoute
to enable proper Traefik routing for external OTLP ingestion.
---
docs: Create development workflow rules
Add docs/rules-development-workflow.md explaining
Claude Code vs manual workflows and path conventions.
Rules:
- Subject line: 50 chars max, imperative mood, no period
- Body: Wrap at 72 chars, explain what and why
- Footer: Reference issues/PRs
- Use type prefix
Summary
Key Principles:
- ✅ Numbers indicate deployment order and relationships
- ✅ Manifest number = Playbook number (030 manifest → 030 playbook)
- ✅ Scripts are sequential within directory (01, 02, 03...)
- ✅ All lowercase with hyphens for most names
- ✅ Descriptive suffixes for variants (-config, -ingressroute, -dashboards)
- ✅ Leave gaps in numbering for future expansion
- ✅ External manifest files, never inline Helm values
- ✅ Consistent patterns across all file types
When adding new components:
- Choose appropriate number range
- Create manifest file with proper suffix
- Create matching Ansible playbooks (setup + remove)
- Create shell script wrappers
- Follow established patterns
- Leave room for related components
Reference:
- doc/rules-development-workflow.md - Workflow and command execution
- doc/rules-automated-kubernetes-deployment.md - Ansible patterns (to be created)
- doc/rules-ingress-traefik.md - IngressRoute patterns (to be created)