mirror of
https://github.com/bitnami/charts.git
synced 2026-08-10 14:15:55 +08:00
[bitnami/odoo] MAJOR release: standardization and subchart bump (#4071)
* Update PostgreSQL Req file Signed-off-by: joancafom <jcarmona@bitnami.com> * Change labels and annotations Improve README structure Bump PostgreSQL version Signed-off-by: joancafom <jcarmona@bitnami.com> * Add standardizations Signed-off-by: joancafom <jcarmona@bitnami.com> * Add externalSecret support * Add commonAnnotations to ingress * Improve NOTES * Bump Chart and README upgrade details * Fix indentation issues
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
apiVersion: v1
|
||||
name: odoo
|
||||
version: 14.0.21
|
||||
version: 15.0.0
|
||||
appVersion: 13.0.20201010
|
||||
description: A suite of web based open source business apps.
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/odoo
|
||||
|
||||
+178
-32
@@ -55,6 +55,11 @@ The following table lists the configurable parameters of the Odoo chart and thei
|
||||
| `global.imageRegistry` | Global Docker image registry | `nil` |
|
||||
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `global.storageClass` | Global storage class for dynamic provisioning | `nil` |
|
||||
|
||||
### Deployment & common parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------|---------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `image.registry` | Odoo image registry | `docker.io` |
|
||||
| `image.repository` | Odoo Image name | `bitnami/odoo` |
|
||||
| `image.tag` | Odoo Image tag | `{TAG_NAME}` |
|
||||
@@ -62,6 +67,44 @@ The following table lists the configurable parameters of the Odoo chart and thei
|
||||
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `nameOverride` | String to partially override odoo.fullname template with a string (will prepend the release name) | `nil` |
|
||||
| `fullnameOverride` | String to fully override odoo.fullname template with a string | `nil` |
|
||||
| `commonAnnotations` | Annotations to be added to all deployed resources | `{}` (evaluated as a template) |
|
||||
| `commonLabels` | Labels to be added to all deployed resources | `{}` (evaluated as a template) |
|
||||
| `extraVolumeMounts` | Optionally specify extra list of additional volumeMounts for odoo container | `[]` |
|
||||
| `extraVolumes` | Optionally specify extra list of additional volumes for odoo container | `[]` |
|
||||
| `persistence.enabled` | Enable persistence using PVC | `true` |
|
||||
| `persistence.existingClaim` | Enable persistence using an existing PVC | `nil` |
|
||||
| `persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) |
|
||||
| `persistence.accessMode` | PVC Access Mode | `ReadWriteOnce` |
|
||||
| `persistence.size` | PVC Storage Request | `8Gi` |
|
||||
| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
|
||||
| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
|
||||
| `nodeAffinityPreset.key` | Node label key to match Ignored if `affinity` is set. | `""` |
|
||||
| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` |
|
||||
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `podSecurityContext.enabled` | Enable security context for Odoo pods | `true` |
|
||||
| `podSecurityContext.fsGroup` | Group ID for the volumes of the pod | `1001` |
|
||||
| `containerSecurityContext.enabled` | Odoo Container securityContext | `false` |
|
||||
| `containerSecurityContext.runAsUser` | User ID for the Odoo container | `1001` |
|
||||
| `initContainers` | Add additional init containers to the Odoo pods | `{}` (evaluated as a template) |
|
||||
| `sidecars` | Add additional sidecar containers to the Odoo pods | `{}` (evaluated as a template) |
|
||||
|
||||
### Service parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------|---------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `service.type` | Kubernetes Service type | `LoadBalancer` |
|
||||
| `service.port` | Service HTTP port | `80` |
|
||||
| `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` |
|
||||
| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
|
||||
| `service.nodePort` | Kubernetes http node port | `""` |
|
||||
|
||||
### Odoo parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------|---------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `odooUsername` | User of the application | `user@example.com` |
|
||||
| `odooPassword` | Admin account password | _random 10 character long alphanumeric string_ |
|
||||
| `odooEmail` | Admin account email | `user@example.com` |
|
||||
@@ -70,38 +113,8 @@ The following table lists the configurable parameters of the Odoo chart and thei
|
||||
| `smtpUser` | SMTP user | `nil` |
|
||||
| `smtpPassword` | SMTP password | `nil` |
|
||||
| `smtpProtocol` | SMTP protocol [`ssl`, `tls`] | `nil` |
|
||||
| `service.type` | Kubernetes Service type | `LoadBalancer` |
|
||||
| `service.port` | Service HTTP port | `80` |
|
||||
| `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` |
|
||||
| `service.externalTrafficPolicy` | Enable client source IP preservation | `Cluster` |
|
||||
| `service.nodePort` | Kubernetes http node port | `""` |
|
||||
| `externalDatabase.host` | Host of the external database | `localhost` |
|
||||
| `externalDatabase.user` | Existing username in the external db | `postgres` |
|
||||
| `externalDatabase.password` | Password for the above username | `nil` |
|
||||
| `externalDatabase.database` | Name of the existing database | `bitnami_odoo` |
|
||||
| `externalDatabase.port` | Database port number | `5432` |
|
||||
| `ingress.enabled` | Enable ingress controller resource | `false` |
|
||||
| `ingress.certManager` | Add annotations for cert-manager | `false` |
|
||||
| `ingress.annotations` | Annotations for the ingress | `[]` |
|
||||
| `ingress.hosts[0].name` | Hostname to your Odoo installation | `odoo.local` |
|
||||
| `ingress.hosts[0].path` | Path within the url structure | `/` |
|
||||
| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` |
|
||||
| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `odoo.local-tls-secret` |
|
||||
| `ingress.secrets[0].name` | TLS Secret Name | `nil` |
|
||||
| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` |
|
||||
| `ingress.secrets[0].key` | TLS Secret Key | `nil` |
|
||||
| `existingSecret` | Name of a secret with the application password | `nil` |
|
||||
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` |
|
||||
| `persistence.enabled` | Enable persistence using PVC | `true` |
|
||||
| `persistence.existingClaim` | Enable persistence using an existing PVC | `nil` |
|
||||
| `persistence.storageClass` | PVC Storage Class | `nil` (uses alpha storage class annotation) |
|
||||
| `persistence.accessMode` | PVC Access Mode | `ReadWriteOnce` |
|
||||
| `persistence.size` | PVC Storage Request | `8Gi` |
|
||||
| `postgresql.enabled` | Deploy PostgreSQL container(s) | `true` |
|
||||
| `postgresql.postgresqlPassword` | PostgreSQL password | `nil` |
|
||||
| `postgresql.persistence.enabled` | Enable PostgreSQL persistence using PVC | `true` |
|
||||
| `postgresql.persistence.storageClass` | PVC Storage Class for PostgreSQL volume | `nil` (uses alpha storage class annotation) |
|
||||
| `postgresql.persistence.accessMode` | PVC Access Mode for PostgreSQL volume | `ReadWriteOnce` |
|
||||
| `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `8Gi` |
|
||||
| `livenessProbe.enabled` | Enable/disable the liveness probe | `true` |
|
||||
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 300 |
|
||||
| `livenessProbe.periodSeconds` | How often to perform the probe | 30 |
|
||||
@@ -114,7 +127,44 @@ The following table lists the configurable parameters of the Odoo chart and thei
|
||||
| `readinessProbe.timeoutSeconds` | When the probe times out | 5 |
|
||||
| `readinessProbe.failureThreshold` | Minimum consecutive failures to be considered failed | 6 |
|
||||
| `readinessProbe.successThreshold` | Minimum consecutive successes to be considered successful | 1 |
|
||||
| `affinity` | Map of node/pod affinities | `{}` |
|
||||
| `customLivenessProbe` | Override default liveness probe | `nil` |
|
||||
| `customReadinessProbe` | Override default readiness probe | `nil` |
|
||||
| `command` | Custom command to override image cmd | `nil` (evaluated as a template) |
|
||||
| `args` | Custom args for the custom commad | `nil` (evaluated as a template) |
|
||||
| `extraEnvVars` | An array to add extra env vars | `[]` (evaluated as a template) |
|
||||
| `extraEnvVarsCM` | Array to add extra configmaps | `[]` |
|
||||
| `extraEnvVarsSecret` | Array to add extra environment from a Secret | `nil` |
|
||||
|
||||
### Ingress parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------|---------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `ingress.enabled` | Enable ingress controller resource | `false` |
|
||||
| `ingress.certManager` | Add annotations for cert-manager | `false` |
|
||||
| `ingress.annotations` | Annotations for the ingress | `[]` (evaluated as a template) |
|
||||
| `ingress.hosts[0].name` | Hostname to your Odoo installation | `odoo.local` |
|
||||
| `ingress.hosts[0].path` | Path within the url structure | `/` |
|
||||
| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` |
|
||||
| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `odoo.local-tls-secret` |
|
||||
| `ingress.secrets[0].name` | TLS Secret Name | `nil` |
|
||||
| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` |
|
||||
| `ingress.secrets[0].key` | TLS Secret Key | `nil` |
|
||||
|
||||
### Database parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------|---------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `postgresql.enabled` | Deploy PostgreSQL container(s) | `true` |
|
||||
| `postgresql.postgresqlPassword` | PostgreSQL password | `nil` |
|
||||
| `postgresql.persistence.enabled` | Enable PostgreSQL persistence using PVC | `true` |
|
||||
| `postgresql.persistence.storageClass` | PVC Storage Class for PostgreSQL volume | `nil` (uses alpha storage class annotation) |
|
||||
| `postgresql.persistence.accessMode` | PVC Access Mode for PostgreSQL volume | `ReadWriteOnce` |
|
||||
| `postgresql.persistence.size` | PVC Storage Request for PostgreSQL volume | `8Gi` |
|
||||
| `externalDatabase.host` | Host of the external database | `localhost` |
|
||||
| `externalDatabase.user` | Existing username in the external db | `postgres` |
|
||||
| `externalDatabase.password` | Password for the above username | `nil` |
|
||||
| `externalDatabase.database` | Name of the existing database | `bitnami_odoo` |
|
||||
| `externalDatabase.port` | Database port number | `5432` |
|
||||
|
||||
The above parameters map to the env variables defined in [bitnami/odoo](http://github.com/bitnami/bitnami-docker-odoo). For more information please refer to the [bitnami/odoo](http://github.com/bitnami/bitnami-docker-odoo) image documentation.
|
||||
|
||||
@@ -162,6 +212,28 @@ externalDatabase.port=3306
|
||||
|
||||
Note also if you disable PostgreSQL per above you MUST supply values for the `externalDatabase` connection.
|
||||
|
||||
### Sidecars and Init Containers
|
||||
|
||||
If you have a need for additional containers to run within the same pod as Odoo, you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec.
|
||||
|
||||
```yaml
|
||||
sidecars:
|
||||
- name: your-image-name
|
||||
image: your-image
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: portname
|
||||
containerPort: 1234
|
||||
```
|
||||
|
||||
Similarly, you can add extra init containers using the `initContainers` parameter.
|
||||
|
||||
### Setting Pod's affinity
|
||||
|
||||
This chart allows you to set your custom affinity using the `affinity` paremeter. Find more infomation about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity).
|
||||
|
||||
As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters.
|
||||
|
||||
## Persistence
|
||||
|
||||
The [Bitnami Odoo](https://github.com/bitnami/bitnami-docker-odoo) image stores the Odoo data and configurations at the `/bitnami/odoo` path of the container.
|
||||
@@ -171,6 +243,80 @@ See the [Parameters](#parameters) section to configure the PVC or to disable per
|
||||
|
||||
## Upgrading
|
||||
|
||||
### To 15.0.0
|
||||
|
||||
This major version includes two main changes:
|
||||
|
||||
* Major change in the PostgreSQL subchart labeling. Check [PostgreSQL Upgrading Notes](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#900) for more information.
|
||||
* Re-labeling so as to follow Helm label best practices (see [PR 3021](https://github.com/bitnami/charts/pull/3021))
|
||||
* Adaptation to use common Bitnami chart standards. The following common elements have been included: extra volumes, extra volume mounts, common annotations and labels, pod annotations and labels, pod and container security contexts, affinity settings, node selectors, tolerations, init and sidecar containers, support for existing secrets, custom commands and arguments, extra env variables and custom liveness/readiness probes.
|
||||
|
||||
As a consequence, backwards compatibility from previous versions is not guaranteed during the upgrade. To upgrade to `9.0.0`, it should be done reusing the PVCs used to hold both the PostgreSQL and Odoo data on your previous release. To do so, follow the instructions below (the following example assumes that the release name is `odoo`):
|
||||
|
||||
> NOTE: Please, create a backup of your database before running any of those actions.
|
||||
|
||||
* Old version is up and running
|
||||
|
||||
```console
|
||||
$ helm ls
|
||||
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
|
||||
odoo default 1 2020-10-21 13:11:29.028263 +0200 CEST deployed odoo-14.0.21 13.0.20201010
|
||||
|
||||
$ kubectl get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
odoo-odoo-984f954b9-tk8t8 1/1 Running 0 16m
|
||||
odoo-postgresql-0 1/1 Running 0 16m
|
||||
```
|
||||
|
||||
* Export both database and Odoo credentials in order to provide them in the update
|
||||
|
||||
```console
|
||||
$ export POSTGRESQL_PASSWORD=$(kubectl get secret --namespace default odoo-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)
|
||||
|
||||
$ export ODOO_PASSWORD=$(kubectl get secret --namespace default odoo-odoo -o jsonpath="{.data.odoo-password}" | base64 --decode)
|
||||
```
|
||||
|
||||
* The upgrade to the latest (`15.X.X`) version is going to fail
|
||||
|
||||
```console
|
||||
$ helm upgrade odoo bitnami/odoo --set odooPassword=$ODOO_PASSWORD --set postgresql.postgresqlPassword=$POSTGRESQL_PASSWORD
|
||||
Error: UPGRADE FAILED: cannot patch "odoo-odoo" with kind Deployment: Deployment.apps "odoo-odoo" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"odoo", "app.kubernetes.io/name":"odoo"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
|
||||
```
|
||||
|
||||
* Delete both the statefulset and recplicaset (PostgreSQL and Odoo respectively). Notice the option `--cascade=false` for the former.
|
||||
|
||||
```console
|
||||
$ kubectl delete deployment.apps/odoo-odoo
|
||||
deployment.apps "odoo-odoo" deleted
|
||||
|
||||
$ kubectl delete statefulset.apps/odoo-postgresql --cascade=false
|
||||
statefulset.apps "odoo-postgresql" deleted
|
||||
```
|
||||
|
||||
* Now the upgrade works
|
||||
|
||||
```console
|
||||
$ helm upgrade odoo bitnami/odoo --set odooPassword=$ODOO_PASSWORD --set postgresql.postgresqlPassword=$POSTGRESQL_PASSWORD
|
||||
$ helm ls
|
||||
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
|
||||
odoo default 3 2020-10-21 13:35:27.255118 +0200 CEST deployed odoo-15.0.0 13.0.20201010
|
||||
```
|
||||
|
||||
* You can kill the existing PostgreSQL pod and the new statefulset is going to create a new one
|
||||
|
||||
```console
|
||||
$ kubectl delete pod odoo-postgresql-0
|
||||
pod "odoo-postgresql-0" deleted
|
||||
|
||||
$ kubectl get pods
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
odoo-odoo-854b9cd5fb-282md 1/1 Running 0 9m12s
|
||||
odoo-postgresql-0 1/1 Running 0 7m19s
|
||||
```
|
||||
|
||||
Please, note that without the --cascade=false both objects (statefulset and pod) are going to be removed and both objects will be deployed again with the helm upgrade command
|
||||
|
||||
|
||||
### To 12.0.0
|
||||
|
||||
Helm performs a lookup for the object based on its group (apps), version (v1), and kind (Deployment). Also known as its GroupVersionKind, or GVK. Changing the GVK is considered a compatibility breaker from Kubernetes' point of view, so you cannot "upgrade" those objects to the new GVK in-place. Earlier versions of Helm 3 did not perform the lookup correctly which has since been fixed to match the spec.
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
dependencies:
|
||||
- name: postgresql
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 8.10.14
|
||||
digest: sha256:6ad9314e4185e1ef65d86dde11c75c2e83939cdf0126e2c07cb1f944de4de053
|
||||
generated: "2020-07-14T13:07:29.251902965Z"
|
||||
version: 9.8.4
|
||||
- name: common
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 0.8.2
|
||||
digest: sha256:12996a3068d962686c0b3584271868ab25fb04ddb79dd5ce29bcc5556381709f
|
||||
generated: "2020-10-20T16:17:03.23776+02:00"
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
dependencies:
|
||||
- name: postgresql
|
||||
condition: postgresql.enabled
|
||||
version: 8.x.x
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
- name: postgresql
|
||||
version: 9.x.x
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
condition: postgresql.enabled
|
||||
- name: common
|
||||
version: 0.x.x
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
{{- $secretName := include "odoo.secretName" . -}}
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
*******************************************************************
|
||||
*** PLEASE BE PATIENT: Odoo may take a few minutes to install ***
|
||||
*******************************************************************
|
||||
|
||||
{{- if .Values.ingress.enabled }}
|
||||
|
||||
@@ -14,13 +17,13 @@
|
||||
|
||||
1. Get the Odoo URL by running:
|
||||
|
||||
{{- if contains "NodePort" .Values.service.type }}
|
||||
{{- if eq .Values.service.type "NodePort" }}
|
||||
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "odoo.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo "Odoo URL: http://$NODE_IP:$NODE_PORT/"
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
{{- else if eq .Values.service.type "LoadBalancer" }}
|
||||
|
||||
** Please ensure an external IP is associated to the {{ template "odoo.fullname" . }} service before proceeding **
|
||||
** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "odoo.fullname" . }} **
|
||||
@@ -29,7 +32,7 @@
|
||||
|
||||
{{- $port:=.Values.service.port | toString }}
|
||||
echo "Odoo URL: http://$SERVICE_IP{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}/"
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
|
||||
echo "Odoo URL: http://127.0.0.1:8080/"
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "odoo.fullname" . }} 8080:{{ .Values.service.port }}
|
||||
@@ -37,14 +40,25 @@
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
2. Login with the following credentials
|
||||
2. Obtain the login credentials
|
||||
|
||||
echo Email : {{ .Values.odooEmail }}
|
||||
echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "odoo.fullname" . }} -o jsonpath="{.data.odoo-password}" | base64 --decode)
|
||||
export ODOO_EMAIL={{ .Values.odooEmail }}
|
||||
{{ include "common.utils.secret.getvalue" (dict "secret" $secretName "field" "odoo-password" "context" $) }}
|
||||
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
echo Email : $ODOO_EMAIL
|
||||
echo Password: $ODOO_PASSWORD
|
||||
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- include "common.warnings.rollingTag" .Values.image }}
|
||||
|
||||
{{- end }}
|
||||
{{- $passwordValidationErrors := list -}}
|
||||
{{- if not .Values.existingSecret -}}
|
||||
{{- $requiredOdooPassword := dict "valueKey" "odooPassword" "secret" $secretName "field" "odoo-password" "context" $ -}}
|
||||
{{- $requiredOdooPasswordError := include "common.validations.values.single.empty" $requiredOdooPassword -}}
|
||||
{{- $passwordValidationErrors = append $passwordValidationErrors $requiredOdooPasswordError -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $postgresqlSecretName := include "odoo.databaseSecretName" . -}}
|
||||
{{- $postgresqlPasswordValidationErrors := include "common.validations.values.postgresql.passwords" (dict "secret" $postgresqlSecretName "subchart" true "context" $) -}}
|
||||
{{- $passwordValidationErrors = append $passwordValidationErrors $postgresqlPasswordValidationErrors -}}
|
||||
|
||||
{{- include "common.errors.upgrade.passwords.empty" (dict "validationErrors" $passwordValidationErrors "context" $) -}}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "odoo.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- include "common.names.name" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
@@ -11,16 +11,7 @@ Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "odoo.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- include "common.names.fullname" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
@@ -35,114 +26,44 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "odoo.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- include "common.names.chart" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Odoo image name
|
||||
*/}}
|
||||
{{- define "odoo.image" -}}
|
||||
{{- $registryName := .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.image.tag | toString -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
|
||||
Also, we can't use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imageRegistry }}
|
||||
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
|
||||
{{- end -}}
|
||||
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "odoo.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- else if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "odoo.storageClass" -}}
|
||||
{{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Return the PostgreSQL Secret Name
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- define "odoo.databaseSecretName" -}}
|
||||
{{- if .Values.postgresql.enabled }}
|
||||
{{- printf "%s" (include "odoo.postgresql.fullname" .) -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- printf "%s-%s" .Release.Name "externaldb" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for deployment.
|
||||
Odoo credential secret name
|
||||
*/}}
|
||||
{{- define "odoo.deployment.apiVersion" -}}
|
||||
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "apps/v1" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the appropriate apiVersion for ingress.
|
||||
*/}}
|
||||
{{- define "odoo.ingress.apiVersion" -}}
|
||||
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- print "extensions/v1beta1" -}}
|
||||
{{- else -}}
|
||||
{{- print "networking.k8s.io/v1beta1" -}}
|
||||
{{- end -}}
|
||||
{{- define "odoo.secretName" -}}
|
||||
{{- coalesce .Values.existingSecret (include "odoo.fullname" .) -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,110 +1,167 @@
|
||||
apiVersion: {{ template "odoo.deployment.apiVersion" . }}
|
||||
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "odoo.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
release: "{{ .Release.Name }}"
|
||||
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||
{{- if .Values.podLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "odoo.imagePullSecrets" . | indent 6 }}
|
||||
containers:
|
||||
- name: {{ template "odoo.fullname" . }}
|
||||
image: {{ template "odoo.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
env:
|
||||
- name: POSTGRESQL_HOST
|
||||
value: {{ ternary (include "odoo.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled | quote }}
|
||||
- name: POSTGRESQL_USER
|
||||
value: {{ ternary "postgres" .Values.externalDatabase.user .Values.postgresql.enabled | quote }}
|
||||
- name: POSTGRESQL_PORT_NUMBER
|
||||
value: {{ ternary "5432" .Values.externalDatabase.port .Values.postgresql.enabled | quote }}
|
||||
- name: POSTGRESQL_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ ternary (include "odoo.postgresql.fullname" .) (printf "%s-%s" .Release.Name "externaldb") .Values.postgresql.enabled | quote }}
|
||||
key: {{ ternary "postgresql-password" "db-password" .Values.postgresql.enabled | quote }}
|
||||
- name: ODOO_EMAIL
|
||||
value: {{ .Values.odooEmail | quote }}
|
||||
- name: ODOO_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "odoo.fullname" . }}
|
||||
key: odoo-password
|
||||
{{- if .Values.smtpHost }}
|
||||
- name: SMTP_HOST
|
||||
value: {{ .Values.smtpHost | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpPort }}
|
||||
- name: SMTP_PORT
|
||||
value: {{ .Values.smtpPort | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpUser }}
|
||||
- name: SMTP_USER
|
||||
value: {{ .Values.smtpUser | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpPassword }}
|
||||
- name: SMTP_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "odoo.fullname" . }}
|
||||
key: smtp-password
|
||||
{{- end }}
|
||||
{{- if .Values.smtpProtocol }}
|
||||
- name: SMTP_PROTOCOL
|
||||
value: {{ .Values.smtpProtocol | quote }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8069
|
||||
{{- if .Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 10 }}
|
||||
volumeMounts:
|
||||
- name: odoo-data
|
||||
mountPath: /bitnami/odoo
|
||||
volumes:
|
||||
- name: odoo-data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "odoo.fullname" .) }}
|
||||
{{- include "odoo.imagePullSecrets" . | nindent 6 }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 8 }}
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.podSecurityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ .Values.podSecurityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- if .Values.initContainers }}
|
||||
initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ template "odoo.fullname" . }}
|
||||
{{- if .Values.containerSecurityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.containerSecurityContext.runAsUser }}
|
||||
{{- end }}
|
||||
image: {{ template "odoo.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
{{- if .Values.command }}
|
||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.args }}
|
||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: POSTGRESQL_HOST
|
||||
value: {{ ternary (include "odoo.postgresql.fullname" .) .Values.externalDatabase.host .Values.postgresql.enabled | quote }}
|
||||
- name: POSTGRESQL_USER
|
||||
value: {{ ternary "postgres" .Values.externalDatabase.user .Values.postgresql.enabled | quote }}
|
||||
- name: POSTGRESQL_PORT_NUMBER
|
||||
value: {{ ternary "5432" .Values.externalDatabase.port .Values.postgresql.enabled | quote }}
|
||||
- name: POSTGRESQL_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "odoo.databaseSecretName" . }}
|
||||
key: {{ ternary "postgresql-password" "db-password" .Values.postgresql.enabled | quote }}
|
||||
- name: ODOO_EMAIL
|
||||
value: {{ .Values.odooEmail | quote }}
|
||||
- name: ODOO_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "odoo.secretName" . }}
|
||||
key: odoo-password
|
||||
{{- if .Values.smtpHost }}
|
||||
- name: SMTP_HOST
|
||||
value: {{ .Values.smtpHost | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpPort }}
|
||||
- name: SMTP_PORT
|
||||
value: {{ .Values.smtpPort | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpUser }}
|
||||
- name: SMTP_USER
|
||||
value: {{ .Values.smtpUser | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.smtpPassword }}
|
||||
- name: SMTP_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "odoo.secretName" . }}
|
||||
key: smtp-password
|
||||
{{- end }}
|
||||
{{- if .Values.smtpProtocol }}
|
||||
- name: SMTP_PROTOCOL
|
||||
value: {{ .Values.smtpProtocol | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraEnv }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnv "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
envFrom:
|
||||
{{- if .Values.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8069
|
||||
{{- if .Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||
{{- else if .Values.customLivenessProbe }}
|
||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||
{{- else if .Values.customReadinessProbe }}
|
||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.resources }}
|
||||
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: odoo-data
|
||||
mountPath: /bitnami/odoo
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.sidecars }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: odoo-data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "odoo.fullname" .) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -3,11 +3,13 @@ apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
||||
labels:
|
||||
app: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
db-password: {{ .Values.externalDatabase.password | b64enc | quote }}
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: {{ template "odoo.ingress.apiVersion" . }}
|
||||
apiVersion: {{ template "common.capabilities.ingress.apiVersion" . }}
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ template "odoo.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
annotations:
|
||||
{{- if .Values.ingress.certManager }}
|
||||
kubernetes.io/tls-acme: "true"
|
||||
{{- end }}
|
||||
{{- range $key, $value := .Values.ingress.annotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- if .Values.ingress.annotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
|
||||
@@ -3,11 +3,13 @@ kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "odoo.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
{{- if not .Values.existingSecret }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "odoo.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if .Values.odooPassword }}
|
||||
@@ -17,3 +20,4 @@ data:
|
||||
{{- if .Values.smtpPassword }}
|
||||
smtp-password: {{ .Values.smtpPassword | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -2,11 +2,13 @@ apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "odoo.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }}
|
||||
@@ -16,12 +18,10 @@ spec:
|
||||
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort)))}}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app: {{ template "odoo.name" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
- name: http
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort)))}}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
||||
|
||||
@@ -4,11 +4,13 @@ apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .name }}
|
||||
labels:
|
||||
app: {{ template "odoo.name" . }}
|
||||
chart: {{ template "odoo.chart" . }}
|
||||
release: {{ .Release.Name | quote }}
|
||||
heritage: {{ .Release.Service | quote }}
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: kubernetes.io/tls
|
||||
data:
|
||||
tls.crt: {{ .certificate | b64enc }}
|
||||
|
||||
+129
-8
@@ -35,6 +35,64 @@ image:
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
## Add labels to all the deployed resources
|
||||
##
|
||||
commonLabels: {}
|
||||
|
||||
## Add annotations to all the deployed resources
|
||||
##
|
||||
commonAnnotations: {}
|
||||
|
||||
## Additional pod annotations
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
##
|
||||
podAnnotations: {}
|
||||
|
||||
## Additional pod labels
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
##
|
||||
podLabels: {}
|
||||
|
||||
## K8s Security Context for Odoo pods
|
||||
## https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
|
||||
##
|
||||
podSecurityContext:
|
||||
enabled: true
|
||||
fsGroup: 1001
|
||||
|
||||
## K8s Security Context for Odoo container
|
||||
##
|
||||
containerSecurityContext:
|
||||
enabled: false
|
||||
runAsUser: 1001
|
||||
|
||||
## Command and args for running the container (set to default if not set). Use array form
|
||||
##
|
||||
command: []
|
||||
args: []
|
||||
|
||||
## An array to add extra env vars
|
||||
## For example:
|
||||
##
|
||||
extraEnvVars: []
|
||||
# - name: FOO
|
||||
# value: BAR
|
||||
|
||||
## ConfigMap with extra environment variables
|
||||
##
|
||||
extraEnvVarsCM:
|
||||
|
||||
## Secret with extra environment variables
|
||||
##
|
||||
extraEnvVarsSecret:
|
||||
|
||||
## Add extra volumes
|
||||
extraVolumes: []
|
||||
|
||||
## Add extra volume mounts
|
||||
##
|
||||
extraVolumeMounts: []
|
||||
|
||||
## User of the application
|
||||
## ref: https://github.com/bitnami/bitnami-docker-odoo#configuration
|
||||
##
|
||||
@@ -59,8 +117,12 @@ odooEmail: user@example.com
|
||||
# smtpPassword:
|
||||
# smtpProtocol:
|
||||
|
||||
## Use existing secret for the application password
|
||||
##
|
||||
existingSecret:
|
||||
|
||||
externalDatabase:
|
||||
## All of these values are only used when postgresql.enabled is set to false
|
||||
## All of these values are only used when postgresql.enabled is set to false
|
||||
## Database host
|
||||
host: localhost
|
||||
|
||||
@@ -143,15 +205,15 @@ ingress:
|
||||
## The list of hostnames to be covered with this ingress record.
|
||||
## Most likely this will be just one host, but in the event more hosts are needed, this is an array
|
||||
hosts:
|
||||
- name: odoo.local
|
||||
path: /
|
||||
- name: odoo.local
|
||||
path: /
|
||||
|
||||
## Set this to true in order to enable TLS on the ingress record
|
||||
## A side effect of this will be that the backend odoo service will be connected at port 443
|
||||
tls: false
|
||||
## Set this to true in order to enable TLS on the ingress record
|
||||
## A side effect of this will be that the backend odoo service will be connected at port 443
|
||||
tls: false
|
||||
|
||||
## If TLS is set to true, you must declare what secret will store the key/certificate for TLS
|
||||
tlsSecret: odoo.local-tls
|
||||
## If TLS is set to true, you must declare what secret will store the key/certificate for TLS
|
||||
tlsSecret: odoo.local-tls
|
||||
|
||||
## Set this to true in order to add the corresponding annotations for cert-manager
|
||||
certManager: false
|
||||
@@ -212,6 +274,7 @@ livenessProbe:
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 30
|
||||
@@ -220,7 +283,65 @@ readinessProbe:
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
|
||||
## Custom liveness and readiness probes (evaluated as a template)
|
||||
##
|
||||
customLivenessProbe: {}
|
||||
customReadinessProbe: {}
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Pod affinity preset
|
||||
## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAffinityPreset: ""
|
||||
|
||||
## Pod anti-affinity preset
|
||||
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
podAntiAffinityPreset: soft
|
||||
|
||||
## Node affinity preset
|
||||
## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
nodeAffinityPreset:
|
||||
## Node affinity type
|
||||
## Allowed values: soft, hard
|
||||
##
|
||||
type: ""
|
||||
## Node label key to match
|
||||
## E.g.
|
||||
## key: "kubernetes.io/e2e-az-name"
|
||||
##
|
||||
key: ""
|
||||
## Node label values to match
|
||||
## E.g.
|
||||
## values:
|
||||
## - e2e-az1
|
||||
## - e2e-az2
|
||||
##
|
||||
values: []
|
||||
|
||||
## Extra init containers to add to the deployment
|
||||
##
|
||||
initContainers: []
|
||||
|
||||
## Extra sidecar containers to add to the deployment
|
||||
##
|
||||
sidecars: []
|
||||
|
||||
Reference in New Issue
Block a user