From 74fdbb5e7ff2fcbf251e86d9674ecb9b9d71a178 Mon Sep 17 00:00:00 2001 From: Isaac Gaskin Date: Tue, 16 Apr 2024 14:51:00 -0700 Subject: [PATCH] feat: adding option to add scheduler name to kubernetes driver this allows for custom scheduling of deployments Signed-off-by: Isaac Gaskin --- driver/kubernetes/factory.go | 2 ++ driver/kubernetes/manifest/manifest.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/driver/kubernetes/factory.go b/driver/kubernetes/factory.go index f66974de218..789eb030920 100644 --- a/driver/kubernetes/factory.go +++ b/driver/kubernetes/factory.go @@ -153,6 +153,8 @@ func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg if _, isImage := cfg.DriverOpts["image"]; !isImage { deploymentOpt.Image = bkimage.DefaultRootlessImage } + case "schedulername": + deploymentOpt.SchedulerName = v case "serviceaccount": deploymentOpt.ServiceAccountName = v case "nodeselector": diff --git a/driver/kubernetes/manifest/manifest.go b/driver/kubernetes/manifest/manifest.go index a4a6b2fc653..e45a734a300 100644 --- a/driver/kubernetes/manifest/manifest.go +++ b/driver/kubernetes/manifest/manifest.go @@ -20,6 +20,7 @@ type DeploymentOpt struct { Image string Replicas int ServiceAccountName string + SchedulerName string // Qemu Qemu struct { @@ -107,6 +108,7 @@ func NewDeployment(opt *DeploymentOpt) (d *appsv1.Deployment, c []*corev1.Config }, Spec: corev1.PodSpec{ ServiceAccountName: opt.ServiceAccountName, + SchedulerName: opt.SchedulerName, Containers: []corev1.Container{ { Name: containerName,