Skip to content

Commit

Permalink
feat: adding option to add scheduler name to kubernetes driver
Browse files Browse the repository at this point in the history
this allows for custom scheduling of deployments

Signed-off-by: Isaac Gaskin <[email protected]>
  • Loading branch information
igaskin committed Apr 16, 2024
1 parent ac331d3 commit 74fdbb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions driver/kubernetes/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 2 additions & 0 deletions driver/kubernetes/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type DeploymentOpt struct {
Image string
Replicas int
ServiceAccountName string
SchedulerName string

// Qemu
Qemu struct {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 74fdbb5

Please sign in to comment.