Skip to content
GitHub stars

Quick Start

Time to working

~5 minutes. Automated scripts handle cluster, cert-manager, MySQL, and operator setup.

Prerequisites

ToolVersionInstall
Minikubev1.28.0+brew install minikube (macOS) or minikube.sigs.k8s.io
kubectlv1.28.0+brew install kubectl or kubernetes.io
DockerLatestDocker Desktop (macOS) or Docker Engine (Linux)

System requirements: 1+ core, 1+ GB RAM, 5+ GB disk.

Setup (5 Steps)

Step 1: Prepare Minikube Cluster

Step 1~2 min

Prepare Minikube Cluster

Bootstraps the base cluster with cert-manager and Lynq CRDs.

Command
./scripts/setup-minikube.sh

This step creates

  • Minikube control plane + kubeconfig
  • cert-manager v1.13.2
  • Namespaces: lynq-system, lynq-test
  • Lynq CRDs

Post-run checks (click to toggle)

0% done

Move to next step: Once the cluster objects are ready, continue with Step 2 to deploy the controller.

Step 2: Deploy Lynq

Step 2~2 min

Deploy Lynq Operator

Builds the controller image and deploys it into lynq-system.

Command
./scripts/deploy-to-minikube.sh

Prerequisites

  • Step 1 complete: Minikube + cert-manager running
  • kubectl context points to Minikube

This step creates

  • Lynq controller-manager Deployment/Service
  • Webhook configuration and TLS Secret (via cert-manager)
  • Metrics and leader-election resources

Post-run checks (click to toggle)

0% done

Move to next step: With the controller online you can move to Step 3 and deploy the database.

Step 3: Deploy MySQL Test Database

Step 3~1 min

Seed MySQL Test Database

Installs a MySQL 8.0 instance with sample node rows inside lynq-test.

Command
./scripts/deploy-mysql.sh

Prerequisites

  • Step 2 complete: Lynq operator is running
  • Namespace lynq-test exists (created during Step 1)

This step creates

  • mysql Deployment/Service
  • nodes database and node_configs table
  • Three sample node rows
  • Read-only user node_reader and Secret

Post-run checks (click to toggle)

0% done

Move to next step: With the datasource online you can create the LynqHub in Step 4.

Step 4: Create LynqHub

Step 4~30 sec

Create LynqHub

Creates the LynqHub CR that syncs MySQL rows every 30 seconds.

Command
./scripts/deploy-lynqhub.sh

Prerequisites

  • Step 3 complete: MySQL endpoint is Ready
  • mysql-credentials Secret exists

This step creates

  • LynqHub CR (test-hub)
  • Column and extraValue mappings
  • Recurring sync loop

Post-run checks (click to toggle)

0% done

Move to next step: Once the hub is feeding node specs you can define the LynqForm in Step 5.

Step 5: Apply LynqForm

Step 5~30 sec

Apply LynqForm

Defines the blueprint (Deployment, Service, etc.) for each active node.

Command
./scripts/deploy-lynqform.sh

Prerequisites

  • Step 4 complete: test-hub reports Ready
  • Permissions to create templates in the same namespace as the hub

This step creates

  • LynqForm CR (test-template)
  • Deployment/Service definitions
  • Hub ↔ Template linkage

Post-run checks (click to toggle)

0% done

Move to next step: All steps are done. Adding a database row now provisions resources automatically.

Verify It Works

bash
# 1. LynqNode CRs — one per active row
kubectl get lynqnodes -n lynq-system
# NAME                          READY   DESIRED   FAILED   AGE
# acme-corp-test-template       2/2     2         0        2m
# beta-inc-test-template        2/2     2         0        2m

# 2. Resources created for each active node
kubectl get deployments,services -n lynq-test -l lynq.sh/node

# 3. Live lifecycle: insert a row → resource appears within 30s
kubectl exec -it deployment/mysql -n lynq-test -- \
  mysql -u root -p"$(kubectl get secret mysql-root-password -n lynq-test -o jsonpath='{.data.password}' | base64 -d)" \
  -e "INSERT INTO nodes.node_configs (node_id, node_url, is_active, subscription_plan) VALUES ('delta-co', 'https://delta.example.com', 1, 'starter');"

sleep 35
kubectl get lynqnode delta-co-test-template -n lynq-system

# 4. Deactivate → resources clean up within 30s
kubectl exec -it deployment/mysql -n lynq-test -- \
  mysql -u root -p"$(kubectl get secret mysql-root-password -n lynq-test -o jsonpath='{.data.password}' | base64 -d)" \
  -e "UPDATE nodes.node_configs SET is_active = 0 WHERE node_id = 'delta-co';"

sleep 35
kubectl get lynqnode delta-co-test-template -n lynq-system  # Not found

Troubleshooting

Operator not starting — cert-manager must be Ready before Lynq starts:

bash
kubectl get pods -n cert-manager
kubectl logs -n lynq-system -l control-plane=controller-manager

Nodes not created — check the hub sync and confirm is_active = 1 in the database:

bash
kubectl get lynqhub test-hub -n lynq-system -o yaml
kubectl exec -it deployment/mysql -n lynq-test -- \
  mysql -u node_reader -p"$(kubectl get secret mysql-credentials -n lynq-test -o jsonpath='{.data.password}' | base64 -d)" \
  -e "SELECT node_id, is_active FROM nodes.node_configs;"

Resources missing — inspect the LynqNode status for failures:

bash
kubectl describe lynqnode <name> -n lynq-system

For detailed diagnostics, see Troubleshooting.

Cleanup
bash
# Remove everything except the cluster
kubectl delete lynqnodes --all -n lynq-system
kubectl delete lynqform test-template -n lynq-system
kubectl delete lynqhub test-hub -n lynq-system

# Full teardown
./scripts/cleanup-minikube.sh

Scripts support env var overrides — run ./scripts/<name>.sh --help for options.

See Also

  • Installation — deploy to a production cluster
  • Datasources — connect to your own MySQL database
  • Templates — template syntax and 200+ functions
  • Policies — control resource creation, deletion, and conflict behavior
  • Use Cases — common patterns and worked examples