Skip to content

Commit

Permalink
move default affinity to values and use tpl function
Browse files Browse the repository at this point in the history
Apply automatic changes
  • Loading branch information
gionn committed Jan 5, 2024
1 parent 00e37eb commit a841e43
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 168 deletions.
14 changes: 7 additions & 7 deletions charts/alfresco-transform-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A Helm chart for deploying Alfresco Transform Services

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| filestore.affinity | object | `{}` | |
| filestore.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.filestore.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.filestore.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function |
| filestore.enabled | bool | `true` | |
| filestore.environment."scheduler.cleanup.interval" | string | `"86400000"` | |
| filestore.environment."scheduler.content.age.millis" | string | `"86400000"` | |
Expand Down Expand Up @@ -65,7 +65,7 @@ A Helm chart for deploying Alfresco Transform Services
| global.alfrescoRegistryPullSecrets | string | `"quay-registry-secret"` | |
| global.strategy.rollingUpdate.maxSurge | int | `1` | |
| global.strategy.rollingUpdate.maxUnavailable | int | `0` | |
| imagemagick.affinity | object | `{}` | |
| imagemagick.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.imagemagick.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.imagemagick.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function |
| imagemagick.enabled | bool | `true` | |
| imagemagick.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | |
| imagemagick.image.internalPort | int | `8090` | |
Expand Down Expand Up @@ -100,7 +100,7 @@ A Helm chart for deploying Alfresco Transform Services
| imagemagick.tolerations | list | `[]` | |
| imagemagick.volumeMounts | list | `[]` | |
| imagemagick.volumes | list | `[]` | |
| libreoffice.affinity | object | `{}` | |
| libreoffice.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.libreoffice.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.libreoffice.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function |
| libreoffice.enabled | bool | `true` | |
| libreoffice.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | |
| libreoffice.image.internalPort | int | `8090` | |
Expand Down Expand Up @@ -143,7 +143,7 @@ A Helm chart for deploying Alfresco Transform Services
| messageBroker.password | string | `nil` | Activemq password |
| messageBroker.url | string | `nil` | Activemq connection url (e.g. failover:(nio://my-broker:61616)?timeout=3000&jms.useCompression=true) |
| messageBroker.user | string | `nil` | Activemq username |
| pdfrenderer.affinity | object | `{}` | |
| pdfrenderer.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.pdfrenderer.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.pdfrenderer.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function |
| pdfrenderer.enabled | bool | `true` | |
| pdfrenderer.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | |
| pdfrenderer.image.internalPort | int | `8090` | |
Expand Down Expand Up @@ -182,7 +182,7 @@ A Helm chart for deploying Alfresco Transform Services
| serviceAccount.automount | bool | `true` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| tika.affinity | object | `{}` | |
| tika.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.tika.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.tika.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function |
| tika.enabled | bool | `true` | |
| tika.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | |
| tika.image.internalPort | int | `8090` | |
Expand Down Expand Up @@ -217,7 +217,7 @@ A Helm chart for deploying Alfresco Transform Services
| tika.tolerations | list | `[]` | |
| tika.volumeMounts | list | `[]` | |
| tika.volumes | list | `[]` | |
| transformmisc.affinity | object | `{}` | |
| transformmisc.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.transform-misc.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.transform-misc.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function |
| transformmisc.enabled | bool | `true` | |
| transformmisc.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | |
| transformmisc.image.internalPort | int | `8090` | |
Expand Down Expand Up @@ -252,7 +252,7 @@ A Helm chart for deploying Alfresco Transform Services
| transformmisc.tolerations | list | `[]` | |
| transformmisc.volumeMounts | list | `[]` | |
| transformmisc.volumes | list | `[]` | |
| transformrouter.affinity | object | `{}` | |
| transformrouter.affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.transform-router.name\" . }}\n topologyKey: topology.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - {{ template \"alfresco-transform-service.transform-router.name\" . }}\n topologyKey: app.kubernetes.io/name"` | Pod affinity, passed thru tpl function |
| transformrouter.enabled | bool | `true` | |
| transformrouter.environment.JAVA_OPTS | string | `"-XX:MinRAMPercentage=50 -XX:MaxRAMPercentage=80"` | |
| transformrouter.image.internalPort | int | `8095` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "alfresco-transform-service.serviceAccountName" . }}
{{- include "alfresco-common.component-pod-security-context" .Values.filestore | indent 4 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.filestore.name" . }}
topologyKey: failure-domain.beta.kubernetes.io/zone
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.filestore.name" . }}
topologyKey: kubernetes.io/hostname
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.filestore.image.repository }}:{{ .Values.filestore.image.tag }}"
Expand Down Expand Up @@ -81,7 +60,7 @@ spec:
{{- end }}
{{- with .Values.filestore.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.filestore.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "alfresco-transform-service.serviceAccountName" . }}
{{- include "alfresco-common.component-pod-security-context" .Values.imagemagick| indent 4 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.imagemagick.name" . }}
topologyKey: failure-domain.beta.kubernetes.io/zone
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.imagemagick.name" . }}
topologyKey: kubernetes.io/hostname
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.imagemagick.image.repository }}:{{ .Values.imagemagick.image.tag }}"
Expand Down Expand Up @@ -79,7 +58,7 @@ spec:
{{- end }}
{{- with .Values.imagemagick.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.imagemagick.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "alfresco-transform-service.serviceAccountName" . }}
{{- include "alfresco-common.component-pod-security-context" .Values.libreoffice | indent 4 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.libreoffice.name" . }}
topologyKey: failure-domain.beta.kubernetes.io/zone
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.libreoffice.name" . }}
topologyKey: kubernetes.io/hostname
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.libreoffice.image.repository }}:{{ .Values.libreoffice.image.tag }}"
Expand Down Expand Up @@ -79,7 +58,7 @@ spec:
{{- end }}
{{- with .Values.libreoffice.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.libreoffice.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "alfresco-transform-service.serviceAccountName" . }}
{{- include "alfresco-common.component-pod-security-context" .Values.pdfrenderer | indent 4 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.pdfrenderer.name" . }}
topologyKey: failure-domain.beta.kubernetes.io/zone
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.pdfrenderer.name" . }}
topologyKey: kubernetes.io/hostname
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.pdfrenderer.image.repository }}:{{ .Values.pdfrenderer.image.tag }}"
Expand Down Expand Up @@ -79,7 +58,7 @@ spec:
{{- end }}
{{- with .Values.pdfrenderer.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.pdfrenderer.tolerations }}
tolerations:
Expand Down
23 changes: 1 addition & 22 deletions charts/alfresco-transform-service/templates/deployment-tika.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "alfresco-transform-service.serviceAccountName" . }}
{{- include "alfresco-common.component-pod-security-context" .Values.tika | indent 4 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.tika.name" . }}
topologyKey: failure-domain.beta.kubernetes.io/zone
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.tika.name" . }}
topologyKey: kubernetes.io/hostname
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.tika.image.repository }}:{{ .Values.tika.image.tag }}"
Expand Down Expand Up @@ -79,7 +58,7 @@ spec:
{{- end }}
{{- with .Values.tika.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.tika.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "alfresco-transform-service.serviceAccountName" . }}
{{- include "alfresco-common.component-pod-security-context" .Values.transformmisc | indent 4 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.transform-misc.name" . }}
topologyKey: failure-domain.beta.kubernetes.io/zone
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.transform-misc.name" . }}
topologyKey: kubernetes.io/hostname
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.transformmisc.image.repository }}:{{ .Values.transformmisc.image.tag }}"
Expand Down Expand Up @@ -79,7 +58,7 @@ spec:
{{- end }}
{{- with .Values.transformmisc.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.transformmisc.tolerations }}
tolerations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,6 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
serviceAccountName: {{ include "alfresco-transform-service.serviceAccountName" . }}
{{- include "alfresco-common.component-pod-security-context" .Values.transformrouter | indent 4 }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.transform-router.name" . }}
topologyKey: failure-domain.beta.kubernetes.io/zone
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- {{ template "alfresco-transform-service.transform-router.name" . }}
topologyKey: kubernetes.io/hostname
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.transformrouter.image.repository }}:{{ .Values.transformrouter.image.tag }}"
Expand Down Expand Up @@ -79,7 +58,7 @@ spec:
{{- end }}
{{- with .Values.transformrouter.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.transformrouter.tolerations }}
tolerations:
Expand Down
26 changes: 26 additions & 0 deletions charts/alfresco-transform-service/tests/deployments_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,29 @@ tests:
path: spec.template.spec.volumes
content: *volumes_content
template: deployment-transform-router.yaml

- it: should render default affinity in every deployment
values:
- values/test_values.yaml
asserts:
- exists:
path: spec.template.spec.affinity.podAntiAffinity
template: deployment-filestore.yaml
- exists:
path: spec.template.spec.affinity.podAntiAffinity
template: deployment-imagemagick.yaml
- exists:
path: spec.template.spec.affinity.podAntiAffinity
template: deployment-libreoffice.yaml
- exists:
path: spec.template.spec.affinity.podAntiAffinity
template: deployment-pdfrenderer.yaml
- exists:
path: spec.template.spec.affinity.podAntiAffinity
template: deployment-tika.yaml
- exists:
path: spec.template.spec.affinity.podAntiAffinity
template: deployment-transform-misc.yaml
- exists:
path: spec.template.spec.affinity.podAntiAffinity
template: deployment-transform-router.yaml
Loading

0 comments on commit a841e43

Please sign in to comment.