feat: adding option to add scheduler name to kubernetes driver

this allows for custom scheduling of deployments

Signed-off-by: Isaac Gaskin <isaac.gaskin@circle.com>
This commit is contained in:
Isaac Gaskin 2024-04-16 14:51:00 -07:00
parent ac331d3569
commit 74fdbb5e7f
No known key found for this signature in database
GPG Key ID: C0DFB48CCE923510
2 changed files with 4 additions and 0 deletions

View File

@ -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":

View File

@ -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,