Skip to content

Commit

Permalink
Update kube-scheduler to v1.25 and its configuration api to v1
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Nov 12, 2022
1 parent 3ad48be commit 65df9c3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/watch-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
registry: registry.k8s.io
repository: kube-scheduler
values_path: scheduling.userScheduler.image.tag
version_startswith: "v1.23"
version_startswith: "v1.25"
version_patch_regexp_group_suffix: ""

- name: pause
Expand Down
23 changes: 14 additions & 9 deletions jupyterhub/templates/scheduling/user-scheduler/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,28 @@ metadata:
data:
{{- /*
This is configuration of a k8s official kube-scheduler binary running in the
user-scheduler pod.
user-scheduler.

ref: https://kubernetes.io/docs/reference/scheduling/config/
ref: https://kubernetes.io/docs/reference/config-api/kube-scheduler-config.v1beta3/
ref: https://kubernetes.io/docs/reference/config-api/kube-scheduler-config.v1/
The config version and kube-scheduler binary version has a fallback for k8s
clusters versioned v1.23 or lower because:

kubescheduler.config.k8s.io/v1beta3 requires kube-scheduler binary version >=1.23
kubescheduler.config.k8s.io/v1 requires kube-scheduler binary version >=1.25
- v1 / v1beta3 config requires kube-scheduler binary >=1.25 / >=1.23
- kube-scheduler binary >=1.25 requires storage.k8s.io/v1/CSIStorageCapacity
available first in k8s >=1.24

FIXME: Add logic to transition from v1beta3 to v1 if its supported.
v1beta3 is likeley to be removed in k8s 1.27.
ref: https://kubernetes.io/docs/reference/scheduling/config/
ref: https://kubernetes.io/docs/reference/config-api/kube-scheduler-config.v1/
ref: https://kubernetes.io/docs/reference/config-api/kube-scheduler-config.v1beta3/
*/}}
config.yaml: |
{{- if semverCompare ">=1.24.0-0" .Capabilities.KubeVersion.Version }}
apiVersion: kubescheduler.config.k8s.io/v1
{{- else }}
apiVersion: kubescheduler.config.k8s.io/v1beta3
{{- end }}
kind: KubeSchedulerConfiguration
leaderElection:
resourceLock: endpoints
resourceLock: endpointsleases
resourceName: {{ include "jupyterhub.user-scheduler-lock.fullname" . }}
resourceNamespace: "{{ .Release.Namespace }}"
profiles:
Expand Down
10 changes: 10 additions & 0 deletions jupyterhub/templates/scheduling/user-scheduler/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ spec:
{{- end }}
containers:
- name: kube-scheduler
{{- if semverCompare ">=1.24.0-0" .Capabilities.KubeVersion.Version }}
image: {{ .Values.scheduling.userScheduler.image.name }}:{{ .Values.scheduling.userScheduler.image.tag }}
{{- else }}
# WARNING: The tag of this image is hardcoded, and the
# "scheduling.userScheduler.image.tag" configuration of the
# Helm chart that generated this resource manifest isn't
# respected. If you install the Helm chart in a k8s cluster
# versioned 1.24 or higher, your configuration will be
# respected.
image: {{ .Values.scheduling.userScheduler.image.name }}:v1.23.14
{{- end }}
{{- with .Values.scheduling.userScheduler.image.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ scheduling:
# workflow, and should be updated there if a minor version bump is done
# here.
#
tag: "v1.23.14" # ref: https://github.com/kubernetes/website/blob/main/content/en/releases/patch-releases.md
tag: "v1.25.4" # ref: https://github.com/kubernetes/website/blob/main/content/en/releases/patch-releases.md
pullPolicy:
pullSecrets: []
nodeSelector: {}
Expand Down
2 changes: 1 addition & 1 deletion tools/templates/lint-and-validate-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ scheduling:
plugins:
score:
disabled:
- name: SelectorSpread
- name: PodTopologySpread
enabled:
- name: NodePreferAvoidPods
weight: 161051
Expand Down

0 comments on commit 65df9c3

Please sign in to comment.