Internal Components
LoKO includes five internal components that provide core infrastructure services.
Overview
Section titled “Overview”| Component | Purpose | Can Disable? |
|---|---|---|
| dnsmasq | In-cluster DNS for local domain resolution | ❌ No (required) |
| HAProxy | TCP/UDP port forwarding and load balancing | ❌ No (required) |
| Traefik | Ingress controller and reverse proxy | ❌ No (required) |
| metrics-server | Kubernetes metrics collection | ✅ Yes |
| Zot | OCI registry with optional mirroring | ✅ Yes |
dnsmasq
Section titled “dnsmasq”Host-level DNS resolution using a dedicated dnsmasq container managed by LoKO.
Features
Section titled “Features”- Dynamic DNS records: Regenerated from current workloads and system endpoints
- Host-level service: Runs as a container on your machine, not as an in-cluster operator
- Split-domain resolver integration: LoKO configures
/etc/resolver/<domain>(macOS) or Linux resolver backends - Predictable port model: Uses
network.dns-port(auto-selected, preferring5453)
How It Works
Section titled “How It Works”- LoKO generates
dnsmasq.confwith host records for enabled workloads and internal endpoints - A dnsmasq container is created on the LoKO Docker network and binds
network.ip:network.dns-port - Your OS resolver forwards
<domain>queries to that dnsmasq endpoint - dnsmasq returns your configured local IP for matching hostnames
dnsmasq Configuration
Section titled “dnsmasq Configuration”Version managed via Renovate:
components: dnsmasq: # renovate: datasource=docker depName=dockurr/dnsmasq version: "2.91"Accessing DNS Status
Section titled “Accessing DNS Status”# Check DNS container statusloko dns status
# Check DNS logsloko logs dns
# Run DNS diagnosticsloko config dns-checkHAProxy
Section titled “HAProxy”High-performance TCP/UDP load balancer and port forwarder.
HAProxy Features
Section titled “HAProxy Features”- TCP/UDP Forwarding: Routes external ports to cluster services
- Dynamic Configuration: Automatically updated based on workload ports
- Load Balancing: Distributes traffic across multiple backends
- Health Checks: Monitors backend availability
HAProxy Role
Section titled “HAProxy Role”HAProxy is the required port forwarder for LoKO and cannot be disabled. It provides:
- Port forwarding from host to Kubernetes cluster
- TCP routing for databases (PostgreSQL, MySQL, MongoDB, etc.)
- Dynamic port mapping based on deployed workloads
- Connection to Kind cluster’s control plane
HAProxy Configuration
Section titled “HAProxy Configuration”Version managed via Renovate:
haproxy: # renovate: datasource=docker depName=haproxy version: "3.3.2"How HAProxy Works
Section titled “How HAProxy Works”- Listens on host ports (5432, 3306, 6379, etc.)
- Forwards traffic to Kind cluster’s control plane
- Traefik routes to appropriate service inside the cluster
Port Mapping Example
Section titled “Port Mapping Example”Host:5432 → HAProxy:5432 → Kind:30001 → Traefik → postgres.dev.me:5432HAProxy Access
Section titled “HAProxy Access”Check HAProxy status:
# List running containersdocker ps | grep haproxy
# Check logsdocker logs loko-haproxy
# View configurationdocker exec loko-haproxy cat /usr/local/etc/haproxy/haproxy.cfgTraefik
Section titled “Traefik”Cloud-native ingress controller and reverse proxy.
Traefik Features
Section titled “Traefik Features”- HTTP/HTTPS Routing: Automatic TLS termination
- TCP/UDP Support: Layer 4 routing for databases and services
- Automatic Service Discovery: Watches Kubernetes resources
- Let’s Encrypt Integration: Automatic certificate management
- WebSocket Support: Full duplex communication
- Middleware: Rate limiting, authentication, compression
Traefik Role
Section titled “Traefik Role”Traefik is the required ingress controller for LoKO and cannot be disabled. It provides:
- HTTP/HTTPS ingress for web UIs and APIs
- TCP routing for databases and message queues
- TLS certificate management
- Load balancing across pods
Entrypoints
Section titled “Entrypoints”Traefik exposes two main entrypoints:
- web (HTTP): Port 80 → Redirects to HTTPS
- websecure (HTTPS): Port 443 → TLS-enabled traffic
- TCP ports: Dynamic based on workload requirements
Traefik Access
Section titled “Traefik Access”Traefik dashboard is accessible via LoKO CLI:
loko status # Shows Traefik statusYou can also enable the Traefik web dashboard, served at https://traefik.<domain>:
components: ingress-controller: dashboard: trueThe dashboard is disabled by default.
Traefik Configuration
Section titled “Traefik Configuration”Workloads use Traefik via standard Kubernetes Ingress resources:
ingress: enabled: true className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" hosts: - host: myapp.${LOKO_DOMAIN} paths: [/]For TCP services, LoKO automatically creates IngressRouteTCP resources.
metrics-server
Section titled “metrics-server”Kubernetes metrics API provider for resource monitoring.
metrics-server Features
Section titled “metrics-server Features”- Resource Metrics: CPU and memory usage per pod/node
- HPA Support: Enables Horizontal Pod Autoscaling
- kubectl top: Powers
kubectl top nodesandkubectl top pods - Lightweight: Minimal resource footprint
metrics-server Role
Section titled “metrics-server Role”Provides metrics for monitoring and autoscaling workloads. Can be disabled if not needed.
metrics-server Usage
Section titled “metrics-server Usage”View resource metrics:
# Node metricskubectl top nodes
# Pod metricskubectl top pods -A
# Specific namespacekubectl top pods -n loko-workloadsDisabling metrics-server
Section titled “Disabling metrics-server”To disable metrics-server during cluster creation:
loko create --disable-metrics-serverOr in configuration:
components: metrics-server: enabled: falseOCI-compliant container registry with optional pull-through caching.
Zot Features
Section titled “Zot Features”- OCI-Compliant: Fully compatible with Docker/containerd
- Local Image Storage: Store and serve your custom container images
- Optional Image Mirroring: Cache images from upstream registries (disabled by default)
- Deduplication: Saves storage with content-addressable blobs
- Vulnerability Scanning: Built-in security scanning (optional)
- HTTPS-Only: Secure by default
Zot Role
Section titled “Zot Role”Zot serves as the local container registry for storing your custom images. It can optionally act as a pull-through cache for external registries. Can be disabled if you prefer external registries.
Mirroring Support
Section titled “Mirroring Support”Zot can mirror and cache images from external registries as a pull-through cache.
Mirroring is disabled by default and can be enabled in your configuration file if desired.
Supported Registries
Section titled “Supported Registries”When mirroring is enabled, Zot can cache images from:
- Docker Hub:
docker.io - GitHub Container Registry:
ghcr.io - Kubernetes Registries:
registry.k8s.io,k8s.gcr.io - Quay:
quay.io - Microsoft Container Registry:
mcr.microsoft.com
How Mirroring Works
Section titled “How Mirroring Works”When you pull an image through Zot with mirroring enabled:
- Checks local cache
- If not found, pulls from upstream registry
- Caches locally for future pulls
- Serves from cache on subsequent requests
Enabling Mirroring
Section titled “Enabling Mirroring”To enable mirroring, update your loko.yaml configuration:
registry: enabled: true mirroring: enabled: true # Enable pull-through cacheYou can also selectively enable specific sources:
registry: mirroring: enabled: true sources: - name: docker_hub enabled: true - name: ghcr enabled: true - name: quay enabled: false # Disable specific sourcesAvailable sources: docker_hub, quay, ghcr, k8s_registry, mcr
Zot Access
Section titled “Zot Access”Zot registry is accessible via the external ingress hostname:
<registry-name>.${LOKO_DOMAIN}Zot Usage
Section titled “Zot Usage”Pushing Local Images
Section titled “Pushing Local Images”You can always push and pull your own images to/from Zot:
# Tag and push local imagesdocker tag myapp:latest <registry-name>.${LOKO_DOMAIN}/myapp:latestdocker push <registry-name>.${LOKO_DOMAIN}/myapp:latest
# Pull your imagesdocker pull <registry-name>.${LOKO_DOMAIN}/myapp:latestUsing Mirroring (when enabled)
Section titled “Using Mirroring (when enabled)”When mirroring is enabled, you can pull images through Zot from external registries:
# Pull and cache from Docker Hubdocker pull <registry-name>.${LOKO_DOMAIN}/library/nginx:latest
# Pull from GitHub Container Registrydocker pull <registry-name>.${LOKO_DOMAIN}/ghcr.io/user/image:tag
# Pull from Kubernetes registrydocker pull <registry-name>.${LOKO_DOMAIN}/registry.k8s.io/pause:latestBenefits
Section titled “Benefits”- Local Image Storage: Store and serve your custom images
- Private Registry: Keep your container images within your local cluster
- Faster Pulls (with mirroring): External images cached locally after first pull
- Offline Development (with mirroring): Work without internet once images are cached
- Bandwidth Savings (with mirroring): Pull from external registries once, use many times
Disabling Zot
Section titled “Disabling Zot”To disable Zot during cluster creation:
loko create --disable-registryOr in configuration:
components: registry: enabled: falseComponent Management
Section titled “Component Management”View component status:
# Check all componentsloko status
# List pods in loko-system namespacekubectl get pods -n loko-system