LynqForm API Reference
LynqForm CRD API reference — hubId, resource arrays, TResource spec fields, dependency ordering, creationPolicy, and deletionPolicy.
Kind: LynqForm
API Version: operator.lynq.sh/v1
Group: operator.lynq.sh
LynqForm is the resource blueprint. It references a LynqHub and defines which Kubernetes resources to create for each active row, using Go templates. One LynqForm can reference one hub; one hub can be referenced by many forms.
→ Templates guide · Policies reference · API index
Spec
apiVersion: operator.lynq.sh/v1
kind: LynqForm
metadata:
name: my-form
namespace: lynq-system
spec:
hubId: string # LynqHub name (required)
rollout: # Optional — controls update rollout (v1.1.16+)
maxSkew: 0 # Max simultaneous node updates (0 = unlimited)
progressDeadlineSeconds: 600 # Per-node update timeout in seconds
# Resource arrays — each entry follows the TResource structure (see below)
serviceAccounts: []
deployments: []
statefulSets: []
daemonSets: []
services: []
configMaps: []
secrets: []
persistentVolumeClaims: []
jobs: []
cronJobs: []
ingresses: []
podDisruptionBudgets: []
networkPolicies: []
horizontalPodAutoscalers: []
namespaces: [] # Cluster-scoped; tracked via labels (no ownerReference)
manifests: [] # Raw unstructured resources (CRDs, custom kinds)TResource Structure
Every entry in any resource array is a TResource:
id: string # Unique ID within this form (required)
nameTemplate: string # Go template for metadata.name (required)
spec: object # Kubernetes resource spec (required)
# Optional — templates
labelsTemplate: # Template-enabled labels applied to the resource
key: "{{ .uid }}-value"
annotationsTemplate: # Template-enabled annotations
key: value
targetNamespace: string # Target namespace; defaults to LynqNode's namespace
# Optional — dependencies
dependIds: []string # IDs of resources that must be applied first
skipOnDependencyFailure: true # Skip this resource if any dependency failed (default: true)
# Optional — lifecycle policies (all have defaults)
creationPolicy: WhenNeeded # WhenNeeded | Once
deletionPolicy: Delete # Delete | Retain
conflictPolicy: Stuck # Stuck | Force (SSA-only — no effect on merge/replace)
patchStrategy: apply # apply | merge | replace
# Optional — readiness
waitForReady: true # Wait for resource ready condition (default: true)
timeoutSeconds: 300 # Readiness timeout in seconds (default: 300, max: 3600)
# Measured from lynq.sh/apply-start-time annotation
# (preserved across reconciles when spec is unchanged)Policy defaults
All policies default to the safest option. Only specify what differs:
| Policy | Default | Options | Notes |
|---|---|---|---|
creationPolicy | WhenNeeded | WhenNeeded, Once | |
deletionPolicy | Delete | Delete, Retain | |
conflictPolicy | Stuck | Stuck, Force | Force is SSA-only; ignored by merge / replace |
patchStrategy | apply | apply, merge, replace | apply (SSA) is the only strategy that preserves fields owned by other controllers |
→ Policies reference for detailed behavior.
nameTemplate
Go template string that produces metadata.name. Must produce a valid Kubernetes name (lowercase, alphanumeric, -), maximum 63 characters.
nameTemplate: "{{ .uid }}-app"
nameTemplate: "{{ .uid | trunc63 }}"
nameTemplate: "{{ .uid }}-{{ .planId | default \"basic\" }}"dependIds
Array of id values that must be applied (and ready, if waitForReady: true) before this resource. Lynq builds a DAG from all dependIds, performs a topological sort, and applies in order. Cycles are rejected at admission time.
- id: configmap
nameTemplate: "{{ .uid }}-config"
spec: ...
- id: deployment
dependIds: [configmap] # applied only after configmap is ready
nameTemplate: "{{ .uid }}-app"
spec: ...skipOnDependencyFailure
Controls what happens when a dependency fails (apply error or timeout — not just "not ready yet").
true(default): Skip this resource and emit aDependencySkippedevent.false: Apply this resource regardless, emitDependencyFailedButProceeding.
Note: a dependency that is still starting up (not yet ready) silently blocks dependents — no skip event is emitted and skipOnDependencyFailure does not apply until the dependency transitions to failed.
Rollout Configuration (v1.1.16+)
Controls how many LynqNodes are updated simultaneously when the form template changes.
rollout:
maxSkew: 5 # update at most 5 nodes at a time
progressDeadlineSeconds: 600 # report a node update that is not Ready within 10 minutesmaxSkew behavior:
0(default): No limit — all nodes update simultaneously1: Serial — one node at a timeN: Sliding window — up to N nodes updating in parallel
Each LynqForm's rollout is independent; multiple forms pointing at the same hub do not interfere.
progressDeadlineSeconds behavior (default 600, range 60–3600):
The deadline times LynqForm rollouts: updates that move a node to a new form generation (and
newly created nodes). The rollout status reports phase: Failed when an updated node (one
already on the form's current generation) either:
- is failed — it has failed or conflicted resources, or is
Degraded(template, variables or dependency errors), or - has not become Ready since it was updated to that generation and its update started more
than
progressDeadlineSecondsago.
An update that only changes the node's data from the hub (row values such as hostOrUrl,
activate or extra mappings, under the same form generation) is not a LynqForm rollout and is
not timed by this deadline. If it never becomes Ready, the LynqNode reports it as failed once its
resources exceed their timeoutSeconds, and the rollout turns Failed at that point.
status.rollout.message lists the nodes (up to 5, then a count) and the reason for each, a
RolloutFailed warning event is emitted once when the phase turns Failed, and
lynqform_rollout_phase reports 2. The phase leaves Failed on its own — with a
RolloutRecovered event — once those nodes become Ready or are fixed by a new LynqForm change.
The deadline only measures an update that never completed. A node that became Ready after its
update and later drops out of it (node drain, lost pod, kubectl rollout restart) is recovering,
not stalled, and never fails the rollout by deadline, however long ago the update was. It is not
rolling out either: the rollout's counts and phase follow the completion record below, so a
Complete rollout stays Complete (with the same completionTime) while such a node recovers,
and the message names it — All 126 nodes updated (1 recovering). updatingNodes and
lynqform_rollout_updating_nodes count only nodes whose update has not completed. A recovering
node that turns failed still turns the rollout Failed at once.
Failed exposes the stall; it does not skip the node. A failed or stuck node keeps its maxSkew
slot, so with maxSkew: 1 no further node is updated until it recovers. A recovering node keeps
its slot too, so a rollout can read InProgress with updatingNodes: 0: it is waiting for the
recovering nodes named in the message. Fix the node or revert
the LynqForm change to move the rollout on.
Completion is recorded on the node itself: once the operator sees an updated node Ready for its
new spec, it sets the annotation lynq.sh/rollout-completed-generation to the form generation
(one write per node per rollout; the next update to a new form generation resets it to "" in the
same write that updates the node, and a data-only update leaves it as it is). The verdict therefore survives an operator restart or leader change unchanged — a
completed node is not timed after a restart, and a node whose update never completed is timed from
its original update, not from the restart. Nodes created by an operator version without this
annotation count as completed; only their failures stall the rollout. After a rollback to such a
version and a re-upgrade, a node it moved to a newer form generation still carries the older
generation's marker, so that rollout counts as not completed and is timed.
Completion is observed at each hub sync (syncInterval). A node that becomes Ready and regresses
again within one sync of its update, before the operator sees it Ready, counts as not completed.
Status
status:
observedGeneration: int64
totalNodes: int32 # Total LynqNodes using this form
readyNodes: int32 # LynqNodes with Ready=True
rollout: # Only populated when maxSkew > 0
phase: string # Idle | InProgress | Failed | Complete (Failed: see progressDeadlineSeconds)
targetGeneration: int64
totalNodes: int32
updatedNodes: int32 # Updated to target generation
updatingNodes: int32 # Updated, update not completed yet (not counting recovering nodes)
readyUpdatedNodes: int32 # Updated AND ready for the updated spec now (observedGeneration caught up)
# updatedNodes - updatingNodes - readyUpdatedNodes = recovering nodes:
# completed the update, not Ready now. Complete counts them as done.
startTime: timestamp
completionTime: timestamp # When the rollout completed, or when it turned Failed
message: string # On Failed: the stalled nodes and why; otherwise counts, incl. recovering
conditions:
- type: Valid
status: "True" | "False"
reason: ValidationSucceeded | ValidationFailed
message: string
- type: Applied
status: "True" | "False"
reason: string
message: stringValidation
The admission webhook enforces:
spec.hubIdmust reference an existing LynqHub in the same namespace- Each
TResource.idmust be unique within the form dependIdsmust reference IDs that exist within the same formdependIdsmust not form cyclesnameTemplateandlabelsTemplate/annotationsTemplatemust be valid Go templates
Example
apiVersion: operator.lynq.sh/v1
kind: LynqForm
metadata:
name: web-app
namespace: lynq-system
spec:
hubId: production-nodes
configMaps:
- id: config
nameTemplate: "{{ .uid }}-config"
spec:
apiVersion: v1
kind: ConfigMap
data:
PLAN: "{{ .planId }}"
REGION: "{{ .region }}"
deployments:
- id: app
dependIds: [config]
nameTemplate: "{{ .uid }}-app"
creationPolicy: WhenNeeded
deletionPolicy: Delete
waitForReady: true
timeoutSeconds: 300
spec:
apiVersion: apps/v1
kind: Deployment
spec:
replicas: 1
selector:
matchLabels:
app: "{{ .uid }}"
template:
metadata:
labels:
app: "{{ .uid }}"
spec:
containers:
- name: app
image: myapp:latest
envFrom:
- configMapRef:
name: "{{ .uid }}-config"
services:
- id: svc
nameTemplate: "{{ .uid }}-svc"
waitForReady: false
spec:
apiVersion: v1
kind: Service
spec:
selector:
app: "{{ .uid }}"
ports:
- port: 80
targetPort: 8080All Fields
Every field the CRD accepts, read from the installed schema. The sections above explain the ones that need it.
Spec
| Field | Type | Description |
|---|---|---|
spec. | object[] | ConfigMaps defines ConfigMap resources to create |
spec. | map[string]string | AnnotationsTemplate defines annotations to apply to the resource (supports templates) |
spec. | string | ConflictPolicy determines how to handle conflicts with existing resources Default: Stuck (fail reconciliation if resource exists with different owner) One of Force, Stuck. Default "Stuck". |
spec. | string | CreationPolicy determines when the resource should be created Default: WhenNeeded One of Once, WhenNeeded. Default "WhenNeeded". |
spec. | string | DeletionPolicy determines what happens to the resource when the LynqNode is deleted Default: Delete One of Delete, Retain. Default "Delete". |
spec. | string[] | DependIds lists IDs of resources that must be ready before this resource is created |
spec.required | string | ID is a unique identifier within the template (used for dependencies and references) |
spec. | string[] | IgnoreFields specifies JSONPath expressions for fields to exclude from synchronization These fields will be applied during initial creation but ignored in subsequent reconciliations Only effective when CreationPolicy is WhenNeeded (default) Allows fine-grained control for fields that should be managed externally (e.g., HPA-controlled replicas) Example: ["$.spec.replicas", "$.spec.template.spec.containers[0].resources"] |
spec. | map[string]string | LabelsTemplate defines labels to apply to the resource (supports templates) |
spec. | string | NameTemplate is a Go template for the resource name Template variables: .uid, .host, .hostOrUrl, and extraValueMappings |
spec. | string | PatchStrategy determines how to apply the resource Default: apply (Server-Side Apply) One of apply, merge, replace. Default "apply". |
spec. | boolean | SkipOnDependencyFailure determines whether to skip creating this resource when a dependency fails When true (default): This resource will be skipped if any of its dependencies fail When false: This resource will still be created even if dependencies fail (useful for cleanup resources) Default: true Default true. |
spec.required | object (any manifest) | Spec is the Kubernetes resource specification Can be any Kubernetes native resource or custom resource |
spec. | string | TargetNamespace specifies the namespace where the resource should be created If empty, defaults to the same namespace as the LynqNode CR For cross-namespace resources, label-based tracking is used instead of ownerReferences Supports Go template syntax (e.g., "{{ .uid }}-namespace") |
spec. | integer (int32) | TimeoutSeconds is the maximum time to wait for the resource to be ready Default: 300 Default 300. |
spec. | boolean | WaitForReady determines whether to wait for the resource to be ready before continuing Default: true Default true. |
spec. | object[] | Same fields as spec.. CronJobs defines CronJob resources to create |
spec. | object[] | Same fields as spec.. DaemonSets defines DaemonSet resources to create |
spec. | object[] | Same fields as spec.. Deployments defines Deployment resources to create |
spec. | object[] | Same fields as spec.. HorizontalPodAutoscalers defines HPA resources to create |
spec.required | string | HubID references the LynqHub that this form is associated with |
spec. | object[] | Same fields as spec.. Ingresses defines Ingress resources to create |
spec. | object[] | Same fields as spec.. Jobs defines Job resources to create |
spec. | object[] | Same fields as spec.. Manifests defines arbitrary Kubernetes resources as raw manifests Use this for any resource type not explicitly supported above |
spec. | object[] | Same fields as spec.. Namespaces defines Namespace resources to create Note: Namespaces are cluster-scoped and always use label-based tracking The targetNamespace field is ignored for Namespace resources |
spec. | object[] | Same fields as spec.. NetworkPolicies defines NetworkPolicy resources to create |
spec. | object[] | Same fields as spec.. PersistentVolumeClaims defines PVC resources to create |
spec. | object[] | Same fields as spec.. PodDisruptionBudgets defines PDB resources to create |
spec. | object | Rollout defines the rollout strategy for LynqNode updates When configured, node updates are throttled based on maxSkew to prevent all nodes from updating simultaneously |
spec. | integer (int32) | MaxSkew is the maximum number of LynqNodes that can be updating simultaneously 0 (default) means unlimited - all nodes update at once (current behavior) 1 means serial rollout - one node at a time N means up to N nodes can be updating in parallel Each LynqForm applies maxSkew independently (template-isolated strategy) Default 0. |
spec. | integer (int32) | ProgressDeadlineSeconds is the maximum time in seconds for a node update to become ready before the rollout marks the node as failed Default: 600 (10 minutes) Default 600. |
spec. | object[] | Same fields as spec.. Secrets defines Secret resources to create |
spec. | object[] | Same fields as spec.. ServiceAccounts defines ServiceAccount resources to create |
spec. | object[] | Same fields as spec.. Services defines Service resources to create |
spec. | object[] | Same fields as spec.. StatefulSets defines StatefulSet resources to create |
Generated from config/crd/bases/operator.lynq.sh_lynqforms.yaml
Status
| Field | Type | Description |
|---|---|---|
status. | object[] | Conditions represent the latest available observations of the form's state |
status.required | string (date-time) | lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. |
status.required | string | message is a human readable message indicating details about the transition. This may be an empty string. |
status. | integer (int64) | observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. |
status.required | string | reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. |
status.required | string | status of the condition, one of True, False, Unknown. One of True, False, Unknown. |
status.required | string | type of condition in CamelCase or in foo.example.com/CamelCase. |
status. | integer (int64) | ObservedGeneration is the generation observed by the controller |
status. | integer (int32) | ReadyNodes is the number of Ready LynqNodes using this form |
status. | object | Rollout tracks the progress of template rollouts when rollout.maxSkew is configured |
status. | string (date-time) | CompletionTime is when the rollout completed (success or failure) |
status. | string | Message provides a human-readable status message |
status. | string | Phase is the current phase of the rollout One of Idle, InProgress, Failed, Complete. |
status. | integer (int32) | ReadyUpdatedNodes is the number of nodes that are updated AND Ready for the updated spec now. Updated nodes counted in neither UpdatingNodes nor ReadyUpdatedNodes are recovering: they completed the update and regressed since |
status. | string (date-time) | StartTime is when the rollout started |
status. | integer (int64) | TargetGeneration is the LynqForm generation being rolled out |
status. | integer (int32) | TotalNodes is the total number of LynqNodes using this form |
status. | integer (int32) | UpdatedNodes is the number of nodes that have been updated to the target generation |
status. | integer (int32) | UpdatingNodes is the number of updated nodes whose update has not completed yet (not Ready for the updated spec since the update). A node that completed the update and is not Ready now is recovering, and is not counted here |
status. | integer (int32) | TotalNodes is the total number of LynqNodes using this form |
Generated from config/crd/bases/operator.lynq.sh_lynqforms.yaml
See Also
- Templates — template syntax, functions, and variable reference
- Policies — policy behavior and recommended combinations
- Dependencies — dependency ordering and failure handling
- LynqHub API — datasource and sync configuration
- LynqNode API — instance status and lifecycle
- API index — common types and kubectl reference
LynqHub API Reference
LynqHub CRD API reference — spec.source MySQL connection, syncInterval, valueMappings, status fields, and multi-template support.
LynqNode API Reference
LynqNode CRD API reference — auto-generated spec, status conditions, readyResources, appliedResources, and lifecycle annotations.