Glossary β
Comprehensive reference of terms and concepts used in Lynq.
Core Concepts β
Lynq β
A Kubernetes operator that automates database-driven infrastructure provisioning by synchronizing node data from external data sources (MySQL, PostgreSQL) and creating Kubernetes resources using template-based declarative configuration.
Multi-Node β
An architectural pattern where a single instance of software serves multiple customers (nodes), each with isolated resources and data. Previously called "Multi-Tenancy" in earlier versions.
Operator Pattern β
A Kubernetes design pattern that uses custom controllers to extend Kubernetes functionality by automating application-specific operational knowledge.
Custom Resource Definitions (CRDs) β
LynqHub β
A Custom Resource that defines:
- External data source connection (MySQL, PostgreSQL)
- Synchronization interval
- Column mappings between database schema and operator variables
- The source of truth for active node list
Example:
apiVersion: operator.lynq.sh/v1
kind: LynqHub
metadata:
name: my-hub
spec:
source:
type: mysql
syncInterval: 1mLynqForm β
A Custom Resource that defines:
- Resource blueprints for node provisioning
- Template definitions for Kubernetes resources
- Lifecycle policies (creation, deletion, conflict)
- Dependency relationships between resources
Referenced by: LynqNode CRs References: LynqHub (via hubId)
LynqNode β
A Custom Resource representing a single node instance. Automatically created by LynqHub controller based on active database rows. Previously called "Tenant" in earlier versions.
Key characteristics:
- Created/deleted automatically (users typically don't create manually)
- Contains resolved resource specifications (templates already evaluated)
- Tracks status of all provisioned resources
- Owns created resources via ownerReferences (Delete policy) or labels (Retain policy)
Data Source Concepts β
Data Source β
An external system that stores node configuration data. Currently supported:
- MySQL (v5.7+, v8.0+)
- PostgreSQL (planned for v1.1)
syncInterval β
Duration between data source polling cycles. Defines how frequently the operator checks for node data changes.
Format: Go duration string (e.g., 30s, 1m, 5m) Default: 1 minute Tradeoff: Lower interval = faster synchronization, higher database load
valueMappings β
Required column mappings from database to operator variables:
| Mapping | Database Column | Operator Variable | Description |
|---|---|---|---|
uid | Custom | .uid | Unique node identifier |
hostOrUrl | Custom | .hostOrUrl, .host | Node URL (auto-extracts host) |
activate | Custom | .activate | Activation flag (truthy/falsy) |
Example:
valueMappings:
uid: node_id
hostOrUrl: node_url
activate: is_activeextraValueMappings β
Optional custom column mappings for template variables. Allows passing arbitrary database columns to templates.
Example:
extraValueMappings:
planId: subscription_plan # Available as {{ .planId }}
region: deployment_region # Available as {{ .region }}activate Column β
A special database column that determines node activation status.
Truthy values
| Accepted values (case-sensitive) | Result |
|---|---|
"1" | Active |
"true", "TRUE", "True" | Active |
"yes", "YES", "Yes" | Active |
Any other valueβsuch as "0", "false", "active", empty strings, or NULLβis treated as inactive.
Normalize upstream data
Use MySQL VIEWs to transform incompatible values before the operator consumes them.
MySQL VIEW β
A virtual table created from a SQL query. Used to transform database schemas that don't match operator requirements.
Use cases:
- Transform
"active"/"inactive"to"1"/"0" - Combine multiple columns
- Add computed fields
- Filter sensitive data
Example:
CREATE VIEW node_configs AS
SELECT id, url, CASE WHEN status='active' THEN '1' ELSE '0' END AS is_active FROM nodes;See DataSource Guide for detailed examples.
Template System β
Template β
Go text/template syntax with Sprig function library. Used to dynamically generate Kubernetes resource specifications.
Syntax:
- Variables:
{{ .uid }},{{ .host }} - Functions:
{{ .uid | trunc63 }},{{ .config | fromJson }} - Conditionals:
{{ if .planId }}...{{ end }}
Template Variables β
Data available in template rendering context:
Required (from valueMappings):
.uid- Node unique identifier.hostOrUrl- Original URL from database.host- Auto-extracted hostname from.hostOrUrl.activate- Activation status (truthy/falsy)
Metadata:
.hubId- LynqHub name.templateRef- LynqForm name
Custom (from extraValueMappings):
- Any additional database columns (e.g.,
.planId,.region)
Template Functions β
Built-in and custom functions available in templates:
Custom Functions:
toHost(url)- Extract hostname from URLtrunc63(s)- Truncate to 63 characters (Kubernetes name limit)sha1sum(s)- SHA1 hash of stringfromJson(s)- Parse JSON string to object
Sprig Functions (200+):
- String:
trim,upper,lower,replace,split - Encoding:
b64enc,b64dec,sha256sum - Defaults:
default,coalesce,ternary - Collections:
list,dict,merge - And many more: See Sprig documentation
nameTemplate β
A template string that generates the metadata.name for a Kubernetes resource.
Requirements:
- Must result in valid Kubernetes name (lowercase, alphanumeric,
-) - Maximum 63 characters (use
trunc63function) - Must be unique within namespace
Example:
nameTemplate: "{{ .uid }}-app"
nameTemplate: "{{ .uid | trunc63 }}"Resource Management β
Server-Side Apply (SSA) β
A Kubernetes API mechanism for declarative resource management. The operator uses SSA as the default apply strategy.
Benefits:
- Conflict-free updates (multiple controllers can manage same resource)
- Field-level ownership tracking
- Automatic drift correction
Field Manager: lynq
Reference: Kubernetes SSA Documentation
fieldManager β
The identifier used in Server-Side Apply to track which controller owns which fields.
Value: lynq
All resources applied by Lynq are marked with this field manager.
TResource β
The base structure for all resources in LynqForm. Contains:
id- Unique identifier within templatespec- Kubernetes resource specificationdependIds- Dependency list (topological ordering)- Policies:
creationPolicy,deletionPolicy,conflictPolicy,patchStrategy - Templates:
nameTemplate,labelsTemplate,annotationsTemplate - Readiness:
waitForReady,timeoutSeconds
Resource types:
serviceAccountsdeployments,statefulSets,daemonSetsservicesconfigMaps,secretspersistentVolumeClaimsjobs,cronJobsingressesmanifests(raw YAML for custom resources)
ownerReference β
A Kubernetes metadata field that establishes parent-child relationships between resources.
In Lynq:
- Resources with
deletionPolicy: Delete(default) haveownerReferencepointing to their LynqNode CR - Enables automatic garbage collection by Kubernetes when LynqNode is deleted
- Resources with
deletionPolicy: Retainuse label-based tracking instead (NO ownerReference)
Drift Detection β
The process of detecting and correcting manual changes to operator-managed resources.
Lynq uses dual-layer detection:
Event-Driven (Immediate):
- Watches 11 resource types (Deployments, Services, ConfigMaps, etc.)
- Triggers reconciliation on generation/annotation changes
- Smart predicates filter status-only updates
Periodic (30 seconds):
- Regular reconciliation ensures eventual consistency
- Detects child resource status changes
- Balances responsiveness with cluster resource usage
Result: Manual changes are automatically reverted to template-defined state.
Policies β
Policies control resource lifecycle behavior in LynqForm.
CreationPolicy β
Controls when resources are created/updated.
Values:
WhenNeeded(default) - Reapply when spec changes or state requires itOnce- Create only once, never reapply (for init Jobs, immutable resources)
Use cases for Once:
- Initialization Jobs
- Secret generation
- Certificate creation
- Database migrations
DeletionPolicy β
Controls resource lifecycle and tracking mechanism. Evaluated at resource creation time, not deletion time.
Values:
Delete(default) - Uses ownerReference for automatic cleanup when LynqNode is deletedRetain- Uses label-based tracking only (no ownerReference), resource persists after LynqNode deletion
Use cases for Retain:
- Persistent data (PVCs, Databases)
- Shared infrastructure
- Resources needing manual cleanup
- Protection from accidental deletion
ConflictPolicy β
Controls behavior when resource already exists with different owner.
Values:
Stuck(default) - Stop reconciliation, mark LynqNode as Degraded, emit eventForce- Use SSA withforce=trueto take ownership
Use Force when:
- Migrating from manual to operator management
- Multiple operators need to share resources
- Recovering from operator failures
Warning: Force can cause conflicts with other controllers.
Node β
See LynqNode. In earlier versions of this project, nodes were called "tenants".
PatchStrategy β
The method used to update Kubernetes resources.
Values:
apply(default) - Server-Side Apply (SSA) with conflict managementmerge- Strategic Merge Patch (preserves fields not in patch)replace- Full replacement via Update (replace entire resource)
Recommendation: Use apply (default) unless you have specific requirements.
Dependency Management β
dependIds β
An array of resource IDs that must be created before the current resource.
Example:
deployments:
- id: app-deploy
dependIds: ["app-config"] # Wait for configmapUse cases:
- PersistentVolumeClaim must exist before StatefulSet
- ConfigMap/Secret must exist before Deployment
- Service must exist before Ingress
Dependency Graph (DAG) β
A Directed Acyclic Graph representing resource creation order based on dependIds.
Properties:
- Nodes: Resources
- Edges: Dependencies
- Must be acyclic (no circular dependencies)
Validation: Operator detects cycles at admission time and rejects invalid templates.
Topological Sort β
An algorithm that determines the correct order to create resources based on their dependencies.
Process:
- Build dependency graph from
dependIds - Detect cycles (fail if found)
- Sort resources in dependency order
- Apply resources sequentially
Result: Resources are created in the correct order, respecting dependencies.
Resource Readiness β
waitForReady β
A boolean flag (per resource) that determines if the operator should wait for resource readiness before proceeding.
Default: true
When false: Operator applies resource and immediately moves to next one (fire-and-forget).
Use cases for false:
- Services (typically ready immediately)
- ConfigMaps/Secrets (no readiness concept)
- Background Jobs
- Resources where readiness doesn't matter
timeoutSeconds β
Maximum duration (in seconds) to wait for resource readiness.
Default: 300 (5 minutes) Maximum: 3600 (1 hour)
Behavior on timeout: Resource marked as failed, LynqNode marked as Degraded.
Ready Condition β
A Kubernetes status condition indicating resource health. Different resource types have different readiness criteria:
| Resource Type | Ready When |
|---|---|
| Deployment | availableReplicas >= replicas AND observedGeneration == generation |
| StatefulSet | readyReplicas == replicas |
| Job | succeeded >= 1 |
| Service | Immediate (or waitForReady=false recommended) |
| Namespace | Immediate after creation |
| Custom Resources | status.conditions[type=Ready].status=True |
Status and Observability β
LynqNode Status β
The status field in LynqNode CR tracks resource provisioning state:
Fields:
conditions- Array of status conditionsReady- All resources are readyDegraded- Some resources failed
desiredResources- Total count of resources to createreadyResources- Count of ready resourcesfailedResources- Count of failed resourceslastSyncTime- Timestamp of last successful reconciliation
Ready calculation: Ready = (readyResources == desiredResources) AND (failedResources == 0)
Hub Status β
The status field in LynqHub CR tracks node provisioning across all forms:
Fields:
desired- Expected LynqNode count:referencingTemplates Γ activeRowsready- Count of Ready LynqNodes across all formsfailed- Count of failed LynqNodes across all formslastSyncTime- Timestamp of last database syncreferencingTemplates- List of forms using this hub
Example:
- Active database rows: 10
- Referencing forms: 2
- Desired: 20 (10 rows Γ 2 forms)
Reconciliation β
The control loop process where the operator compares desired state (from templates) with actual state (in cluster) and takes action to converge them.
Lynq reconciliation layers:
1. LynqHub Reconciliation:
- Query database at
syncInterval - Calculate desired LynqNode set
- Create/update/delete LynqNode CRs
2. LynqForm Reconciliation:
- Validate template-registry linkage
- Ensure template consistency
3. LynqNode Reconciliation:
- Render templates with node data
- Build dependency graph
- Apply resources in topological order
- Wait for readiness
- Update status
Triggers:
- Database sync timer (syncInterval)
- CRD changes (create/update/delete)
- Child resource changes (event-driven)
- Periodic requeue (30 seconds)
Requeue β
The act of scheduling a resource for re-reconciliation after a delay.
Lynq requeue patterns:
- Immediate: Error conditions, conflicts
- 30 seconds: Normal reconciliation cycle (fast status reflection)
- syncInterval: Database polling (e.g., 1 minute)
Multi-Form Support β
Multi-Form β
The capability for one LynqHub to be referenced by multiple LynqForms.
Use cases:
- Multi-environment deployments (prod, staging, dev)
- A/B testing configurations
- Regional variations
- Different service tiers
Example:
# Hub: my-hub (5 active rows)
# Form 1: prod-form (hubId: my-hub)
# Form 2: staging-form (hubId: my-hub)
# Result: 10 LynqNode CRs (5 rows Γ 2 forms)Referencing Forms β
LynqForms that reference a specific LynqHub via spec.hubId.
Tracked in: LynqHub.status.referencingTemplates
Used for: Calculating desired LynqNode count:
desired = len(referencingForms) Γ activeRowsDesired Count Calculation β
Formula for determining expected number of LynqNode CRs:
LynqHub.status.desired = referencingTemplates Γ activeRowsExample:
- Active database rows: 10
- Referencing forms: 3
- Desired: 30
Purpose: Ensures strong consistency between data source and cluster state.
Performance Optimization β
Smart Watch Predicates β
Filtering logic that prevents unnecessary reconciliations by ignoring irrelevant resource changes.
Filters out:
- Status-only updates
- Metadata changes (except annotations)
- ResourceVersion changes
Triggers reconciliation only on:
- Generation changes (spec updates)
- Annotation changes
- Resource deletion
Impact: Significantly reduces reconciliation overhead.
Namespace Tracking β
Label-based mechanism for tracking namespace ownership without ownerReferences (not allowed on cluster-scoped resources).
Implementation:
- Namespaces labeled with:
lynq.sh/node: <lynqnode-name>andlynq.sh/node-namespace: <lynqnode-namespace> - Watch predicate filters by label
- Enables efficient namespace-specific reconciliation
Concurrency β
The number of parallel reconciliation workers.
Configuration:
--node-concurrency=N(default: 10) - Concurrent LynqNode reconciliations--form-concurrency=N(default: 5) - Concurrent Form reconciliations--hub-concurrency=N(default: 3) - Concurrent Hub syncs
Tradeoff: Higher concurrency = faster processing, more resource usage.
Webhooks and Validation β
Webhook β
An HTTP callback mechanism for intercepting Kubernetes API requests before they're persisted.
Lynq webhooks:
- ValidatingWebhook: Reject invalid LynqHub/LynqForm CRs
- MutatingWebhook: Set default values (policies, timeouts)
Requires: TLS certificates (managed by cert-manager)
cert-manager β
A Kubernetes add-on that automates TLS certificate management.
Used for: Webhook server TLS certificates
Installation:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.0/cert-manager.yamlBenefits:
- Automatic certificate issuance
- Automatic renewal before expiration
- CA bundle injection into webhook configurations
Required: Lynq cannot run without cert-manager.
Validation Rules β
Checks performed by ValidatingWebhook:
LynqHub:
valueMappingsmust include required keys:uid,hostOrUrl,activatesyncIntervalmust be valid duration (e.g.,1m, not1 minute)- Database connection details must be valid
LynqForm:
spec.hubIdmust reference existing LynqHubTResource.idmust be unique within templatedependIdsmust not form cycles- Templates must be valid Go template syntax
- Policies must be valid enum values
Garbage Collection and Finalizers β
Finalizer β
A Kubernetes mechanism that prevents resource deletion until cleanup tasks complete.
Lynq finalizer: lynqnode.operator.lynq.sh/finalizer
Added to: LynqNode CRs
Purpose: Ensures proper cleanup of resources when LynqNode is deleted (respecting deletionPolicy).
Cascade Deletion β
The automatic deletion of child resources when parent resource is deleted.
In Lynq:
Normal flow:
LynqNode CR deleted β Finalizer runs β Resources deleted (per deletionPolicy) β Finalizer removed β LynqNode CR removedWarning:
LynqHub deleted β All LynqNode CRs deleted (ownerReference) β All node resources deletedProtection: Set deletionPolicy: Retain on critical resources BEFORE deleting LynqHub/LynqForm.
See Policies Guide - Cascade Deletion for details.
Kubernetes Concepts β
Custom Resource Definition (CRD) β
A Kubernetes extension mechanism that allows defining custom resource types.
Lynq CRDs:
lynqhubs.operator.lynq.shlynqforms.operator.lynq.shlynqnodes.operator.lynq.sh
Controller β
A control loop that watches Kubernetes resources and takes actions to move current state toward desired state.
Lynq controllers:
- LynqHub Controller
- LynqForm Controller
- LynqNode Controller
Reconciliation Loop β
See Reconciliation above.
Leader Election β
A mechanism ensuring only one instance of the operator is actively reconciling resources (for high availability deployments).
Configuration: --leader-elect flag (default: enabled)
Kubernetes API Server β
The central management entity in Kubernetes that exposes the Kubernetes API. All operator interactions go through the API server.
etcd β
The distributed key-value store used by Kubernetes to persist cluster state. The operator reads/writes all resources to etcd via the API server.
Development and Operations β
Minikube β
A tool for running a single-node Kubernetes cluster locally for development and testing.
Lynq Minikube setup:
- See Quick Start for automated scripts
- See Local Development for development workflow
Server-Side Apply (SSA) Engine β
The internal component in Lynq that applies Kubernetes resources using Server-Side Apply.
Features:
- Conflict detection and resolution
- Field-level ownership tracking
- Automatic drift correction
- Support for multiple patch strategies
Location: internal/apply/
Apply Engine β
See Server-Side Apply (SSA) Engine above.
Template Engine β
The internal component that renders Go templates with node data.
Features:
- Variable substitution
- Function execution (Sprig + custom)
- Error handling and validation
- Template caching
Location: internal/template/
Metrics and Monitoring β
Prometheus Metrics β
Time-series metrics exposed by the operator for monitoring.
Key metrics:
lynqnode_reconcile_duration_seconds{result}- Reconciliation durationlynqnode_resources_ready{lynqnode}- Ready resource count per nodehub_desired- Expected LynqNode counthub_ready- Ready LynqNode counthub_failed- Failed LynqNode countapply_attempts_total{kind, result, conflict_policy}- Apply attempts
Endpoint: http://operator:8080/metrics
Health Checks β
HTTP endpoints for liveness and readiness probes.
Endpoints:
/healthz- Liveness probe (is operator running?)/readyz- Readiness probe (is operator ready to reconcile?)
Common Abbreviations β
| Abbreviation | Full Term |
|---|---|
| SSA | Server-Side Apply |
| CRD | Custom Resource Definition |
| CR | Custom Resource |
| DAG | Directed Acyclic Graph |
| RBAC | Role-Based Access Control |
| TLS | Transport Layer Security |
| API | Application Programming Interface |
| K8s | Kubernetes (8 letters between K and s) |
| PVC | PersistentVolumeClaim |
| SA | ServiceAccount |
See Also β
- API Reference - Complete CRD specification
- Template Guide - Template syntax and examples
- Policies Guide - Lifecycle policies in detail
- DataSource Guide - MySQL configuration and VIEWs
- Quick Start - Get started in 5 minutes
