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 pod affinity and fix pod tollerations #492

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion deploy/kubernetes/helm/sloth/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: Base chart for Sloth.
type: application
home: https://github.com/slok/sloth
kubeVersion: ">= 1.19.0-0"
version: 0.7.0
version: 0.7.1
19 changes: 11 additions & 8 deletions deploy/kubernetes/helm/sloth/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | trim | indent 12 }}
{{- end }}
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.commonPlugins.enabled }}
- name: git-sync-plugins
image: {{ .Values.commonPlugins.image.repository }}:{{ .Values.commonPlugins.image.tag }}
Expand All @@ -107,11 +103,11 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.commonPlugins.gitRepo.resources | nindent 12 }}
{{- toYaml .Values.commonPlugins.gitRepo.resources | nindent 12 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ include "sloth.imagePullSecrets" . | trim | indent 8 }}
{{- include "sloth.imagePullSecrets" . | trim | nindent 8 }}
{{- end }}
{{- if or .Values.commonPlugins.enabled .Values.customSloConfig.enabled }}
volumes:
Expand All @@ -126,4 +122,11 @@ spec:
name: {{ include "sloth.fullname" . }}
{{- end }}
{{- end }}

{{- with .Values.affinity }}
affinity:
{{- toYaml . | trim | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | trim | nindent 8 }}
{{- end }}
15 changes: 14 additions & 1 deletion deploy/kubernetes/helm/sloth/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,25 @@ customSloConfig:
# spec:
# ... See https://sloth.dev/usage/slo-period-windows/

# add deployment pod tolerations
# Pod affinity
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/os
# operator: In
# values:
# - linux
affinity: {}

# Pod tolerations
# tolerations:
# - key: kubernetes.azure.com/scalesetpriority
# operator: Equal
# value: spot
# effect: NoSchedule
tollerations: []

securityContext:
pod: null
Expand Down