patch-operator
patch-operator copied to clipboard
Label a node?
Dear,
We would like to have a way to add label to our openshift node (oc label node, ...), Do you think that this is possible via patch operator?
We tried without success
Regards,
This works for me:
apiVersion: redhatcop.redhat.io/v1alpha1
kind: Patch
metadata:
name: patch-node-1
spec:
patches:
node-patch:
patchTemplate: |
metadata:
labels:
topology.kubernetes.io/region: "region1"
topology.kubernetes.io/zone: "region1-az2"
patchType: application/merge-patch+json
targetObjectRef:
apiVersion: v1
kind: Node
name: node-1
serviceAccountRef:
name: patch-node-labels
And the service Account must have a clusterrolebinding to patch nodes.