Skip to content

Commit

Permalink
OPSEXP-2115: apply consistent affinity rules by default on appropriat…
Browse files Browse the repository at this point in the history
…e workloads (#315)
  • Loading branch information
alxgomz committed Jun 18, 2024
1 parent 8cec9e8 commit 4abadc6
Show file tree
Hide file tree
Showing 82 changed files with 1,581 additions and 364 deletions.
6 changes: 3 additions & 3 deletions charts/alfresco-activiti/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: alfresco-common
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 3.1.2
version: 3.1.3
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 12.8.5
digest: sha256:246b7e17ba0ec1f58a318abbb41ae6ee7f364dc96ca918b3941f142adc6ed3cf
generated: "2024-03-20T14:27:16.899283+01:00"
digest: sha256:d1cd8ace32813475a37b795b22f4ceca712d1db925ee3d963e4f6bd9650fdd15
generated: "2024-06-17T17:54:33.458044+02:00"
4 changes: 2 additions & 2 deletions charts/alfresco-activiti/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v2
description: A Helm chart for Alfresco Activiti
name: alfresco-activiti
version: 0.1.1
version: 0.2.0-alpha.0
appVersion: 24.2.0
dependencies:
- name: alfresco-common
version: 3.1.2
version: 3.1.3
repository: https://alfresco.github.io/alfresco-helm-charts/
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
Expand Down
7 changes: 4 additions & 3 deletions charts/alfresco-activiti/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ parent: Charts Reference

# alfresco-activiti

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![AppVersion: 24.2.0](https://img.shields.io/badge/AppVersion-24.2.0-informational?style=flat-square)
![Version: 0.2.0-alpha.0](https://img.shields.io/badge/Version-0.2.0--alpha.0-informational?style=flat-square) ![AppVersion: 24.2.0](https://img.shields.io/badge/AppVersion-24.2.0-informational?style=flat-square)

A Helm chart for Alfresco Activiti

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.1.2 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.1.3 |
| oci://registry-1.docker.io/bitnamicharts | postgresql | 12.8.5 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-activiti.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"topology.kubernetes.io/zone"},"weight":10}` | Prefer to schedule pods in different zones |
| affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[1] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-activiti.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"kubernetes.io/hostname"},"weight":5}` | Prefer to schedule pods in different nodes |
| database.driver | string | `nil` | JDBC driver Class |
| database.existingConfigMap.keys.driver | string | `"DATABASE_DRIVER"` | configmap key where to find the JDBC driver Class for aps app |
| database.existingConfigMap.keys.url | string | `"DATABASE_URL"` | configmap key where to find the URL of the database for aps app |
Expand Down
2 changes: 1 addition & 1 deletion charts/alfresco-activiti/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ spec:
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
Expand Down
44 changes: 41 additions & 3 deletions charts/alfresco-activiti/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ templates:
- pvc.yaml
tests:
- it: should have basic metadata in place in deployment & default config
template: deployment.yaml
asserts:
- equal:
path: metadata.name
value: RELEASE-NAME-alfresco-activiti
template: deployment.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
Expand All @@ -19,7 +19,6 @@ tests:
configMapKeyRef:
name: RELEASE-NAME-alfresco-activiti-database
key: DATABASE_URL
template: deployment.yaml
- contains:
path: spec.template.spec.containers[0].env
content:
Expand All @@ -28,7 +27,46 @@ tests:
secretKeyRef:
name: RELEASE-NAME-alfresco-activiti-database
key: DATABASE_USERNAME
template: deployment.yaml
- contains:
path: spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
content:
weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- alfresco-activiti
- key: app.kubernetes.io/instance
operator: In
values:
- RELEASE-NAME
- key: app.kubernetes.io/component
operator: In
values:
- alfresco-activiti
topologyKey: topology.kubernetes.io/zone
- contains:
path: spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
content:
weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- alfresco-activiti
- key: app.kubernetes.io/instance
operator: In
values:
- RELEASE-NAME
- key: app.kubernetes.io/component
operator: In
values:
- alfresco-activiti
topologyKey: kubernetes.io/hostname
- it: should have basic metadata in place in deployment & default config
set:
envFromExistingConfigMap: apscfg
Expand Down
42 changes: 41 additions & 1 deletion charts/alfresco-activiti/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ volumes: []
volumeMounts: []
nodeSelector: {}
tolerations: []
affinity: {}
database:
# -- JDBC url to connect to the external DB for aps app
url: null
Expand Down Expand Up @@ -166,3 +165,44 @@ workaround:
tags:
# -- A chart tag used for Hyland's CI purpose. Do not set it to true.
ci: false
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
# -- Prefer to schedule pods in different zones
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- >-
{{ template "alfresco-activiti.name" $ }}
- key: app.kubernetes.io/instance
operator: In
values:
- "{{ $.Release.Name }}"
- key: app.kubernetes.io/component
operator: In
values:
- "{{ $.Chart.Name }}"
topologyKey: topology.kubernetes.io/zone
# -- Prefer to schedule pods in different nodes
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- >-
{{ template "alfresco-activiti.name" $ }}
- key: app.kubernetes.io/instance
operator: In
values:
- "{{ $.Release.Name }}"
- key: app.kubernetes.io/component
operator: In
values:
- "{{ $.Chart.Name }}"
topologyKey: kubernetes.io/hostname
2 changes: 1 addition & 1 deletion charts/alfresco-ai-transformer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: alfresco-ai-transformer
description: A Helm chart for deploying Alfresco ai transformer service
type: application
version: 1.2.3
version: 2.0.0-alpha.0
appVersion: 3.1.3
dependencies:
- name: alfresco-common
Expand Down
5 changes: 3 additions & 2 deletions charts/alfresco-ai-transformer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parent: Charts Reference

# alfresco-ai-transformer

![Version: 1.2.3](https://img.shields.io/badge/Version-1.2.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.1.3](https://img.shields.io/badge/AppVersion-3.1.3-informational?style=flat-square)
![Version: 2.0.0-alpha.0](https://img.shields.io/badge/Version-2.0.0--alpha.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.1.3](https://img.shields.io/badge/AppVersion-3.1.3-informational?style=flat-square)

A Helm chart for deploying Alfresco ai transformer service

Expand All @@ -22,7 +22,8 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app.kubernetes.io/name\n operator: In\n values:\n - {{ template \"alfresco-ai-transformer.name\" $ }}\n - key: app.kubernetes.io/instance\n operator: In\n values:\n - {{ $.Release.Name }}\n topologyKey: topology.kubernetes.io/zone"` | string representation of the YAML affinity rules (can use templates) |
| affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-ai-transformer.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"topology.kubernetes.io/zone"},"weight":10}` | Prefer to schedule pods in different zones |
| affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[1] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-ai-transformer.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ $.Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"kubernetes.io/hostname"},"weight":5}` | Prefer to schedule pods in different nodes |
| args | list | `[]` | |
| aws.accessKeyId | string | `nil` | AWS credentials are required as documented at https://docs.alfresco.com/intelligence-services/latest/config/#default-configuration |
| aws.comprehendRoleARN | string | `nil` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ spec:
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
initContainers:
{{- toYaml .Values.extraInitContainers | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,47 @@ tests:
configMapKeyRef:
name: RELEASE-NAME-aws-comprehend
key: AWS_COMPREHEND_ROLE_ARN
- contains:
path: spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
content:
weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- alfresco-ai-transformer
- key: app.kubernetes.io/instance
operator: In
values:
- RELEASE-NAME
- key: app.kubernetes.io/component
operator: In
values:
- alfresco-ai-transformer
topologyKey: topology.kubernetes.io/zone
- contains:
path: spec.template.spec.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution
content:
weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- alfresco-ai-transformer
- key: app.kubernetes.io/instance
operator: In
values:
- RELEASE-NAME
- key: app.kubernetes.io/component
operator: In
values:
- alfresco-ai-transformer
topologyKey: kubernetes.io/hostname

- equal:
path: spec.template.spec.serviceAccountName
value: ai-transformer-sa
Expand Down
32 changes: 28 additions & 4 deletions charts/alfresco-ai-transformer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -514,23 +514,47 @@ messageBroker:
password: BROKER_PASSWORD
nodeSelector: {}
tolerations: []
# -- string representation of the YAML affinity rules (can use templates)
affinity: |-
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
# -- Prefer to schedule pods in different zones
- weight: 10
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- {{ template "alfresco-ai-transformer.name" $ }}
- >-
{{ template "alfresco-ai-transformer.name" $ }}
- key: app.kubernetes.io/instance
operator: In
values:
- {{ $.Release.Name }}
- "{{ $.Release.Name }}"
- key: app.kubernetes.io/component
operator: In
values:
- "{{ $.Chart.Name }}"
topologyKey: topology.kubernetes.io/zone
# -- Prefer to schedule pods in different nodes
- weight: 5
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- >-
{{ template "alfresco-ai-transformer.name" $ }}
- key: app.kubernetes.io/instance
operator: In
values:
- "{{ $.Release.Name }}"
- key: app.kubernetes.io/component
operator: In
values:
- "{{ $.Chart.Name }}"
topologyKey: kubernetes.io/hostname
extraVolumes: []
extraVolumeMounts: []
extraInitContainers: []
Expand Down
6 changes: 3 additions & 3 deletions charts/alfresco-connector-ms365/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: alfresco-common
repository: https://alfresco.github.io/alfresco-helm-charts/
version: 3.1.2
digest: sha256:230deb46616c8921522dc68470ba18d8d445b931e8eb49ba09d4d3042732a24b
generated: "2024-04-16T10:35:09.31028155Z"
version: 3.1.3
digest: sha256:aa16cabbeb3d227803dff9c0d097d6e52afa97d741793607156d4573c3d4bc47
generated: "2024-06-17T11:00:03.523001+02:00"
4 changes: 2 additions & 2 deletions charts/alfresco-connector-ms365/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: v2
name: alfresco-connector-ms365
description: A Helm chart for deploying Alfresco connector ms365 service
type: application
version: 0.7.1
version: 1.0.0-alpha.0
appVersion: 2.0.1
dependencies:
- name: alfresco-common
version: 3.1.2
version: 3.1.3
repository: https://alfresco.github.io/alfresco-helm-charts/
7 changes: 4 additions & 3 deletions charts/alfresco-connector-ms365/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parent: Charts Reference

# alfresco-connector-ms365

![Version: 0.7.1](https://img.shields.io/badge/Version-0.7.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.1](https://img.shields.io/badge/AppVersion-2.0.1-informational?style=flat-square)
![Version: 1.0.0-alpha.0](https://img.shields.io/badge/Version-1.0.0--alpha.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.1](https://img.shields.io/badge/AppVersion-2.0.1-informational?style=flat-square)

A Helm chart for deploying Alfresco connector ms365 service

Expand All @@ -15,13 +15,14 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs

| Repository | Name | Version |
|------------|------|---------|
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.1.2 |
| https://alfresco.github.io/alfresco-helm-charts/ | alfresco-common | 3.1.3 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | string | `"podAntiAffinity:\n preferredDuringSchedulingIgnoredDuringExecution:\n - weight: 10\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app.kubernetes.io/name\n operator: In\n values:\n - {{ template \"alfresco-connector-ms365.name\" . }}\n - key: app.kubernetes.io/instance\n operator: In\n values:\n - {{ .Release.Name }}\n topologyKey: failure-domain.beta.kubernetes.io/zone\n - weight: 5\n podAffinityTerm:\n labelSelector:\n matchExpressions:\n - key: app.kubernetes.io/name\n operator: In\n values:\n - {{ template \"alfresco-connector-ms365.name\" . }}\n - key: app.kubernetes.io/instance\n operator: In\n values:\n - {{ .Release.Name }}\n topologyKey: kubernetes.io/hostname"` | Pod affinity, passed thru tpl function |
| affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-connector-ms365.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ .Release.Name }}"]},{"key":"app.kubernetes.io/component","operator":"In","values":["{{ $.Chart.Name }}"]}]},"topologyKey":"topology.kubernetes.io/zone"},"weight":10}` | Prefer to schedule pods in different zones |
| affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[1] | object | `{"podAffinityTerm":{"labelSelector":{"matchExpressions":[{"key":"app.kubernetes.io/name","operator":"In","values":["{{ template \"alfresco-connector-ms365.name\" $ }}"]},{"key":"app.kubernetes.io/instance","operator":"In","values":["{{ .Release.Name }}"]}]},"topologyKey":"kubernetes.io/hostname"},"weight":5}` | Prefer to schedule pods in different nodes |
| environment | object | `{}` | |
| global.alfrescoRegistryPullSecrets | string | `"quay-registry-secret"` | |
| image.internalPort | int | `9095` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
Expand Down
Loading

0 comments on commit 4abadc6

Please sign in to comment.