Skip to main content

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

FlagShorthandDescriptionDefault
--httpIngress controller external HTTP port8000
--httpsIngress controller external HTTPS port8001
--api-port-kKubernetes API port(random)
--agentsNumber of k3d agents to start0
--traefikEnable Traefik ingress controllerfalse
--nodeportsNumber of exposed nodeports0
--nodeport-baseStarting port for nodeport mapping9000
--volumes-vVolumes 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

FlagDescriptionDefault
--registryDelete builtin cache/mirror registriesfalse

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

FlagDescriptionDefault
--jsonOutput in JSON formatfalse

Output

The command checks:

  • k3d availability: Whether k3d CLI is responding
  • Cluster exists: Whether vkdr-local cluster exists
  • Server count: Number of servers running vs total
  • API server: Whether Kubernetes API is reachable

Status values:

StatusMeaning
READYAll servers running and API reachable
DEGRADEDSome servers running but not all, or API unreachable
NOT_READYNo 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

FlagDescriptionDefault
--offTerminate the tunnelfalse

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

FlagDescriptionDefault
--durationToken duration (e.g., 24h, 7d)(default)
--jsonOutput in JSON formatfalse

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

FlagDescriptionDefault
--jsonOutput in JSON formatfalse

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