Skip to Content
Lynq

LynqNode API Reference

LynqNode CRD API reference — auto-generated spec, status conditions, readyResources, appliedResources, and lifecycle annotations.

Kind: LynqNode
API Version: operator.lynq.sh/v1
Group: operator.lynq.sh

LynqNode represents one active database row × one LynqForm combination. Created and deleted automatically by the LynqHub controller — users typically don't create or edit LynqNodes directly.

→ Resource lifecycle guide · API index

Spec

LynqNode specs are generated by the hub controller and mirror the LynqForm structure with template variables resolved into the metadata.annotations. Direct editing is unusual.

apiVersion: operator.lynq.sh/v1
kind: LynqNode
metadata:
  name: acme-corp-web-app            # format: {uid}-{form-name}
  namespace: lynq-system
  annotations:
    lynq.sh/uid: "acme-corp"         # resolved .uid variable
    lynq.sh/activate: "true"         # resolved .activate variable
    lynq.sh/planId: "enterprise"     # from extraValueMappings
    lynq.sh/nodeUrl: "https://..."   # from extraValueMappings
  labels:
    lynq.sh/hub: production-nodes    # source hub
    lynq.sh/uid: acme-corp
spec:
  uid: string                        # Node unique identifier
  templateRef: string                # LynqForm name that generated this node

  # Rendered resource arrays — same structure as LynqForm
  deployments: []
  services: []
  # ... (all resource types)

Status

status:
  observedGeneration: int64
  desiredResources: int32            # Total resources in the form
  readyResources: int32              # Resources with ready condition met
  failedResources: int32             # Resources that failed to apply or timed out
  skippedResources: int32            # Resources skipped due to dependency failures
  skippedResourceIds: []string       # IDs of skipped resources

  appliedResources: []string         # Current set of tracked resources
                                     # Format: "Kind/namespace/name@id"
                                     # Example: "Deployment/default/acme-app@app"

  lastFullReconcileAt: timestamp     # Baseline used to schedule the next
                                     # periodic force-reapply (drift correction).
                                     # See "lastFullReconcileAt" below.

  conditions:
  - type: Ready
    status: "True" | "False" | "Unknown"
    reason: string
    message: string
    lastTransitionTime: timestamp
  - type: Progressing
    status: "True" | "False"
    reason: string
  - type: Degraded
    status: "True" | "False"
    reason: string
    message: string
  - type: Conflicted
    status: "True" | "False"
    reason: string

Conditions

What each reason means and what to do about it: LynqNode condition reasons.

Ready

True when all desired resources are applied and ready.

ReasonStatusMeaning
ReconciledTrueAll resources ready
ResourcesFailedAndConflictedFalseBoth failed and conflicted resources exist
ResourcesConflictedFalseOne or more resources in ownership conflict
ResourcesFailedFalseOne or more resources failed to apply
NotAllResourcesReadyFalseResources exist but haven't reached ready state

Degraded

True when the node needs an operator — failed or conflicted resources, or template/variables/dependency errors — even if reconciliation has completed. Resources that are merely not ready yet (rolling out, or recovering lost pods) do not degrade a node; they show as Ready=False with reason NotAllResourcesReady.

ReasonStatusMeaning
HealthyFalseNo issues
ResourceFailuresAndConflictsTrueBoth failed and conflicted resources
ResourceFailuresTrueFailed resources
ResourceConflictsTrueConflicted resources
ResourcesNotReady—No longer emitted: not-ready alone does not degrade a node (see NotAllResourcesReady under Ready)

Progressing

True during active reconciliation.

Conflicted

True when any resource has an SSA field-manager conflict.

appliedResources

Tracks every resource currently under management. Format: Kind/namespace/name@id.

["Deployment/default/acme-app@app", "Service/default/acme-svc@svc"]

Lynq compares this list against the current template on each reconcile. Resources in appliedResources but not in the current template are treated as orphans and handled per their stored deletionPolicy annotation.

lastFullReconcileAt

Timestamp the controller uses to schedule the next periodic force-reapply (drift correction). When time.Since(lastFullReconcileAt) >= ForceReapplyInterval (default 10 minutes), the next reconcile bypasses the per-resource skip check and re-applies every child resource unconditionally. This is the backstop for external mutations that preserve lynq.sh/applied-hash on a child resource and would therefore not be caught by the annotation-only skip path.

