Skip to content

Commit

Permalink
feat: nodeselector for upgrade and install jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
theangryangel committed Dec 29, 2023
1 parent 3e51166 commit 9bb6d06
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/odoo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ maintainers:
# YYYYMMVERSION (i.e. 20220701 for the 1st version in July 2022, 20220702 for
# the 2nd in July 2022, 20220801 for the 1st version in August 2022, etc.)
# as the patch part of the version string.
version: 1.0.20230303
version: 1.0.20231229
17 changes: 12 additions & 5 deletions charts/odoo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An opinionated "Bring Your Own Image" Doodba (Odoo) Helm chart for Kubernetes

![Version: 1.0.20230303](https://img.shields.io/badge/Version-1.0.20230303-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 1.0.20231229](https://img.shields.io/badge/Version-1.0.20231229-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Opinionated odoo Bring Your Own Image chart designed for running [Doodba](https://github.com/Tecnativa/doodba) based Odoo deployments with Glodo defaults.

Expand All @@ -11,7 +11,7 @@ Includes support for:
* Multi deployment and replica (i.e. web, cron, and OCA/queue may be all run as separate deployments)
* [external-dns CRD](https://github.com/kubernetes-sigs/external-dns) support
* [cert-manager](https://cert-manager.io/) CRD support
* Both Traefik IngressRoute and Ingress
* Both Traefik IngressRoute and Ingress (:warning: Traefik IngressRoute is deprecated)
* Automatic running of [click-odoo-update](https://github.com/acsone/click-odoo-contrib#click-odoo-update-stable)
* Optional support for scaling down the installation before click-odoo-update runs

Expand Down Expand Up @@ -49,8 +49,11 @@ $ helm install my-release glodo/odoo -f ./helm-values.yaml
| image.repository | string | `"glodouk/CHANGEME"` | container image |
| image.tag | string | `""` | container tag |
| imagePullSecrets | list | `[]` | imagePullSecrets will be propagated to all containers, if set |
| install.affinity | object | `{}` | |
| install.enabled | bool | `false` | enable the pre-install hook to init the db |
| install.name | string | `"install"` | |
| install.nodeSelector | object | `{}` | |
| install.tolerations | list | `[]` | |
| longpolling.affinity | object | `{}` | |
| longpolling.config | string | `"[options]\nlimit_time_cpu = 360\nlimit_time_real = 360\nlimit_time_real_cron = 360\nmax_cron_threads = 0\nworkers = 4\nlongpolling_port = 8072\n"` | through environment variables |
| longpolling.enabled | bool | `false` | enable a separate longpolling / or websocket instance, both web and longpolling/websocket must be enabled |
Expand Down Expand Up @@ -96,9 +99,11 @@ $ helm install my-release glodo/odoo -f ./helm-values.yaml
| queue.securityContext | object | `{}` | |
| queue.tolerations | list | `[]` | |
| rollme | bool | `false` | - if true, a "rollme" annotation will be written to deployment manifests, that always changes every upgrade. If you do not tag your images this will be required to swap the container image |
| upgrade.affinity | object | `{}` | |
| upgrade.clickArgs | string | `"--ignore-core-addons"` | customisable arguments for click-odoo-update |
| upgrade.enabled | bool | `true` | enable click-odoo-update on helm chart upgrade |
| upgrade.name | string | `"upgrade"` | |
| upgrade.nodeSelector | object | `{}` | |
| upgrade.scale.enabled | bool | `false` | automatically scale down/up the existing deployments before/after upgrade |
| upgrade.scale.image.pullPolicy | string | `"Always"` | container pullPolicy |
| upgrade.scale.image.repository | string | `"bitnami/kubectl"` | container image |
Expand All @@ -109,10 +114,12 @@ $ helm install my-release glodo/odoo -f ./helm-values.yaml
| upgrade.scale.serviceAccount.create | bool | `true` | automatically create the service account |
| upgrade.scale.serviceAccount.name | string | `""` | if not set and create is true, upgrade.name is used |
| upgrade.scale.webCount | int | `0` | |
| velero.defaultVolumesToRestic | bool | `true` | see https://velero.io/docs/v1.9/customize-installation/#default-pod-volume-backup-to-restic |
| upgrade.tolerations | list | `[]` | |
| velero.defaultVolumesToFsBackup | bool | `false` | see https://velero.io/docs/v1.12/api-types/schedule/ |
| velero.defaultVolumesToRestic | bool | `false` | backwards compat, please migrate to defaultVolumesToFsBackup |
| velero.enabled | bool | `false` | enable creation of velero schedule |
| velero.extraHooks | list | `[]` | additional hooks |
| velero.includeClusterResources | bool | `false` | see https://velero.io/docs/v1.9/resource-filtering/#--include-cluster-resources |
| velero.includeClusterResources | bool | `false` | see https://velero.io/docs/v1.12/resource-filtering/#--include-cluster-resources |
| velero.name | string | `"backup"` | the schedule will be named `namespace-of-deployment-chart-name-name` |
| velero.pgDumpHook | bool | `true` | automatically take a pg_dump (custom format) of $PGDATABASE to /var/lib/odoo/$PGDATABASE.dump |
| velero.schedule | string | `"5 6,12,18 * * *"` | schedule to run on |
Expand Down Expand Up @@ -158,4 +165,4 @@ $ helm install my-release glodo/odoo -f ./helm-values.yaml
| web.tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)
2 changes: 1 addition & 1 deletion charts/odoo/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Includes support for:
* Multi deployment and replica (i.e. web, cron, and OCA/queue may be all run as separate deployments)
* [external-dns CRD](https://github.com/kubernetes-sigs/external-dns) support
* [cert-manager](https://cert-manager.io/) CRD support
* Both Traefik IngressRoute and Ingress
* Both Traefik IngressRoute and Ingress (:warning: Traefik IngressRoute is deprecated)
* Automatic running of [click-odoo-update](https://github.com/acsone/click-odoo-contrib#click-odoo-update-stable)
* Optional support for scaling down the installation before click-odoo-update runs

Expand Down
12 changes: 12 additions & 0 deletions charts/odoo/templates/install/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,16 @@ spec:
else
echo "Skipping database init"
fi
{{- with .Values.install.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.install.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.install.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ end }}
12 changes: 12 additions & 0 deletions charts/odoo/templates/upgrade/upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,16 @@ spec:
else
echo "Database $PGDATABASE does not exist, skipping click-odoo-upgrade"
fi
{{- with .Values.upgrade.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.upgrade.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.upgrade.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{ end }}
4 changes: 4 additions & 0 deletions charts/odoo/templates/velero.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ metadata:
spec:
schedule: {{ .Values.velero.schedule | quote }}
template:
{{- if .Values.velero.defaultVolumesToFsBackup }}
defaultVolumesToFsBackup: {{ .Values.velero.defaultVolumesToFsBackup }}
{{- else if .Values.velero.defaultVolumesToRestic }}
defaultVolumesToRestic: {{ .Values.velero.defaultVolumesToRestic }}
{{- end }}
includeClusterResources: {{ .Values.velero.includeClusterResources }}
includedNamespaces:
- {{ .Release.Namespace }}
Expand Down
16 changes: 13 additions & 3 deletions charts/odoo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ install:
enabled: false
name: "install"

nodeSelector: {}
tolerations: []
affinity: {}

upgrade:
# -- enable click-odoo-update on helm chart upgrade
enabled: true
Expand Down Expand Up @@ -388,6 +392,10 @@ upgrade:
queueCount: 0
longpollingCount: 0

nodeSelector: {}
tolerations: []
affinity: {}

# -- customisable arguments for click-odoo-update
clickArgs: "--ignore-core-addons"

Expand All @@ -401,9 +409,11 @@ velero:
veleroNamespace: "velero"
# -- the schedule will be named `namespace-of-deployment-chart-name-name`
name: "backup"
# -- see https://velero.io/docs/v1.9/customize-installation/#default-pod-volume-backup-to-restic
defaultVolumesToRestic: true
# -- see https://velero.io/docs/v1.9/resource-filtering/#--include-cluster-resources
# -- backwards compat, please migrate to defaultVolumesToFsBackup
defaultVolumesToRestic: false
# -- see https://velero.io/docs/v1.12/api-types/schedule/
defaultVolumesToFsBackup: false
# -- see https://velero.io/docs/v1.12/resource-filtering/#--include-cluster-resources
includeClusterResources: false
# -- schedule to run on
schedule: "5 6,12,18 * * *"
Expand Down

0 comments on commit 9bb6d06

Please sign in to comment.