Skip to content

nodes data source

Description

NodesDataSource lists cluster-scoped Nodes that match all supplied labels.

Source: internal/api/core/v1/nodes_dsrc.go:19

Example usage:

imports: {
  kubernetes-core-v1: 'github.com/cloudboss/unobin-library-kubernetes//api/core/v1'
}

data-sources: {
  example: kubernetes-core-v1.nodes {
    # Set input fields here.
  }
}

Inputs

metadata

optional(object)
optional(
  object({
    labels: map(string)
  })
)

Input Constraints

Metadata rules

Requirement.

Rule logic
For each
input.metadata.labels ?? {}
Require
@core.is-match(@each.key, '^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?[A-Za-z0-9]([-A-Za-z0-9_.]*[A-Za-z0-9])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]{1,63}$')

If set, @each.value must match the specified pattern.

Rule logic
For each
input.metadata.labels ?? {}
Require
@core.is-match(@each.value, '^([A-Za-z0-9]([-A-Za-z0-9_.]{0,61}[A-Za-z0-9])?)?$')

Outputs

nodes

optional(list(object))
optional(
  list(
    object({
      metadata: object({
        name: string
        resource-version: string
        uid: string
        generation: integer
        annotations: map(string)
        labels: map(string)
      })
      spec: object({
        pod-cidr: string
        pod-cidrs: list(string)
        provider-id: string
        unschedulable: boolean
        taints: list(
          object({
            key: string
            value: string
            effect: string
          })
        )
      })
      status: object({
        allocatable: map(string)
        capacity: map(string)
        addresses: list(
          object({
            type: string
            address: string
          })
        )
        conditions: list(
          object({
            type: string
            status: string
            last-heartbeat-time: string
            last-transition-time: string
            reason: string
            message: string
          })
        )
        node-info: object({
          machine-id: string
          system-uuid: string
          boot-id: string
          kernel-version: string
          os-image: string
          container-runtime-version: string
          kubelet-version: string
          kube-proxy-version: string
          operating-system: string
          architecture: string
        })
      })
    })
  )
)