Skip to content

Commit

Permalink
Bugfixes pre merge of PR jupyterhub#758
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Jul 11, 2018
1 parent f46ae5b commit 3c60e26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 14 additions & 2 deletions jupyterhub/templates/scheduling/_scheduling-helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,17 @@ tolerations:
{{- end }}

{{- define "jupyterhub.podAffinityRequired" -}}
{{- if eq .podKind "core" -}}
{{- else if eq .podKind "user" -}}
{{- if .Values.singleuser.extraPodAffinity.required }}
{{- .Values.singleuser.extraPodAffinity.required | toYaml | trimSuffix "\n" | nindent 0 }}
{{- end }}
{{- end }}
{{- end }}

{{- define "jupyterhub.podAffinityPreferred" -}}
{{- if eq .podKind "core" -}}
{{- else if eq .podKind "user" -}}
{{- if .Values.scheduling.userPods.podAffinity.preferScheduleNextToRealUsers -}}
- weight: 100
podAffinityTerm:
Expand All @@ -111,28 +116,35 @@ tolerations:
{{- .Values.singleuser.extraPodAffinity.preferred | toYaml | trimSuffix "\n" | nindent 0 }}
{{- end }}
{{- end }}
{{- end }}

{{- define "jupyterhub.podAntiAffinityRequired" -}}
{{- if eq .podKind "core" -}}
{{- else if eq .podKind "user" -}}
{{- if .Values.singleuser.extraPodAntiAffinity.required -}}
{{- .Values.singleuser.extraPodAntiAffinity.required | toYaml | trimSuffix "\n" | nindent 0 }}
{{- end }}
{{- end }}
{{- end }}

{{- define "jupyterhub.podAntiAffinityPreferred" -}}
{{- if eq .component "scheduler" -}}
{{- if eq .podKind "core" -}}
{{- if eq .component "user-scheduler" -}}
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: component
operator: In
values: [scheduler]
values: [user-scheduler]
topologyKey: kubernetes.io/hostname
{{- end }}
{{- else if eq .podKind "user" -}}
{{- if .Values.singleuser.extraPodAntiAffinity.preferred -}}
{{- .Values.singleuser.extraPodAntiAffinity.preferred | toYaml | trimSuffix "\n" | nindent 0 }}
{{- end }}
{{- end }}
{{- end }}



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ metadata:
name: user-scheduler
labels:
{{- include "jupyterhub.labels" . | nindent 4 }}

data:
policy.cfg: |
{
Expand All @@ -29,7 +28,7 @@ data:
{ "name": "NodePreferAvoidPodsPriority", "weight": 10000 },
{ "name": "NodeAffinityPriority", "weight": 1000 },
{ "name": "InterPodAffinityPriority", "weight": 100 },
{ "name": "MostRequestedPriority", "weight": 50 },
{ "name": "MostRequestedPriority", "weight": 50 }
],
"hardPodAffinitySymmetricWeight" : 100,
"alwaysCheckAllPredicates" : true
Expand Down

0 comments on commit 3c60e26

Please sign in to comment.