This repository contains the complete infrastructure-as-code (IaC) implementation for KL.NAVI, featuring:
- Multi-environment deployment (Local/Production)
- Kubernetes cluster management via ArgoCD (GitOps)
- Infrastructure provisioning with Terraform
TOOLS REQUIRED:
-
docker-compose setup:
- Git
- Docker v20.10+
-
kubernetes setup:
- ArgoCD CLI v2.4+
- kubectl v1.25+
- Terraform v1.3+
- Packer v1.8+
CLOUD REQUIREMENTS:
- Registered domain name for production
- S3-compatible storage for graph files
- Hetzner Cloud account with API token (Only for Kubernetes setup)
- Clone repository:
git clone https://github.com/goat-community/klnavi.git
cd klnavi
- Create environment file:
cp env_example .env
Edit .env with your local values
- Start services (prod):
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
Access endpoints:
OTP Standard: http://otp.localhost/pedestrian/standard
Digitransit UI: http://app.localhost
- Prepare infrastructure:
cd terraform
terraform init -backend-config=backend.conf
terraform apply -var-file="terraform.tfvar
- Configure ArgoCD:
argocd login <ARGOCD_SERVER_URL>
argocd app create -f argocd/apps/klnavi/base/kustomization.yml
argocd app sync klnavi
- Verify deployment:
kubectl get pods -n klnavi
├── argocd/ # ArgoCD application manifests
│ └── apps/klnavi/
│ ├── base/ # Base configurations for all environments
│ └── overlays/prod/ # Production-specific overrides
├── terraform/ # Infrastructure-as-Code definitions
│ ├── main.tf # Primary cluster configuration
│ └── extra-manifests/ # Kubernetes CRDs and operators
├── docker-compose.yml # Local development setup
├── docker-compose.prod.yml # Production-like local setup
└── packer/ # OS image builds for Hetzner
- Download GTFS feeds from VRN and GTFS.de
- Process with OpenTripPlanner builder
- Upload graph.obj to cloud storage
- Update router-config.json files
- ArgoCD automatically deploys updates
Local -> Commit to main branch -> ArgoCD sync -> Production rollout