Directional metadata sync operator from MachineSets to existing Nodes
Adding node labels and taints to non-default MachinePools is allowed through OCM; however, due to intentional limitations in OpenShift’s machine-api-operator, labels and taints are not reconciled to existing machines within a machine set. Today you must scale down the MachinePool to 0 and back up again to update nodes. This is obviously undesirable and doesn’t present a good user experience for customers.
Managed OpenShift does not allow customers to label nodes directly.
This managed-node-metadata-operator will attempt to watch MachineSet objects and reconcile any labels or taints that are added to the corresponding Nodes within the pool.
flowchart TD
A[User updates MachinePool in OCM] --> B[Hive applies changes to MachineSet on cluster]
B --> C;
subgraph Managed Node Metadata Operator
C[MNMO Picks up change to MachineSet and begins reconcile] --> D[Loop through all Machines in Machineset and Sync Label/Taint changes];
D --> E[Remove Taints/Labels not present in MachineSet and present on Machine];
subgraph Per Machine
E --> F[Apply Taints/Labels present in MachineSet and not present on Machine];
F --> G[Get referenced Node]
G --> H[Remove Taints/Labels not present in Machine and present on Node];
H --> I[Apply Taints/Labels present in Machine and not present on Node];
end
end
Refer to the development and testing guide to understand how to run and test the operator.
This repository subscribes to the openshift/golang-osd-operator convention of boilerplate. See the README for details about the functionality that brings in.
Note that the tests expect that three environment variables are set for the tests to be able to run. The suite will quickly fail if these are unset:
OCM_TOKEN
OCM_CLUSTER_ID
OCM_ENV
Here is an example of running the tests in a local environment:
$ cd <PROJECT_ROOT>/test/e2e/
$ export OCM_TOKEN=$(ocm token)
$ export OCM_CLUSTER_ID=<YOUR-CLUSTER-ID>
$ export OCM_ENV=<stage|int>
$ DISABLE_JUNIT_REPORT=true ginkgo run --tags=osde2e,e2e --procs 4 --flake-attempts 3 --trace -vv .