Skip to content
Snippets Groups Projects
Commit edfd9a26 authored by tabassm2's avatar tabassm2
Browse files

Merge branch 'schedulerNameProfile' into 'master'

Add schedulerName to profile

See merge request !2
parents 65ff2d44 d462e0e0
No related branches found
No related tags found
1 merge request!2Add schedulerName to profile
Pipeline #197821 canceled
......@@ -34,6 +34,9 @@ spec:
description: 'ProfileSpec is an openfaas api extension that can be predefined and applied to functions by annotating them with `com.openfaas/profile: name1,name2`'
type: object
properties:
schedulerName:
description: If not specified, the default scheduler will be deployed in the pod.
type: string
affinity:
description: "If specified, the pod's scheduling constraints \n copied to the Pod Affinity, this will replace any existing value or previously applied Profile. We use a replacement strategy because it is not clear that merging affinities will actually produce a meaning Affinity definition, it would likely result in an impossible to satisfy constraint"
type: object
......
......@@ -43,6 +43,9 @@ spec:
name1,name2`'
type: object
properties:
schedulerName:
description: If not specified, the default scheduler will be deployed in the pod.
type: string
affinity:
description: "If specified, the pod's scheduling constraints \n copied
to the Pod Affinity, this will replace any existing value or previously
......
......@@ -82,6 +82,10 @@ type ProfileSpec struct {
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// What type of Scheduler to use
SchedulerName string `json:"schedulerName,omitempty"`
// RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used
// to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run.
// If unset or empty, the "legacy" RuntimeClass will be used, which is an implicit class with an
......
......@@ -253,6 +253,11 @@ func (in *ProfileSpec) DeepCopyInto(out *ProfileSpec) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.SchedulerName != nil {
in, out := &in.SchedulerName, &out.SchedulerName
*out = new(string)
**out = **in
}
return
}
......
......@@ -175,5 +175,8 @@ func (f FunctionFactory) RemoveProfile(profile Profile, deployment *appsv1.Deplo
if profile.PodSecurityContext.Sysctls != nil {
deployment.Spec.Template.Spec.SecurityContext.Sysctls = nil
}
if profile.SchedulerName != "" {
deployment.Spec.Template.Spec.SchedulerName = profile.SchedulerName
}
}
}
......@@ -42,6 +42,9 @@ spec:
name1,name2`'
type: object
properties:
schedulerName:
description: If not specified, the default scheduler will be deployed in the pod.
type: string
affinity:
description: "If specified, the pod's scheduling constraints \n copied
to the Pod Affinity, this will replace any existing value or previously
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment