Skip to content

Commit

Permalink
Add the ability to set up pod individual assignment (#308)
Browse files Browse the repository at this point in the history
* Add the ability to set up pod individual assignment

* Add the ability to set up example pod assignment
  • Loading branch information
VyacheslavSemin authored May 7, 2024
1 parent 1583c33 commit 24a6dd1
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 38 deletions.
22 changes: 20 additions & 2 deletions README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions templates/deployments/converter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ spec:
nodeAffinity:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.converter.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.converter.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.converter.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.converter.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
8 changes: 4 additions & 4 deletions templates/deployments/docservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ spec:
nodeAffinity:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.docservice.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.docservice.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.docservice.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.docservice.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
8 changes: 4 additions & 4 deletions templates/jobs/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ spec:
{{- end }}
spec:
serviceAccountName: dashboard-sa
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.grafanaDashboard.job.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.grafanaDashboard.job.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.grafanaDashboard.job.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.grafanaDashboard.job.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- toYaml .Values.podSecurityContext.jobs | nindent 8 }}
Expand Down
8 changes: 4 additions & 4 deletions templates/jobs/pre-delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ include "ds.serviceAccountName" . }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.delete.job.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.delete.job.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.delete.job.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.delete.job.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- toYaml .Values.podSecurityContext.jobs | nindent 8 }}
Expand Down
8 changes: 4 additions & 4 deletions templates/jobs/pre-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ include "ds.serviceAccountName" . }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.install.job.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.install.job.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.install.job.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.install.job.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- toYaml .Values.podSecurityContext.jobs | nindent 8 }}
Expand Down
8 changes: 4 additions & 4 deletions templates/jobs/pre-rollback.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ include "ds.serviceAccountName" . }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.rollback.job.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.rollback.job.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.rollback.job.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.rollback.job.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- toYaml .Values.podSecurityContext.jobs | nindent 8 }}
Expand Down
8 changes: 4 additions & 4 deletions templates/jobs/pre-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ include "ds.serviceAccountName" . }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.upgrade.job.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.upgrade.job.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.upgrade.job.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.upgrade.job.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- toYaml .Values.podSecurityContext.jobs | nindent 8 }}
Expand Down
8 changes: 4 additions & 4 deletions templates/statefulset/example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ spec:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
{{- if or .Values.nodeSelector .Values.example.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.example.nodeSelector) | nindent 8 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 8 }}
{{- if or .Values.tolerations .Values.example.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.example.tolerations) | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
8 changes: 4 additions & 4 deletions templates/tests/test-ds-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ spec:
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- toYaml .Values.podSecurityContext.tests | nindent 4 }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 4 }}
{{- if or .Values.nodeSelector .Values.tests.nodeSelector }}
nodeSelector: {{ toYaml (default .Values.nodeSelector .Values.tests.nodeSelector) | nindent 4 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations: {{ toYaml .Values.tolerations | nindent 4 }}
{{- if or .Values.tolerations .Values.tests.tolerations }}
tolerations: {{ toYaml (default .Values.tolerations .Values.tests.tolerations) | nindent 4 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
56 changes: 56 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ podAntiAffinity:
## podAntiAffinity.weight Priority when selecting node. It is in the range from 1 to 100. Used only when `podAntiAffinity.type=soft`
weight: "100"
## nodeSelector Node labels for pods assignment
## Each ONLYOFFICE Docs services can override the values specified here with its own
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
nodeSelector: {}
## tolerations Tolerations for pods assignment
## Each ONLYOFFICE Docs services can override the values specified here with its own
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
tolerations: []
## imagePullSecrets Container image registry secret name
Expand Down Expand Up @@ -400,6 +402,12 @@ docservice:
## - name1
## - name2
nodeAffinity: {}
## docservice.nodeSelector Node labels for Docservice Pods assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## docservice.tolerations Tolerations for Docservice Pods assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
## Horizontal Pod Autoscaling parameters
## Horizontal Pod Autoscaling is used for autoscaling of the Docservice deployment
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Expand Down Expand Up @@ -773,6 +781,12 @@ converter:
## - zone1
## - zone2
nodeAffinity: {}
## converter.nodeSelector Node labels for Converter Pods assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## converter.tolerations Tolerations for Converter Pods assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
## Horizontal Pod Autoscaling parameters
## Horizontal Pod Autoscaling is used for autoscaling of the Converter deployment
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
Expand Down Expand Up @@ -967,6 +981,12 @@ example:
## - zone1
## - zone2
nodeAffinity: {}
## example.nodeSelector Node labels for Example Pods assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## example.tolerations Tolerations for Example Pods assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
## Example container image parameters
image:
## example.image.repository example container image name
Expand Down Expand Up @@ -1082,6 +1102,12 @@ install:
annotations: {}
## install.job.podAnnotations Map of annotations to add to the pre-install Pod
podAnnotations: {}
## install.job.nodeSelector Node labels for pre-install Job Pod assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## install.job.tolerations Tolerations for pre-install Job Pod assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
image:
## install.job.image.repository Job by pre-install ONLYOFFICE Docs image repository
repository: onlyoffice/docs-utils
Expand Down Expand Up @@ -1147,6 +1173,12 @@ upgrade:
annotations: {}
## upgrade.job.podAnnotations Map of annotations to add to the pre-upgrade Pod
podAnnotations: {}
## upgrade.job.nodeSelector Node labels for pre-upgrade Job Pod assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## upgrade.job.tolerations Tolerations for pre-upgrade Job Pod assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
image:
## upgrade.job.image.repository Job by upgrade image repository
repository: onlyoffice/docs-utils
Expand Down Expand Up @@ -1220,6 +1252,12 @@ rollback:
annotations: {}
## rollback.job.podAnnotations Map of annotations to add to the pre-rollback Pod
podAnnotations: {}
## rollback.job.nodeSelector Node labels for pre-rollback Job Pod assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## rollback.job.tolerations Tolerations for pre-rollback Job Pod assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
image:
## rollback.job.image.repository Job by rollback image repository
repository: onlyoffice/docs-utils
Expand Down Expand Up @@ -1293,6 +1331,12 @@ delete:
annotations: {}
## delete.job.podAnnotations Map of annotations to add to the pre-delete Pod
podAnnotations: {}
## delete.job.nodeSelector Node labels for pre-delete Job Pod assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## delete.job.tolerations Tolerations for pre-delete Job Pod assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
image:
## delete.job.image.repository Job by delete image repository
repository: onlyoffice/docs-utils
Expand Down Expand Up @@ -1357,6 +1401,12 @@ grafanaDashboard:
annotations: {}
## grafanaDashboard.job.podAnnotations Map of annotations to add to the Grafana Dashboard Pod
podAnnotations: {}
## grafanaDashboard.job.nodeSelector Node labels for Grafana Dashboard Job Pod assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## grafanaDashboard.job.tolerations Tolerations for Grafana Dashboard Job Pod assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
image:
## grafanaDashboard.job.image.repository Job by Grafana Dashboard ONLYOFFICE Docs image repository
repository: onlyoffice/docs-utils
Expand Down Expand Up @@ -1406,6 +1456,12 @@ tests:
## If set to, it takes priority over the `commonAnnotations`
## You can also use `tpl` as the value for the key
annotations: {}
## tests.nodeSelector Node labels for Test Pod assignment
## If set to, it takes priority over the `nodeSelector`
nodeSelector: {}
## tests.tolerations Tolerations for Test Pod assignment
## If set to, it takes priority over the `tolerations`
tolerations: []
## Test container image parameters
image:
## tests.image.repository test container image name
Expand Down

0 comments on commit 24a6dd1

Please sign in to comment.