A nil value (absent field) means the controller has not yet established a baseline for this node — either the LynqNode is brand-new or the controller just restarted and observed it for the first time. The controller treats nil as "stamp now as the baseline and defer the first force by one full interval". This deferral prevents a re-apply storm across all LynqNodes on every controller restart.

The companion annotations on child resources are:

  • lynq.sh/applied-hash — desired-spec hash from the last successful apply. The skip check compares this against the freshly computed hash; equal ⇒ skip.
  • lynq.sh/apply-start-time — wall-clock timestamp stamped at the most recent apply (preserved across reconciles when the spec is unchanged). Used as the readiness-timeout reference instead of creationTimestamp.

Both annotations are written atomically as part of the SSA / Update payload — no follow-up MergePatch — so the skip check never observes a half-stamped state.

Lifecycle

Creation

LynqHub creates a LynqNode for each activeRow × referencingForm combination. The LynqNode controller then:

  1. Adds finalizer lynqnode.operator.lynq.sh/finalizer
  2. Renders templates with variables from metadata.annotations
  3. Builds dependency graph from dependIds
  4. Applies resources in topological order
  5. Waits for readiness (per waitForReady / timeoutSeconds)
  6. Updates status

Deletion

When the LynqNode is deleted, the finalizer runs cleanup:

  • Resources with deletionPolicy: Delete — removed from cluster
  • Resources with deletionPolicy: Retain — orphan markers added, resource stays

After cleanup, the finalizer is removed and Kubernetes deletes the CR.

Periodic reconciliation

The LynqNode controller requeues every 30 seconds to detect child resource status changes (e.g., a Deployment becoming ready). Combined with event-driven watches on 14 resource types, status reflects reality within ~30 seconds.

kubectl Reference

# List all nodes with status
kubectl get lynqnodes -n lynq-system

# Check ready/desired ratio
kubectl get lynqnode <name> -o jsonpath='{.status.readyResources}/{.status.desiredResources}'

# View all conditions
kubectl get lynqnode <name> -o jsonpath='{range .status.conditions[*]}{.type}: {.status} ({.reason}){"\n"}{end}'

# Find resources managed by this node
kubectl get all -l lynq.sh/node=<name>

# Find skipped resources (dependency failures)
kubectl get lynqnode <name> -o jsonpath='{.status.skippedResourceIds}'

# Force reconciliation
kubectl annotate lynqnode <name> lynq.sh/force-reconcile=$(date +%s) --overwrite

# Watch ready count
watch kubectl get lynqnode <name> -o jsonpath='{.status.readyResources}/{.status.desiredResources}'

All Fields

Every field the CRD accepts, read from the installed schema. The sections above explain the ones that need it.

Spec

