Goodday all, My question is, would it be possible to use Kustomize for dynamically adding labels to specific cluster-nodes which name match a certain pattern? For example, to each cluster-node that starts with "^infra.*" I want to add the label "node-role.kubernetes.io: infra"

The nodes itself do already exists and are not managed by Kustomize so that might be a problem? I tried applying a (strategic merge -) patch using a regular expression for the node name like this:

apiVersion: v1
kind: Node
metadata:
  name: /^infra.*$/
  labels:
    node-role.kubernetes.io: infra

But Kustomize build gives an error complaining about not being able to find the unique target for patch Node.v1.[noGrp]//^infra.*/.[noNS] Did I incorrectly use the Kustomize patch, or is it not possible to use Kustomize for such requests?

trial and error so far

0

There are 0 best solutions below