vkdr infra
The vkdr infra commands are used to manage the local cluster where vkdr installs tools and applications.
vkdr infra start
Start the local vkdr cluster with configurable options. The cluster is a single-node k3d cluster with opinionated settings and optimizations.
This command also starts a few pass-through local registry mirrors starting on port 6000. All image pulls from the cluster that match these hosts are redirected to these mirrors transparently, helping avoid Docker Hub rate limits and network delays.
vkdr infra start [--traefik] [--agents=<k3d_agents>] \
[--http=<http_port>] [--https=<https_port>] [-k=<api_port>] \
[--nodeport-base=<nodeport_base>] [--nodeports=<nodeports>] [-v=<volumes>]
Flags
| Flag | Shorthand | Description | Default |
|---|---|---|---|
--http | Ingress controller external HTTP port | 8000 | |
--https | Ingress controller external HTTPS port | 8001 | |
--api-port | -k | Kubernetes API port | (random) |
--agents | Number of k3d agents to start | 0 | |
--traefik | Enable Traefik ingress controller | false | |
--nodeports | Number of exposed nodeports | 0 | |
--nodeport-base | Starting port for nodeport mapping | 9000 | |
--volumes | -v | Volumes to mount (comma-separated hostPath:mountPath) | (none) |
Examples
Start with Traefik as ingress controller:
vkdr infra start --traefik
# Access via http://localhost:8000 and https://localhost:8001
Start without ingress (install one separately):
vkdr infra start --http 80 --https 443
vkdr nginx install --default-ic
Start with nodeports for services like Kong NodePort mode:
vkdr infra start --nodeports 2
# Ports 9000 and 9001 are now available for NodePort services
Start with custom volumes:
vkdr infra start --traefik -v "/data/app:/app,/data/config:/config"
Start with k3d agents for multi-node testing:
vkdr infra start --traefik --agents 2
vkdr infra up
Shortcut for vkdr infra start with all defaults. Starts the cluster without an ingress controller.
vkdr infra up
Example
vkdr infra up
# Cluster running on ports 8000/8001, no ingress
vkdr infra stop
Stop the local vkdr cluster with options.
vkdr infra stop [--registry]
Flags
| Flag | Description | Default |
|---|---|---|
--registry | Delete builtin cache/mirror registries | false |
Examples
Stop the cluster (keep registry):
vkdr infra stop
Stop and delete registries:
vkdr infra stop --registry
vkdr infra down
Shortcut for vkdr infra stop with all defaults.
vkdr infra down
Example
vkdr infra down
vkdr infra status
Check the health status of the local vkdr cluster.
vkdr infra status [--json]
Flags
| Flag | Description | Default |
|---|---|---|
--json | Output in JSON format | false |
Output
The command checks:
- k3d availability: Whether k3d CLI is responding
- Cluster exists: Whether
vkdr-localcluster exists - Server count: Number of servers running vs total
- API server: Whether Kubernetes API is reachable
Status values:
| Status | Meaning |
|---|---|
READY | All servers running and API reachable |
DEGRADED | Some servers running but not all, or API unreachable |
NOT_READY | No servers running |
Examples
Check cluster status:
vkdr infra status
# ==============================
# VKDR Cluster Status
# ==============================
# Cluster: vkdr-local
# Servers: 1/1 running
# API Server: reachable
# ------------------------------
# Status: READY
# ==============================
Get status as JSON (useful for scripting):
vkdr infra status --json --silent
# {"cluster":"vkdr-local","exists":true,"k3d_available":true,"servers_count":1,"servers_running":1,"api_server_reachable":true,"status":"READY"}
Use in scripts to wait for cluster:
until vkdr infra status --json --silent | jq -e '.status == "READY"' > /dev/null; do
echo "Waiting for cluster..."
sleep 5
done
echo "Cluster is ready!"
vkdr infra expose
Expose the local vkdr cluster admin port to the internet using a public Cloudflare tunnel.
vkdr infra expose [--off]
Flags
| Flag | Description | Default |
|---|---|---|
--off | Terminate the tunnel | false |
Examples
Start the tunnel:
vkdr infra expose
# A temporary kubeconfig file is created at ~/.vkdr/tmp/kconfig
Stop the tunnel:
vkdr infra expose --off
Warning: Exposing your cluster to the internet has security implications. This is useful for testing remote access, but be aware of the risks. The tunnel provides a public URL to your cluster's Kubernetes API.
vkdr infra createToken
Create a service account token for accessing the cluster.
vkdr infra createToken [--json] [--duration=<duration>]
Flags
| Flag | Description | Default |
|---|---|---|
--duration | Token duration (e.g., 24h, 7d) | (default) |
--json | Output in JSON format | false |
Examples
Create a token with default duration:
vkdr infra createToken
Create a token valid for 7 days:
vkdr infra createToken --duration 7d
Create a token and output as JSON:
vkdr infra createToken --json --duration 24h
vkdr infra getca
Get the CA (Certificate Authority) data from the vkdr cluster.
vkdr infra getca [--json]
Flags
| Flag | Description | Default |
|---|---|---|
--json | Output in JSON format | false |
Examples
Get CA data:
vkdr infra getca
Get CA data as JSON:
vkdr infra getca --json
About Mirrors
The local registry mirrors are started as background containers and are used by VKDR cluster transparently. You can use the vdkr mirror command to change the mirror list.
You can force stop the mirrors when stopping VKDR:
vkdr infra stop --registry
Complete Examples
Basic Development Setup
# Start cluster with Traefik
vkdr infra start --traefik
# Install a test app
vkdr whoami install
curl http://whoami.localhost:8000
# Clean up
vkdr whoami remove
vkdr infra stop
Production-like Setup
# Start cluster with custom ports
vkdr infra start --http 80 --https 443
# Install Kong as ingress
vkdr kong install --default-ic -s
# Install services
vkdr postgres install -w
vkdr keycloak install
vkdr devportal install
# Clean up
vkdr infra stop
Remote Access Setup
# Start cluster
vkdr infra start --traefik
# Expose to internet
vkdr infra expose
# Get credentials for remote access
vkdr infra createToken --duration 24h
vkdr infra getca
# Use ~/.vkdr/tmp/kconfig for remote kubectl access
# When done
vkdr infra expose --off
vkdr infra stop