NodeConfig (NC)

Overview

NodeConfig (NC) is a custom resource (API node.shturval.tech) representing a configuration instance for a specific node. NodeConfig is created by the shturval-node-config module and aggregates a list of NCIs that should be applied to a given node.

Communication: NCI specifies what to configure and on which nodes (by selector). NodeConfig - result for a specific node: which NCIs are applied and in what state.

One NCI can be applied to several nodes - each node will have its own NodeConfig with NCI in the nodeconfigitems list.


How to create NodeConfig

  1. Module controllers shturval-node-config monitor Node and NodeConfigItem.
  2. For each node, the controller determines the NCI whose nodeconfigselector corresponds to the node’s labels.
  3. A NodeConfig is created or updated with a name that matches the node name (hostname).
  4. spec.nodeconfigitems records the list of NCIs to apply.
  5. The controller applies the configuration to the node (via shturvald) and updates the status.

NodeConfig structure

apiVersion: node.shturval.tech/v1beta2
kind: NodeConfig
metadata:
  name: <node-name> # Node name (hostname)
  ownerReferences:
    - kind: Node
      name: <node-name> # Owner is a Node object
    - kind: NodeConfigItem
      name: <nci-name> # Links to NCI
spec:
  applygroup: workers # Application group (control-plane, workers)
  nodeconfigitems: # NCI list for node configuration
    - generic-init-config
    -ntp-example
status:
  ready: true # Configuration applied successfully
  ncistate: # State of each NCI on the node
    - name: generic-init-config
      state: applied
    - name: ntp-example
      state: applied

NodeConfig fields

spec

FieldDescription
applygroupApplication group: control-plane or workers. Determines the order of application.
nodeconfigitemsA list of NCI names that should be applied to the node. Filled by the controller based on NCI selectors.

status

FieldDescription
readytrue — configuration applied successfully; false - there are errors or application in the process.
ncistateThe status of each NCI: name - NCI name, state - status (for example, applied, error).

Annotations (examples)

AnnotationDescription
node.shturval.tech/initchecksumChecksum to verify initialization.
node.shturval.tech/sshSSH access status (for example, accessed).

Removing a checksum annotation

If NodeConfig is in state ConfigApplied=False with reason ChecksumMismatch, the local /etc/std/nci.json on the node does not match the checksum recorded in NodeConfig. After reconciling the local init NCI and the expected cluster configuration, remove the node.shturval.tech/initchecksum annotation to re-enable the application of the configuration (for more details, see the diagnostic section in module shturval-node-config):

kubectl get nodeconfig <node-name> -o jsonpath='{.status}'
kubectl annotate nodeconfig <node-name> node.shturval.tech/initchecksum-

View NodeConfig

# List of NodeConfigs (one per node)
kubectl get nodeconfig -A

# NodeConfig details for node
kubectl get nodeconfig <node-name> -o yaml

# Check application status
kubectl get nodeconfig <node-name> -o jsonpath='{.status.ready}'

In the GUI: on the node page Node Configuration tab, the list of NCIs and their application status is displayed. If there is an error, the status is Not applied.