Skip to content

Commit

Permalink
add tolerations
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Vasilev <[email protected]>
  • Loading branch information
Omrigan committed Aug 29, 2024
1 parent 577759d commit 837f32e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion neonvm/controllers/vm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,20 @@ func podSpec(
return nil, fmt.Errorf("marshal VM Status: %w", err)
}

tolerations := append([]corev1.Toleration{}, vm.Spec.Tolerations...)
tolerations = append(tolerations,
corev1.Toleration{
Key: "node.kubernetes.io/not-ready",
TolerationSeconds: lo.ToPtr(int64(30)),
Effect: "NoExecute",
},
corev1.Toleration{
Key: "node.kubernetes.io/unreachable",
TolerationSeconds: lo.ToPtr(int64(30)),
Effect: "NoExecute",
},
)

pod := &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: vm.Status.PodName,
Expand All @@ -1387,7 +1401,7 @@ func podSpec(
TerminationGracePeriodSeconds: vm.Spec.TerminationGracePeriodSeconds,
NodeSelector: vm.Spec.NodeSelector,
ImagePullSecrets: vm.Spec.ImagePullSecrets,
Tolerations: vm.Spec.Tolerations,
Tolerations: tolerations,
ServiceAccountName: vm.Spec.ServiceAccountName,
SchedulerName: vm.Spec.SchedulerName,
Affinity: affinity,
Expand Down

0 comments on commit 837f32e

Please sign in to comment.