Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Kind Cluster Setup

This guide explains how to set up a local development environment using Kind (Kubernetes in Docker).

Prerequisites

  • Docker
  • Kind (brew install kind or go install sigs.k8s.io/kind@latest)
  • kubectl
  • Helm

Quick Setup

make kind-all

This creates a Kind cluster and deploys everything:

  • Kind cluster with 3 nodes
  • Keycloak instance (admin/admin at localhost:8080)
  • Operator deployment
  • Test KeycloakInstance resource

Development Workflow

# 1. Initial setup (once)
make kind-all

# 2. Start port-forward in a separate terminal
make kind-port-forward

# 3. After code changes, rebuild and restart
make kind-redeploy

# 4. Run tests
make kind-test-run

# 5. Run specific test
make kind-test-run TEST_RUN=TestMyFeature

Commands

CommandDescription
make kind-allFull setup: cluster + Keycloak + operator
make kind-redeployRebuild and restart operator (fast iteration)
make kind-test-runRun e2e tests (use TEST_RUN=TestName to filter)
make kind-logsTail operator logs
make kind-port-forwardPort-forward Keycloak to localhost:8080
make kind-resetReset cluster to clean state
make kind-deleteDelete the Kind cluster

Troubleshooting

Check Operator Logs

make kind-logs

Check Keycloak Logs

kubectl logs -n keycloak -l app=keycloak -f

Verify CRDs

kubectl get crds | grep keycloak

Check Resource Status

kubectl get keycloakinstances,keycloakrealms,keycloakclients -A