Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add priorityClassName to CRDs #1513

Merged
merged 3 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,7 @@ spec:
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
spec:
priorityClassName: "high"
nodeSelector:
node-role.kubernetes.io/test: ""

Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha1/runner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ type RunnerPodSpec struct {
// +optional
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`

// +optional
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,8 @@ spec:
organization:
pattern: ^[^/]+$
type: string
priorityClassName:
type: string
repository:
pattern: ^[^/]+/[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,8 @@ spec:
organization:
pattern: ^[^/]+$
type: string
priorityClassName:
type: string
repository:
pattern: ^[^/]+/[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3171,6 +3171,8 @@ spec:
organization:
pattern: ^[^/]+$
type: string
priorityClassName:
type: string
repository:
pattern: ^[^/]+/[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,8 @@ spec:
organization:
pattern: ^[^/]+$
type: string
priorityClassName:
type: string
repository:
pattern: ^[^/]+/[^/]+$
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3230,6 +3230,8 @@ spec:
organization:
pattern: ^[^/]+$
type: string
priorityClassName:
type: string
repository:
pattern: ^[^/]+/[^/]+$
type: string
Expand Down
2 changes: 2 additions & 0 deletions config/crd/bases/actions.summerwind.dev_runners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3171,6 +3171,8 @@ spec:
organization:
pattern: ^[^/]+$
type: string
priorityClassName:
type: string
repository:
pattern: ^[^/]+/[^/]+$
type: string
Expand Down
4 changes: 4 additions & 0 deletions controllers/runner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
pod.Spec.Tolerations = runnerSpec.Tolerations
}

if runnerSpec.PriorityClassName != "" {
pod.Spec.PriorityClassName = runnerSpec.PriorityClassName
}

if len(runnerSpec.TopologySpreadConstraints) != 0 {
pod.Spec.TopologySpreadConstraints = runnerSpec.TopologySpreadConstraints
}
Expand Down