FieldTypeDescription
spec.configMapsobject[]ConfigMaps are the resolved ConfigMap resources
spec.configMaps[].annotationsTemplatemap[string]stringAnnotationsTemplate defines annotations to apply to the resource (supports templates)
spec.configMaps[].conflictPolicystringConflictPolicy 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.configMaps[].creationPolicystringCreationPolicy determines when the resource should be created Default: WhenNeeded One of Once, WhenNeeded. Default "WhenNeeded".
spec.configMaps[].deletionPolicystringDeletionPolicy determines what happens to the resource when the LynqNode is deleted Default: Delete One of Delete, Retain. Default "Delete".
spec.configMaps[].dependIdsstring[]DependIds lists IDs of resources that must be ready before this resource is created
spec.configMaps[].idrequiredstringID is a unique identifier within the template (used for dependencies and references)
spec.configMaps[].ignoreFieldsstring[]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.configMaps[].labelsTemplatemap[string]stringLabelsTemplate defines labels to apply to the resource (supports templates)
spec.configMaps[].nameTemplatestringNameTemplate is a Go template for the resource name Template variables: .uid, .host, .hostOrUrl, and extraValueMappings
spec.configMaps[].patchStrategystringPatchStrategy determines how to apply the resource Default: apply (Server-Side Apply) One of apply, merge, replace. Default "apply".
spec.configMaps[].skipOnDependencyFailurebooleanSkipOnDependencyFailure 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.configMaps[].specrequiredobject (any manifest)Spec is the Kubernetes resource specification Can be any Kubernetes native resource or custom resource
spec.configMaps[].targetNamespacestringTargetNamespace 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.configMaps[].timeoutSecondsinteger (int32)TimeoutSeconds is the maximum time to wait for the resource to be ready Default: 300 Default 300.
spec.configMaps[].waitForReadybooleanWaitForReady determines whether to wait for the resource to be ready before continuing Default: true Default true.
spec.cronJobsobject[]Same fields as spec.configMaps. CronJobs are the resolved CronJob resources
spec.daemonSetsobject[]Same fields as spec.configMaps. DaemonSets are the resolved DaemonSet resources
spec.deploymentsobject[]Same fields as spec.configMaps. Deployments are the resolved Deployment resources
spec.horizontalPodAutoscalersobject[]Same fields as spec.configMaps. HorizontalPodAutoscalers are the resolved HPA resources
spec.ingressesobject[]Same fields as spec.configMaps. Ingresses are the resolved Ingress resources
spec.jobsobject[]Same fields as spec.configMaps. Jobs are the resolved Job resources
spec.manifestsobject[]Same fields as spec.configMaps. Manifests are the resolved arbitrary resources
spec.namespacesobject[]Same fields as spec.configMaps. Namespaces are the resolved Namespace resources
spec.networkPoliciesobject[]Same fields as spec.configMaps. NetworkPolicies are the resolved NetworkPolicy resources
spec.persistentVolumeClaimsobject[]Same fields as spec.configMaps. PersistentVolumeClaims are the resolved PVC resources
spec.podDisruptionBudgetsobject[]Same fields as spec.configMaps. PodDisruptionBudgets are the resolved PDB resources
spec.secretsobject[]Same fields as spec.configMaps. Secrets are the resolved Secret resources
spec.serviceAccountsobject[]Same fields as spec.configMaps. ServiceAccounts are the resolved ServiceAccount resources
spec.servicesobject[]Same fields as spec.configMaps. Services are the resolved Service resources
spec.statefulSetsobject[]Same fields as spec.configMaps. StatefulSets are the resolved StatefulSet resources
spec.templateRefrequiredstringTemplateRef references the LynqForm to use
spec.uidrequiredstringUID is the unique identifier from the hub data source

Generated from config/crd/bases/operator.lynq.sh_lynqnodes.yaml

Status

FieldTypeDescription
status.appliedResourcesstring[]AppliedResources tracks the keys of resources that were successfully applied Format: "kind/namespace/name@id" (e.g., "Deployment/default/myapp@app-deployment") This enables detection and cleanup of orphaned resources when removed from form
status.conditionsobject[]Conditions represent the latest available observations of the node's state
status.conditions[].lastTransitionTimerequiredstring (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.conditions[].messagerequiredstringmessage is a human readable message indicating details about the transition. This may be an empty string.
status.conditions[].observedGenerationinteger (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.conditions[].reasonrequiredstringreason 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.conditions[].statusrequiredstringstatus of the condition, one of True, False, Unknown. One of True, False, Unknown.
status.conditions[].typerequiredstringtype of condition in CamelCase or in foo.example.com/CamelCase.
status.desiredResourcesinteger (int32)DesiredResources is the total number of resources
status.failedResourcesinteger (int32)FailedResources is the number of resources that failed
status.lastFullReconcileAtstring (date-time)LastFullReconcileAt is the baseline timestamp used to schedule the next periodic force-reapply (drift-correction resync). The LynqNode controller compares `time.Since(LastFullReconcileAt)` against `ForceReapplyInterval` (default 10 minutes) and, when the interval has elapsed, bypasses the apply-skip check and re-applies every child resource unconditionally. External edits that preserve the lynq.sh/applied-hash annotation on a child resource will not be caught by the annotation-only skip path; the next force-reapply cycle corrects them.
status.observedGenerationinteger (int64)ObservedGeneration is the generation observed by the controller
status.readyResourcesinteger (int32)ReadyResources is the number of resources that are ready
status.skippedResourceIdsstring[]SkippedResourceIds lists the IDs of resources that were skipped due to dependency failures
status.skippedResourcesinteger (int32)SkippedResources is the number of resources skipped due to dependency failures

Generated from config/crd/bases/operator.lynq.sh_lynqnodes.yaml

See Also

On this page