This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository manages home infrastructure services deployed to a Kubernetes cluster using Helmfile. The infrastructure is hosted on mbcaas and uses nginx proxies to route traffic to internal services.
The repository uses a modular Helmfile structure:
helmfile.yaml- Main deployment orchestrator with environment and release definitions- Defines default environment with secrets loading
- Uses YAML anchors for DRY configuration
modules/*.gotmpl- Go template files for service-specific configurations (home-assistant, frigate)- Templates are evaluated by Helmfile with access to environment secrets
secrets.sops.yaml- Encrypted secrets managed with SOPS (age encryption)michalski.fr-cert.yaml- Certificate management via cert-manager
Each service follows a common pattern:
- Uses bitnami/nginx chart as a reverse proxy
- Proxies requests to backend services (defined in secrets)
- Exposes via Traefik ingress with TLS termination
- Uses external-dns for automatic DNS configuration
- WebSocket support through nginx upgrade header handling
All services:
- Deploy to the
homenamespace - Share the
michalski.fr-certTLS certificate (wildcard cert) - Use
ipv4.mbcaas.comas external-dns target - Have health checks at
/nginx-health
helmfile applyhelmfile apply --selector name=home-assistant
helmfile apply --selector name=frigatehelmfile diffhelmfile syncSecrets are encrypted using SOPS with age encryption. To edit:
sops secrets.sops.yamlThe .sops.yaml configuration file defines the age key used for encryption.
kubectl apply -f michalski.fr-cert.yamlHelmfile uses a default environment that loads secrets from secrets.sops.yaml. The secrets are available in .gotmpl files via {{ .Values.secrets.service_name.key }} syntax.
Each module in modules/*.gotmpl is a Go template file that defines:
- Ingress configuration (hostname, TLS, annotations) - uses templated values from secrets
- Resource limits and requests
- Custom nginx serverBlock with proxy configuration
- Service-specific proxy_pass target (templated from secrets)
The secrets.sops.yaml file contains nested structure:
secrets.home_assistant.domain- Domain for Home Assistantsecrets.home_assistant.proxy_pass- Backend URL for Home Assistantsecrets.frigate.domain- Domain for Frigatesecrets.frigate.proxy_pass- Backend URL for Frigate
All services use Traefik ingress with:
traefik.ingress.kubernetes.io/router.entrypoints: websecure- HTTPS onlyexternal-dns.alpha.kubernetes.io/target: "ipv4.mbcaas.com"- DNS automation- Shared wildcard certificate from cert-manager
- helmfile - Kubernetes deployment orchestration
- sops - Secret encryption/decryption
- age - Encryption key management (for sops)
- kubectl - Kubernetes CLI access
- Kubernetes cluster with:
- Traefik ingress controller
- cert-manager with
letsencryptClusterIssuer - external-dns configured