Skip to Content
Lynq

Why Lynq

Lynq turns every active row in your database into a set of Kubernetes resources and keeps it in sync. What problem it solves, when it fits, and what it does not do.

Lynq is a Kubernetes operator that provisions and reconciles a set of Kubernetes resources for every active row in your database. Insert a row and its resources appear; change the row and they follow; deactivate or delete it and they are cleaned up — without writing a controller.

Illustration: each active row gets its own set of resources; the cluster keeps matching the tableA table with rows acme, beta and gamma; beta is inactive. Lynq gives each active row its own stack of resources: acme and gamma each get one, beta gets none. The resources start updating and turn Ready. A new row, delta, is inserted and its stack appears. Someone changes one of acme's resources by hand; it turns red, and Lynq applies the template again and puts it back. Then gamma is deactivated and its stack is removed. At every step the resources in the cluster match the active rows in the table.

What problem does it solve?

You run one stack per customer, device, project or preview branch, and the list of what should exist is already in a database table. Getting the cluster to match it usually takes one of three things:

  • A script or CI job per change. It runs once and forgets: nobody reverts a manual edit, and a deleted row leaves its resources behind.
  • A Helm release per row. Every row is a release to install, upgrade and delete, and a chart change means upgrading every release, usually in a loop you write.
  • A custom operator. It works, but you now own a controller, its CRDs, RBAC, metrics and upgrades.

Lynq is that operator, written once: the table says what should exist, and Lynq keeps the cluster matching it.

How does it work?

Three custom resources:

  • LynqHub connects to the database, reads the rows every syncInterval (default 30s), and maps columns to template variables.
  • LynqForm is the blueprint: the Deployments, Services, Ingresses, Jobs and other resources to create for each active row, written as Go templates.
  • LynqNode is created for every active row × LynqForm. A hub with 3 active rows and 2 forms has 6 LynqNodes. Each one applies its resources with Server-Side Apply, in dependency order, and reports whether they are Ready.

Operations become data changes:

examples/customer-web/rows.sql (excerpt)
INSERT INTO customers (id, active, image, plan) VALUES ('delta', TRUE, 'nginx:1.27', 'pro');  -- provision
UPDATE customers SET image = 'nginx:1.28' WHERE id = 'delta';                               -- roll out
UPDATE customers SET active = FALSE WHERE id = 'delta';                                     -- clean up

Read How it works for the controllers and the reconcile loop.

When is Lynq a good fit?

  • A table already describes what should exist, one row per stack.
  • The stacks share a structure and differ by values (image, plan, domain, size).
  • Stacks are created, changed or removed often enough that doing it by hand or per pull request is a cost.
  • You want the cluster corrected when someone edits a resource by hand, and cleaned up when a row goes away.

Lynq works alongside GitOps: keep cluster-level configuration (operators, CRDs, policies) in Git, and let Lynq manage the per-row layer. See Argo CD and Flux.

What does Lynq not do?

  • One datasource today: MySQL (tables or views). PostgreSQL is on the roadmap.
  • Polling, not change capture. Rows are read every syncInterval; a change is applied within that interval, not instantly.
  • Kubernetes resources only. Cloud resources (databases, buckets, DNS) go through a Kubernetes API such as Crossplane or ExternalDNS, which a LynqForm can template.
  • No approval step per change. A row change is applied. If every change needs a human sign-off, a Git-based workflow fits better.
  • Not a replacement for GitOps for cluster-level configuration.
  • One active controller. Leader election provides it; two simultaneously active leaders are not fenced.

When is something else the better choice?

If…Prefer
Infrastructure changes are rare (monthly) and each needs reviewTerraform or GitOps with pull requests
The resources are mostly cloud services, not Kubernetes objectsTerraform, or Crossplane on its own
Each stack is different, not one template with different valuesHelm or Kustomize per stack
There is no table of what should existGitOps; Lynq needs the rows

Next

See it work in a disposable cluster with Try Lynq in your browser, or run the Quick Start on your machine.

On this page