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

feat(scheduling): per-Deployment k8s scheduling options #223

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
18 changes: 15 additions & 3 deletions charts/cryostat/README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions charts/cryostat/templates/cryostat_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ spec:
- http://localhost:8800
resources:
{{- toYaml .Values.datasource.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
{{- with (default .Values.nodeSelector .Values.core.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with (default .Values.affinity .Values.core.affinity) }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with (default .Values.tolerations .Values.core.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/cryostat/templates/db_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ spec:
- cryostat
resources:
{{- toYaml (.Values.db).resources | nindent 12 }}
{{- with .Values.nodeSelector }}
{{- with (default .Values.nodeSelector .Values.db.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with (default .Values.affinity .Values.db.affinity) }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with (default .Values.tolerations .Values.db.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/cryostat/templates/reports_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ spec:
failureThreshold: 2
resources:
{{- toYaml (.Values.reports).resources | nindent 12 }}
{{- with .Values.nodeSelector }}
{{- with (default .Values.nodeSelector .Values.reports.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with (default .Values.affinity .Values.reports.affinity) }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with (default .Values.tolerations .Values.reports.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/cryostat/templates/storage_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ spec:
timeoutSeconds: 5
resources:
{{- toYaml (.Values.storage).resources | nindent 12 }}
{{- with .Values.nodeSelector }}
{{- with (default .Values.nodeSelector .Values.storage.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
{{- with (default .Values.affinity .Values.storage.affinity) }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with (default .Values.tolerations .Values.storage.tolerations) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
118 changes: 117 additions & 1 deletion charts/cryostat/tests/cryostat_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,123 @@ tests:
path: spec.template.spec.affinity
- exists:
path: spec.template.spec.tolerations


- it: should accept specific nodeSelector setting
set:
core.nodeSelector:
diskType: ssd
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
diskType: ssd

- it: should prefer specific nodeSelector over general
set:
nodeSelector:
disktype: hdd
core.nodeSelector:
diskType: ssd
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
diskType: ssd

- it: should accept specific tolerations setting
set:
core.tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"

- it: should prefer specific tolerations over general
set:
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
core.tolerations:
- key: "key2"
operator: "Equal"
value: "value2"
effect: "NoSchedule"
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: "key2"
operator: "Equal"
value: "value2"
effect: "NoSchedule"

- it: should accept specific affinity setting
set:
core.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd

- it: should prefer specific affinity over general
set:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
core.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd

- it: should verify image pull policies for development snapshots
set:
core.image.tag: "4.0.0-snapshot"
Expand Down
118 changes: 117 additions & 1 deletion charts/cryostat/tests/db_deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,123 @@ tests:
path: spec.template.spec.affinity
- exists:
path: spec.template.spec.tolerations


- it: should accept specific nodeSelector setting
set:
db.nodeSelector:
diskType: ssd
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
diskType: ssd

- it: should prefer specific nodeSelector over general
set:
nodeSelector:
disktype: hdd
db.nodeSelector:
diskType: ssd
asserts:
- equal:
path: spec.template.spec.nodeSelector
value:
diskType: ssd

- it: should accept specific tolerations setting
set:
db.tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"

- it: should prefer specific tolerations over general
set:
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"
db.tolerations:
- key: "key2"
operator: "Equal"
value: "value2"
effect: "NoSchedule"
asserts:
- equal:
path: spec.template.spec.tolerations
value:
- key: "key2"
operator: "Equal"
value: "value2"
effect: "NoSchedule"

- it: should accept specific affinity setting
set:
db.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd

- it: should prefer specific affinity over general
set:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
db.affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd
asserts:
- equal:
path: spec.template.spec.affinity
value:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disktype
operator: In
values:
- ssd

- it: should verify image pull policies for development snapshots
set:
core.image.tag: "4.0.0-snapshot"
Expand Down
Loading
Loading