From 1e4f4c1f91c2ac39ec8b7c474c433f2d13b91d24 Mon Sep 17 00:00:00 2001 From: Eoin Gallinagh Date: Tue, 5 Dec 2023 15:17:53 +0000 Subject: [PATCH] add: taints for machinePools --- controllers/machinepools.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/controllers/machinepools.go b/controllers/machinepools.go index a5d4f78..1d29dfa 100644 --- a/controllers/machinepools.go +++ b/controllers/machinepools.go @@ -74,8 +74,13 @@ func (r *AppWrapperReconciler) scaleMachinePool(ctx context.Context, aw *arbv1.A m[aw.Name] = aw.Name klog.Infof("The instanceRequired array: %v", userRequestedInstanceType) + machinePoolTaint := cmv1.NewTaint(). + Key(aw.Name). + Value("value1"). + Effect("PreferNoSchedule") + machinePoolID := strings.ReplaceAll(aw.Name+"-"+userRequestedInstanceType, ".", "-") - createMachinePool, err := cmv1.NewMachinePool().ID(machinePoolID).InstanceType(userRequestedInstanceType).Replicas(replicas).Labels(m).Build() + createMachinePool, err := cmv1.NewMachinePool().ID(machinePoolID).InstanceType(userRequestedInstanceType).Replicas(replicas).Labels(m).Taints(machinePoolTaint).Build() if err != nil { klog.Errorf(`Error building MachinePool: %v`, err) }