From 9bb6d061302b3a031352298a5b389900d9881ba0 Mon Sep 17 00:00:00 2001 From: Karl Southern Date: Fri, 29 Dec 2023 09:41:18 +0000 Subject: [PATCH] feat: nodeselector for upgrade and install jobs --- charts/odoo/Chart.yaml | 2 +- charts/odoo/README.md | 17 ++++++++++++----- charts/odoo/README.md.gotmpl | 2 +- charts/odoo/templates/install/install.yaml | 12 ++++++++++++ charts/odoo/templates/upgrade/upgrade.yaml | 12 ++++++++++++ charts/odoo/templates/velero.yaml | 4 ++++ charts/odoo/values.yaml | 16 +++++++++++++--- 7 files changed, 55 insertions(+), 10 deletions(-) diff --git a/charts/odoo/Chart.yaml b/charts/odoo/Chart.yaml index 6f4fd10..c459dae 100644 --- a/charts/odoo/Chart.yaml +++ b/charts/odoo/Chart.yaml @@ -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 diff --git a/charts/odoo/README.md b/charts/odoo/README.md index 3c3c77a..9a9d658 100644 --- a/charts/odoo/README.md +++ b/charts/odoo/README.md @@ -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. @@ -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 @@ -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 | @@ -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 | @@ -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 | @@ -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) diff --git a/charts/odoo/README.md.gotmpl b/charts/odoo/README.md.gotmpl index 177d8a6..9ae58b1 100644 --- a/charts/odoo/README.md.gotmpl +++ b/charts/odoo/README.md.gotmpl @@ -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 diff --git a/charts/odoo/templates/install/install.yaml b/charts/odoo/templates/install/install.yaml index 237d219..1a94675 100644 --- a/charts/odoo/templates/install/install.yaml +++ b/charts/odoo/templates/install/install.yaml @@ -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 }} diff --git a/charts/odoo/templates/upgrade/upgrade.yaml b/charts/odoo/templates/upgrade/upgrade.yaml index 0075971..6dc498b 100644 --- a/charts/odoo/templates/upgrade/upgrade.yaml +++ b/charts/odoo/templates/upgrade/upgrade.yaml @@ -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 }} diff --git a/charts/odoo/templates/velero.yaml b/charts/odoo/templates/velero.yaml index a6f8462..b6d0a87 100644 --- a/charts/odoo/templates/velero.yaml +++ b/charts/odoo/templates/velero.yaml @@ -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 }} diff --git a/charts/odoo/values.yaml b/charts/odoo/values.yaml index 1c64eaa..8ee0d39 100644 --- a/charts/odoo/values.yaml +++ b/charts/odoo/values.yaml @@ -359,6 +359,10 @@ install: enabled: false name: "install" + nodeSelector: {} + tolerations: [] + affinity: {} + upgrade: # -- enable click-odoo-update on helm chart upgrade enabled: true @@ -388,6 +392,10 @@ upgrade: queueCount: 0 longpollingCount: 0 + nodeSelector: {} + tolerations: [] + affinity: {} + # -- customisable arguments for click-odoo-update clickArgs: "--ignore-core-addons" @@ -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 * * *"