Skip to content

Commit

Permalink
feat(chart): add anti-affinity to stateful set (#915)
Browse files Browse the repository at this point in the history
Co-authored-by: Ralf Grubenmann <ralf.grubenmann@gmail.com>
Co-authored-by: Tasko Olevski <tasko.olevski@sdsc.ethz.ch>
  • Loading branch information
3 people authored Feb 9, 2022
1 parent 7240854 commit 67b3b80
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
13 changes: 12 additions & 1 deletion helm-chart/renku-notebooks/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,19 @@ spec:
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "notebooks.name" . }}
topologyKey: "kubernetes.io/hostname"
{{- with .Values.affinity }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
Expand Down
35 changes: 19 additions & 16 deletions helm-chart/renku-notebooks/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ global:
image:
repository: renku/certificates
tag: "0.0.1"
customCAs: []
customCAs:
[]
# - secret:

amalthea:
Expand Down Expand Up @@ -53,7 +54,7 @@ userSessionPersistentVolumes:
enabled: true
# storageClass: leave undefined to use default, otherwise specify required class
## Prevents from applying size limits if emptyDirs are used for user sessions.
## This may be desirable because going over the limit for an emptyDir results in
## This may be desirable because going over the limit for an emptyDir results in
## immediate eviction of the user session. EmptyDirs are used when the enabled flag
## above is set to false.
useEmptyDirSizeLimit: false
Expand All @@ -72,18 +73,18 @@ sentry:
## Sample rate is used for performance monitoring in sentry
sampleRate: 0.2

replicaCount: 1
replicaCount: 2

## Configure autoscaling
autoscaling:
enabled: false
minReplicas: 1
minReplicas: 2
maxReplicas: 5
targetCPUUtilizationPercentage: 50

image:
repository: renku/renku-notebooks
tag: 'latest'
tag: "latest"
pullPolicy: IfNotPresent

## Optionally specify an array of imagePullSecrets.
Expand Down Expand Up @@ -114,7 +115,7 @@ sessionIngress:
nginx.ingress.kubernetes.io/proxy-request-buffering: "off"

## Setup node selector, tolerations and node affinities for user sessions that are launched
## by the notebook service. These can be used so that user sessions are only scheduled on
## by the notebook service. These can be used so that user sessions are only scheduled on
## dedicated nodes rather than on all nodes in a cluster. A strict setup where session pods
## are scheduled only on dedicated nodes and nothing else is scheduled on said nodes would involve:
## (i) taints on the nodes to prevent other non-session workloads from getting scheduled there,
Expand Down Expand Up @@ -199,17 +200,17 @@ defaultSessionImage: "renku/renkulab-py:3.9-0.11.0"
gitRpcServer:
image:
name: renku/git-rpc-server
tag: 'latest'
tag: "latest"

gitHttpsProxy:
image:
name: renku/git-https-proxy
tag: 'latest'
tag: "latest"

gitClone:
image:
name: renku/git-clone
tag: 'latest'
tag: "latest"

service:
type: ClusterIP
Expand All @@ -221,7 +222,8 @@ rbac:

ingress:
enabled: false
annotations: {}
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
Expand All @@ -232,7 +234,8 @@ ingress:
# hosts:
# - chart-example.local

resources: {}
resources:
{}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
Expand All @@ -254,11 +257,11 @@ culling:
# How long before an idle session is removed from the cluster.
# Setting a value of zero below makes it so that a session is never culled.
idleThresholdSeconds:
anonymous: 43200 # 12 hours
registered: 86400 # 24 hours
anonymous: 43200 # 12 hours
registered: 86400 # 24 hours
maxAgeSecondsThreshold:
anonymous: 0 # do not cull sessions solely based on age (use activity)
registered: 0 # do not cull sessions solely based on age (use activity)
anonymous: 0 # do not cull sessions solely based on age (use activity)
registered: 0 # do not cull sessions solely based on age (use activity)

tests:
enabled: false
Expand All @@ -268,5 +271,5 @@ tests:
sessionTypes: ["registered"]
image:
repository: renku/renku-notebooks-tests
tag: 'latest'
tag: "latest"
pullPolicy: IfNotPresent

0 comments on commit 67b3b80

Please sign in to comment.