From ead3ff8307c795fb987bd8f03f2c79290f51abe4 Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Sat, 23 Jul 2022 18:39:31 +0300 Subject: [PATCH 1/2] Initial commit --- .github/cr.yaml | 1 + .github/ct-install.yaml | 6 + .github/ct-lint.yaml | 8 + .github/workflows/chart-release.yml | 35 ++ .../workflows/generate-helm-chart-readme.yml | 65 +++ .github/workflows/helm-chart-build.yml | 32 ++ odoo-doodba/.helmignore | 22 + odoo-doodba/Chart.yaml | 25 ++ odoo-doodba/README.md | 104 +++++ odoo-doodba/templates/NOTES.txt | 21 + odoo-doodba/templates/_helpers.tpl | 64 +++ odoo-doodba/templates/configmap.yaml | 10 + odoo-doodba/templates/deployment.yaml | 159 +++++++ odoo-doodba/templates/ingress-cache.yaml | 63 +++ odoo-doodba/templates/ingress.yaml | 55 +++ odoo-doodba/templates/pvc.yaml | 28 ++ odoo-doodba/templates/secret.yaml | 20 + odoo-doodba/templates/service.yaml | 22 + odoo-doodba/templates/serviceaccount.yaml | 8 + .../templates/tests/test-connection.yaml | 15 + odoo-doodba/values.yaml | 387 ++++++++++++++++++ 21 files changed, 1150 insertions(+) create mode 100644 .github/cr.yaml create mode 100644 .github/ct-install.yaml create mode 100644 .github/ct-lint.yaml create mode 100644 .github/workflows/chart-release.yml create mode 100644 .github/workflows/generate-helm-chart-readme.yml create mode 100644 .github/workflows/helm-chart-build.yml create mode 100644 odoo-doodba/.helmignore create mode 100644 odoo-doodba/Chart.yaml create mode 100644 odoo-doodba/README.md create mode 100644 odoo-doodba/templates/NOTES.txt create mode 100644 odoo-doodba/templates/_helpers.tpl create mode 100644 odoo-doodba/templates/configmap.yaml create mode 100644 odoo-doodba/templates/deployment.yaml create mode 100644 odoo-doodba/templates/ingress-cache.yaml create mode 100644 odoo-doodba/templates/ingress.yaml create mode 100644 odoo-doodba/templates/pvc.yaml create mode 100644 odoo-doodba/templates/secret.yaml create mode 100644 odoo-doodba/templates/service.yaml create mode 100644 odoo-doodba/templates/serviceaccount.yaml create mode 100644 odoo-doodba/templates/tests/test-connection.yaml create mode 100644 odoo-doodba/values.yaml diff --git a/.github/cr.yaml b/.github/cr.yaml new file mode 100644 index 0000000..96748a5 --- /dev/null +++ b/.github/cr.yaml @@ -0,0 +1 @@ +owner: pledra \ No newline at end of file diff --git a/.github/ct-install.yaml b/.github/ct-install.yaml new file mode 100644 index 0000000..3aba14f --- /dev/null +++ b/.github/ct-install.yaml @@ -0,0 +1,6 @@ +chart-dirs: + - pledra +chart-repos: + - pledra=https://charts-pledra.storage.googleapis.com +debug: true +remote: origin \ No newline at end of file diff --git a/.github/ct-lint.yaml b/.github/ct-lint.yaml new file mode 100644 index 0000000..3ffbe95 --- /dev/null +++ b/.github/ct-lint.yaml @@ -0,0 +1,8 @@ +chart-dirs: + - helm-charts +check-version-increment: true +debug: true +remote: origin +validate-chart-schema: true +validate-maintainers: false +validate-yaml: true \ No newline at end of file diff --git a/.github/workflows/chart-release.yml b/.github/workflows/chart-release.yml new file mode 100644 index 0000000..1814020 --- /dev/null +++ b/.github/workflows/chart-release.yml @@ -0,0 +1,35 @@ +name: Release Charts + +on: + push: + branches: + - main + +jobs: + release: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.8.1 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.4.0 + with: + charts_dir: helm-charts + config: .github/cr.yaml + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/generate-helm-chart-readme.yml b/.github/workflows/generate-helm-chart-readme.yml new file mode 100644 index 0000000..e200b94 --- /dev/null +++ b/.github/workflows/generate-helm-chart-readme.yml @@ -0,0 +1,65 @@ +name: Generate Helm Chart Readme + +on: + pull_request: + branches: + - master + paths: + - 'helm-charts/*/values.yaml' + +jobs: + generate-chart-readme: + runs-on: ubuntu-latest + + steps: + - name: Checkout readme-generator-for-helm + uses: actions/checkout@v2 + with: + repository: 'bitnami-labs/readme-generator-for-helm' + ref: '1af12881436b1f58f0643d733fd5196b4a11caa8' + path: readme-generator-for-helm + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('readme-generator-for-helm/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + + - name: Install readme-generator-for-helm dependencies + run: cd readme-generator-for-helm && npm install + + - name: Checkout pledra/charts + uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + path: odoo-cloud-addons + # token: ${{ secrets.PLEDRA_BOT_TOKEN }} + + - name: Execute readme-generator-for-helm + run: | + # Using the Github API to detect the files changed as git merge-base stops working when the branch is behind + # and jitterbit/get-changed-files does not support pull_request_target + URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" + files_changed_data=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL") + files_changed="$(echo $files_changed_data | jq -r '.[] | .filename')" + # Adding || true to avoid "Process exited with code 1" errors + charts_dirs_changed="$(echo "$files_changed" | xargs dirname | grep -o "helm-charts/[^/]*" | sort | uniq || true)" + for chart in ${charts_dirs_changed}; do + echo "Updating README.md for ${chart}" + readme-generator-for-helm/bin/index.js --values "odoo-cloud-addons/${chart}/values.yaml" --readme "odoo-cloud-addons/${chart}/README.md" --schema "/tmp/schema.json" + done + - name: Push changes + run: | + # Push all the changes + cd odoo-cloud-addons + if git status -s | grep helm-charts; then + git config user.name "Pledra Containers" + git config user.email "bot@pledra.com" + git add . && git commit -am "Update README.md with readme-generator-for-helm" --signoff && git push + fi \ No newline at end of file diff --git a/.github/workflows/helm-chart-build.yml b/.github/workflows/helm-chart-build.yml new file mode 100644 index 0000000..1e67476 --- /dev/null +++ b/.github/workflows/helm-chart-build.yml @@ -0,0 +1,32 @@ +name: Lint and Test charts +on: pull_request +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Fetch history + run: git fetch --prune --unshallow + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.1.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config .github/ct-lint.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: ct lint --config .github/ct-lint.yaml + + - name: Create kind cluster + uses: helm/kind-action@v1.1.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install --config .github/ct-install.yaml \ No newline at end of file diff --git a/odoo-doodba/.helmignore b/odoo-doodba/.helmignore new file mode 100644 index 0000000..50af031 --- /dev/null +++ b/odoo-doodba/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/odoo-doodba/Chart.yaml b/odoo-doodba/Chart.yaml new file mode 100644 index 0000000..3e06962 --- /dev/null +++ b/odoo-doodba/Chart.yaml @@ -0,0 +1,25 @@ +apiVersion: v2 +appVersion: "15.0" +description: Odoo helm chart for Kubernetes using Tecnativa's Docker odoo base image (Doodba) +icon: https://odoocdn.com/openerp_website/static/src/img/assets/png/odoo_logo.png?a=b +name: odoo-doodba +keywords: + - odoo + - doodba +version: 1.0.0 +maintainers: +- name: Paul Catinean + email: pca@pledra.com + url: https://pledra.com +dependencies: +- name: postgresql + condition: postgresql.enabled, + version: 11.x.x + repository: https://charts.bitnami.com/bitnami +- name: redis + condition: redis.enabled, + version: 17.x.x + repository: https://charts.bitnami.com/bitnami +- name: common + version: 1.x.x + repository: https://charts.bitnami.com/bitnami diff --git a/odoo-doodba/README.md b/odoo-doodba/README.md new file mode 100644 index 0000000..3c00fbc --- /dev/null +++ b/odoo-doodba/README.md @@ -0,0 +1,104 @@ +Odoo Doodba + +## Parameters + +### + +| Name | Description | Value | +| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | ------------------ | +| `replicaCount` | Number of Odoo replicas to deploy | `1` | +| `rollDeploy` | Activates a new deployment with each helm upgrade regardless of diff in chances | `false` | +| `annotations` | Annotations for Odoo pods | `{}` | +| `updateStrategy.type` | Odoo deployment strategy type | `RollingUpdate` | +| `updateStrategy.rollingUpdate` | Odoo deployment rolling update configuration parameters | `{}` | +| `image.repository` | Odoo image repository | `tecnativa/doodba` | +| `image.tag` | Odoo image tag (immutable tags are recommended) | `15.0` | +| `image.pullPolicy` | Odoo image pull policy | `IfNotPresent` | +| `imagePullSecrets` | Global Docker registry secret names as an array | `[]` | +| `nameOverride` | String to partially override common.names.fullname | `""` | +| `fullnameOverride` | String to fully override common.names.fullname | `""` | +| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `false` | +| `serviceAccount.name` | The name of the ServiceAccount to create | `""` | +| `podSecurityContext.enabled` | Enabled Odoo pods' Security Context | `false` | +| `podSecurityContext.fsGroup` | Set Odoo pod's Security Context fsGroup | `1001` | +| `containerSecurityContext.enabled` | Enabled Odoo containers' Security Context | `false` | +| `containerSecurityContext.runAsUser` | Set Odoo container's Security Context runAsUser | `1001` | +| `odooPassword` | Odoo user password | `""` | +| `config` | values in odoo.conf format as multiline string will be merged with the default odoo.conf file and override any existing values | `""` | +| `pgBouncer.enabled` | Enable a subchart that launches the pgBouncer connection pooler as a middleware between odoo and postgresql | `false` | + + +### Odoo postgresql cluster database + +| Name | Description | Value | +| ------------------------------- | -------------------------------------- | ---------- | +| `postgresql.enabled` | Deploy PostgreSQL container(s) | `true` | +| `postgresql.image.repository` | Docker repository for postgresql image | `postgres` | +| `postgresql.image.tag` | Docker image tag for postgresql image | `latest` | +| `postgresql.postgresqlUsername` | PostgreSQL non-root username | `odoo` | +| `postgresql.postgresqlPassword` | PostgreSQL password | `""` | +| `postgresql.postgresHost` | External Database server host | `""` | +| `postgresql.port` | External Database server port | `5432` | +| `postgresql.externalDatabase` | standard or gcloud | `""` | + + +### Google cloud SQL + +| Name | Description | Value | +| ------------------------------------- | ---------------------------------------------------------------------------------- | ----- | +| `postgresql.gcInstanceConnectionName` | Psql instance name on google cloud | `""` | +| `postgresql.gcCredentialsFile` | Filename of svc account credentials stored in cloudsql-instance-credentials secret | `""` | + + +### Redis session storage + +| Name | Description | Value | +| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | +| `redis.enabled` | Enable redis subchart for deployment | `false` | +| `redis.password` | Password to redis instance | `redis-password` | +| `redis.cluster.enabled` | Enable deployment of a multi-tier cluster | `false` | +| `service.type` | Odoo service type | `ClusterIP` | +| `service.port` | Odoo service HTTP port | `80` | +| `service.longPollingPort` | Odoo service HTTP port | `8072` | +| `service.annotations` | Additional custom annotations for Odoo service | `{}` | +| `service.loadBalancerIP` | Odoo service Load Balancer IP | `""` | +| `ingress.enabled` | Enable ingress record generation for Odoo | `false` | +| `ingress.pathType` | Ingress path type | `ImplementationSpecific` | +| `ingress.recommendedNginxSettings` | Set of ingress annotations that increase nginx timeout and provides g-zip | `true` | +| `ingress.wwwRedirect` | Enable redirect from www domain to non-www domain using an ingress annotation | `false` | +| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | +| `ingress.hosts` | An array with hostname(s) to be covered with the ingress record | `[]` | +| `ingress.tls` | An array of hostname(s) provided in ingress.hosts to be covered by TLS | `[]` | +| `ingress.cache.enabled` | Enable cache by creating a separate ingress with rules and headers just for cacheable paths (/static/*) | `false` | +| `ingress.cache.recommendedNginxSettings` | Add recommended (default) nginx annotations for nginx cache to work | `true` | +| `ingress.cache.annotations` | Additional annotations for the Cache Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` | +| `ingress.cache.hosts` | | `[]` | +| `ingress.cache.paths` | | `[]` | +| `ingress.cache.tls` | Same tls configuration as in the main ingress if cache is applied over SSL connection | `[]` | +| `persistence.enabled` | Enable persistence using Persistent Volume Claims | `true` | +| `persistence.initVolume` | Activate init-container which casts chown on the odoo-volume (filestore) | `true` | +| `persistence.storageClass` | Persistent Volume storage class | `""` | +| `persistence.accessMode` | Persistent Volume access modes | `[]` | +| `persistence.size` | Persistent Volume size | `8Gi` | +| `persistence.volumeName` | The name of the PVC | `odoo` | +| `persistence.subPath` | refer to a path within the mounted volume (useful for NFS shared storage and multiple environments/deployments) | `""` | +| `persistence.annotations` | Additional annotations for the PVC | `{}` | +| `persistence.existingClaim` | refers to the full name of an existing PVC so as to not create a new one but reuse the existing resource | `""` | +| `persistence.extraVolumeMounts` | additional server volumeMounts (usefull in NFS scenarios to access live filestore for staging replication) | `[]` | +| `resources.limits` | The resources limits for the Odoo container | `{}` | +| `resources.requests` | The requested resources for the Odoo container | `{}` | +| `livenessProbe.enabled` | Enable livenessProbe | `true` | +| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `60` | +| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `30` | +| `livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | +| `livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `10` | +| `livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | +| `readinessProbe.enabled` | Enable readinessProbe | `true` | +| `readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `30` | +| `readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` | +| `readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `5` | +| `readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `10` | +| `readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Tolerations for pod assignment | `[]` | +| `affinity` | Affinity for pod assignment | `{}` | diff --git a/odoo-doodba/templates/NOTES.txt b/odoo-doodba/templates/NOTES.txt new file mode 100644 index 0000000..ef89beb --- /dev/null +++ b/odoo-doodba/templates/NOTES.txt @@ -0,0 +1,21 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "odoo-doodba.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "odoo-doodba.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "odoo-doodba.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "odoo-doodba.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/odoo-doodba/templates/_helpers.tpl b/odoo-doodba/templates/_helpers.tpl new file mode 100644 index 0000000..371b9d3 --- /dev/null +++ b/odoo-doodba/templates/_helpers.tpl @@ -0,0 +1,64 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "odoo-doodba.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +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). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "odoo-doodba.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 -}} +{{- end -}} + +{{- define "odoo-doodba.postgresql.fullname" -}} +{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{- define "odoo-doodba.redis.fullname" -}} +{{- printf "%s-%s" .Release.Name "redis-master" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "odoo-doodba.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "odoo-doodba.labels" -}} +app.kubernetes.io/name: {{ include "odoo-doodba.name" . }} +helm.sh/chart: {{ include "odoo-doodba.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "odoo-doodba.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "odoo-doodba.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/odoo-doodba/templates/configmap.yaml b/odoo-doodba/templates/configmap.yaml new file mode 100644 index 0000000..6ba91fd --- /dev/null +++ b/odoo-doodba/templates/configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "odoo-doodba.fullname" . }} + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} +data: +{{- if .Values.config }} +{{ toYaml .Values.config | indent 2 }} +{{- end }} diff --git a/odoo-doodba/templates/deployment.yaml b/odoo-doodba/templates/deployment.yaml new file mode 100644 index 0000000..43652f7 --- /dev/null +++ b/odoo-doodba/templates/deployment.yaml @@ -0,0 +1,159 @@ +{{- $dbType := default "none" .Values.postgresql.externalDatabase -}} +{{- $gcloud_sql := and (not .Values.postgresql.enabled) (eq $dbType "gcloud") .Values.postgresql.gcInstanceConnectionName true -}} +{{- $gcloud_sql_credentials := .Values.postgresql.gcCredentialsFile | default "credentials.json" -}} +{{- $redisExistingSecret := .Values.redis.existingSecret | default false}} +{{- $redisExistingSecretPasswordKey := .Values.redis.redisExistingSecretPasswordKey | default false}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "odoo-doodba.fullname" . }} + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} + annotations: + checksum/configMap: {{ toYaml .Values.configMap | sha256sum }} +spec: + strategy: + {{- toYaml .Values.updateStrategy | nindent 4 }} + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "odoo-doodba.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "odoo-doodba.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + annotations: + checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} + {{ if .Values.rollDeploy }} + rollDeploy: {{ randAlphaNum 5 | quote }} + {{ end }} + {{ if .Values.annotations }} + {{- toYaml .Values.annotations | nindent 8 }} + {{ end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ template "odoo-doodba.serviceAccountName" . }} + {{- if .Values.podSecurityContext.enabled }} + securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} + {{- end }} + {{ if and .Values.persistence.enabled .Values.persistence.initVolume }} + initContainers: + - name: volume-hack + image: busybox + command: ['sh', '-c', 'chown 1000:1000 -R /odoo'] + resources: + requests: + cpu: "50m" + memory: "100Mi" + limits: + cpu: "100m" + memory: "200Mi" + volumeMounts: + - name: odoo + mountPath: /odoo + {{ end }} + containers: + - name: server + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8069 + env: + - name: PGHOST + value: {{ ternary (include "odoo-doodba.postgresql.fullname" .) .Values.postgresql.postgresHost .Values.postgresql.enabled | default "localhost" }} + - name: PGUSER + value: {{ .Values.postgresql.postgresqlUsername | quote }} + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: {{ ternary (printf "%s-%s" .Release.Name "postgresql") (include "odoo-doodba.fullname" .) .Values.postgresql.enabled | quote }} + key: postgresql-password + - name: ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "odoo-doodba.fullname" . }} + key: odoo-password + envFrom: + - configMapRef: + name: {{ include "odoo-doodba.fullname" . }} + {{- 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 | nindent 12 }} + {{ if .Values.persistence.enabled }} + volumeMounts: + - name: odoo + mountPath: /var/lib/odoo + {{ if .Values.persistence.subPath }} + subPath: {{ .Values.persistence.subPath }} + {{ end }} + {{- if ne (len .Values.persistence.extraVolumeMounts) 0 }} + {{ toYaml .Values.persistence.extraVolumeMounts | nindent 10 }} + {{- end }} + {{ end }} + {{ if and $gcloud_sql (not .Values.pgBouncer.enabled) }} + - name: cloudsql-proxy + image: gcr.io/cloudsql-docker/gce-proxy:1.16 + command: ["/cloud_sql_proxy", + "-instances={{ .Values.postgresql.gcInstanceConnectionName }}=tcp:5432", + "-credential_file=/secrets/cloudsql/{{ $gcloud_sql_credentials }}"] + securityContext: + runAsUser: 2 + allowPrivilegeEscalation: false + volumeMounts: + - name: cloudsql-instance-credentials + mountPath: /secrets/cloudsql + readOnly: true + {{ end }} + volumes: + {{ if .Values.persistence.enabled }} + - name: odoo + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim | default (include "odoo-doodba.fullname" .) }} + {{ end }} + {{ if and $gcloud_sql (not .Values.pgBouncer.enabled)}} + - name: cloudsql-instance-credentials + secret: + secretName: cloudsql-instance-credentials + {{ end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/odoo-doodba/templates/ingress-cache.yaml b/odoo-doodba/templates/ingress-cache.yaml new file mode 100644 index 0000000..c8ceae7 --- /dev/null +++ b/odoo-doodba/templates/ingress-cache.yaml @@ -0,0 +1,63 @@ +{{- if and .Values.ingress.enabled .Values.ingress.cache.enabled -}} +apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} +kind: Ingress +metadata: + name: {{ include "odoo-doodba.fullname" . }}-cache + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} + annotations: + kubernetes.io/ingress.class: nginx + {{ if .Values.ingress.wwwRedirect }} + nginx.ingress.kubernetes.io/from-to-www-redirect: "true" + {{ end }} + {{ if .Values.ingress.cache.recommendedNginxSettings }} + nginx.ingress.kubernetes.io/proxy-buffering: "on" + nginx.ingress.kubernetes.io/proxy-buffers-number: "16" + nginx.ingress.kubernetes.io/proxy-buffer-size: "128k" + nginx.ingress.kubernetes.io/proxy-connect-timeout: "15" + nginx.ingress.kubernetes.io/proxy-read-timeout: "1500" + nginx.ingress.kubernetes.io/proxy-send-timeout: "1500" + nginx.ingress.kubernetes.io/hsts-include-subdomains: "false" + nginx.ingress.kubernetes.io/body-size: "64m" + nginx.ingress.kubernetes.io/server-name-hash-bucket-size: "256" + nginx.ingress.kubernetes.io/gzip-types: "application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/xml text/plain text/x-component text/less" + nginx.ingress.kubernetes.io/proxy-body-size: "2000m" + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/configuration-snippet: | + proxy_hide_header Set-Cookie; + proxy_ignore_headers Cache-Control Set-Cookie; + proxy_cache static-cache; + proxy_cache_revalidate on; + proxy_cache_lock on; + proxy_cache_valid 200 302 60m; + proxy_cache_use_stale error timeout updating http_404 http_500 http_502 http_503 http_504; + add_header X-Cache-Status $upstream_cache_status; + expires 864000; + {{ end }} + {{- with .Values.ingress.cache.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.cache.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.cache.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range $.Values.ingress.cache.paths }} + - path: {{ . | quote }} + backend: + serviceName: {{ include "odoo-doodba.fullname" $ }} + servicePort: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/odoo-doodba/templates/ingress.yaml b/odoo-doodba/templates/ingress.yaml new file mode 100644 index 0000000..3c2c5ac --- /dev/null +++ b/odoo-doodba/templates/ingress.yaml @@ -0,0 +1,55 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }} +kind: Ingress +metadata: + name: {{ include "odoo-doodba.fullname" . }} + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} + annotations: + kubernetes.io/ingress.class: nginx + {{ if .Values.ingress.recommendedNginxSettings }} + nginx.ingress.kubernetes.io/proxy-buffering: "on" + nginx.ingress.kubernetes.io/proxy-body-size: "2000m" + nginx.ingress.kubernetes.io/proxy-connect-timeout: "15" + nginx.ingress.kubernetes.io/proxy-read-timeout: "1500" + nginx.ingress.kubernetes.io/proxy-send-timeout: "1500" + nginx.ingress.kubernetes.io/gzip-types: "application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/xml text/plain text/x-component text/less" + {{ end }} + {{ if .Values.ingress.wwwRedirect }} + nginx.ingress.kubernetes.io/from-to-www-redirect: "true" + {{ end }} + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + - path: / + {{- if eq "true" (include "common.ingress.supportsPathType" $) }} + pathType: {{ default "ImplementationSpecific" $.Values.ingress.pathType }} + {{ end }} + backend: + serviceName: {{ include "odoo-doodba.fullname" $ }} + servicePort: {{ $.Values.service.port }} + - path: /longpolling + {{- if eq "true" (include "common.ingress.supportsPathType" $) }} + pathType: {{ default "ImplementationSpecific" $.Values.ingress.pathType }} + {{ end }} + backend: + serviceName: {{ include "odoo-doodba.fullname" $ }} + servicePort: {{ $.Values.service.longPollingPort }} + {{- end }} +{{- end }} diff --git a/odoo-doodba/templates/pvc.yaml b/odoo-doodba/templates/pvc.yaml new file mode 100644 index 0000000..457589b --- /dev/null +++ b/odoo-doodba/templates/pvc.yaml @@ -0,0 +1,28 @@ +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "odoo-doodba.fullname" . }} + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} +{{- with .Values.persistence.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" + {{- end }} +{{- end }} +{{- if .Values.persistence.volumeName }} + volumeName: {{ .Values.persistence.volumeName | quote }} +{{- end }} + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} +{{ end }} \ No newline at end of file diff --git a/odoo-doodba/templates/secret.yaml b/odoo-doodba/templates/secret.yaml new file mode 100644 index 0000000..0fa6767 --- /dev/null +++ b/odoo-doodba/templates/secret.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "odoo-doodba.fullname" . }} + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} +type: Opaque +data: + {{ if .Values.odooPassword }} + odoo-password: {{ .Values.odooPassword | b64enc | quote }} + {{ else }} + odoo-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} + {{ if not .Values.postgresql.enabled }} + {{ if .Values.postgresql.postgresqlPassword}} + postgresql-password: {{ .Values.postgresql.postgresqlPassword | b64enc | quote }} + {{ else }} + postgresql-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} + {{ end }} diff --git a/odoo-doodba/templates/service.yaml b/odoo-doodba/templates/service.yaml new file mode 100644 index 0000000..03b7177 --- /dev/null +++ b/odoo-doodba/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "odoo-doodba.fullname" . }} + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + {{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} + {{ end }} + ports: + - port: {{ .Values.service.port }} + targetPort: 8069 + name: http + ports: + - port: {{ .Values.service.longPollingPort }} + targetPort: 8072 + name: longpolling + selector: + app.kubernetes.io/name: {{ include "odoo-doodba.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/odoo-doodba/templates/serviceaccount.yaml b/odoo-doodba/templates/serviceaccount.yaml new file mode 100644 index 0000000..5a27c18 --- /dev/null +++ b/odoo-doodba/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "odoo-doodba.serviceAccountName" . }} + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} +{{- end -}} diff --git a/odoo-doodba/templates/tests/test-connection.yaml b/odoo-doodba/templates/tests/test-connection.yaml new file mode 100644 index 0000000..061d460 --- /dev/null +++ b/odoo-doodba/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "odoo-doodba.fullname" . }}-test-connection" + labels: +{{ include "odoo-doodba.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "odoo-doodba.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/odoo-doodba/values.yaml b/odoo-doodba/values.yaml new file mode 100644 index 0000000..3f998df --- /dev/null +++ b/odoo-doodba/values.yaml @@ -0,0 +1,387 @@ +# Default values for odoo-doodba. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +## @param replicaCount Number of Odoo replicas to deploy +## NOTE: ReadWriteMany PVC(s) are required if replicaCount > 1 +## +replicaCount: 1 + +## @param rollDeploy Activates a new deployment with each helm upgrade regardless of diff in chances +## Default to false +rollDeploy: false + +## @param annotations Annotations for Odoo pods +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +annotations: {} + +## @param updateStrategy.type Odoo deployment strategy type +## @param updateStrategy.rollingUpdate Odoo deployment rolling update configuration parameters +## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy +## NOTE: Set it to `Recreate` if you use a PV that cannot be mounted on multiple pods +## e.g: +## updateStrategy: +## type: RollingUpdate +## rollingUpdate: +## maxSurge: 25% +## maxUnavailable: 25% +## +updateStrategy: + type: RollingUpdate + rollingUpdate: {} + +## @param image.repository Odoo image repository +## @param image.tag Odoo image tag (immutable tags are recommended) +## @param image.pullPolicy Odoo image pull policy +image: + repository: tecnativa/doodba + tag: "15.0" + pullPolicy: IfNotPresent + +## @param imagePullSecrets Global Docker registry secret names as an array +## +imagePullSecrets: [] +## @param nameOverride String to partially override common.names.fullname +## +nameOverride: "" +## @param fullnameOverride String to fully override common.names.fullname +## +fullnameOverride: "" + +## @param serviceAccount.create Specifies whether a ServiceAccount should be created +## @param serviceAccount.name The name of the ServiceAccount to create +## +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +## Configure Pods Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod +## @param podSecurityContext.enabled Enabled Odoo pods' Security Context +## @param podSecurityContext.fsGroup Set Odoo pod's Security Context fsGroup +## +podSecurityContext: + enabled: false + fsGroup: 1001 + +## Configure Container Security Context (only main container) +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container +## @param containerSecurityContext.enabled Enabled Odoo containers' Security Context +## @param containerSecurityContext.runAsUser Set Odoo container's Security Context runAsUser +## +containerSecurityContext: + enabled: false + runAsUser: 1001 + +## @param odooPassword Odoo user password +## Defaults to a random 10-character alphanumeric string if not set +odooPassword: "" + + +## @param config values in odoo.conf format as multiline string will be merged with the default odoo.conf file and override any existing values +## config: | +## [options] +## workers = 2 +## list_db = false +## server_wide_modules=web,queue_job +## [queue_job] +## channels=root:1 +## scheme = https +## host = odoo.host +## port = 443 +config: "" + +pgBouncer: + ## @param pgBouncer.enabled Enable a subchart that launches the pgBouncer connection pooler as a middleware between odoo and postgresql + enabled: false + +## @section Odoo postgresql cluster database +postgresql: + + ## @param postgresql.enabled Deploy PostgreSQL container(s) + enabled: true + + image: + ## @param postgresql.image.repository Docker repository for postgresql image + repository: postgres + ## @param postgresql.image.tag Docker image tag for postgresql image + tag: latest + + ## @param postgresql.postgresqlUsername PostgreSQL non-root username + ## ref: https://hub.docker.com/_/postgres/ + ## + postgresqlUsername: "odoo" + + ## @param postgresql.postgresqlPassword PostgreSQL password + ## ref: https://hub.docker.com/_/postgres/ + ## + postgresqlPassword: "" + + ## External Database Configuration + ## All of these values are only used when postgresql.enabled is set to false + + ## @param postgresql.postgresHost External Database server host + postgresHost: "" + + ## @param postgresql.port External Database server port + port: 5432 + + ## @param postgresql.externalDatabase standard or gcloud + externalDatabase: "" + + ## @section Google cloud SQL + ## Only available if postgresql.externalDatabase is set to gcloud + + ## @param postgresql.gcInstanceConnectionName Psql instance name on google cloud + ## e.g "project-id:us-west1:instance-name" + gcInstanceConnectionName: "" + + ## @param postgresql.gcCredentialsFile Filename of svc account credentials stored in cloudsql-instance-credentials secret + ## "credentials.json" + gcCredentialsFile: "" + +## @section Redis session storage +redis: + ## Redis sub-chart for session storage (and potentially data caching) + ## This depends on the installation of https://github.com/camptocamp/odoo-cloud-platform/tree/15.0/session_redis + ## One must add this module to the the server_wide_modules in the odoo config file + + ## @param redis.enabled Enable redis subchart for deployment + ## default false + enabled: false + + ## @param redis.password Password to redis instance + ## default redis-passowrd + password: redis-password + + # Disable master/slave redis topology by default if redis is enabled + cluster: + ## @param redis.cluster.enabled Enable deployment of a multi-tier cluster + ## default false + enabled: false + +service: + ## @param service.type Odoo service type + ## default ClusterIP + type: ClusterIP + ## Pod ports to expose + ## @param service.port Odoo service HTTP port + ## default 80 + port: 80 + ## @param service.longPollingPort Odoo service HTTP port + ## default 8072 + longPollingPort: 8072 + + ## @param service.annotations Additional custom annotations for Odoo service + ## + annotations: {} + + ## @param service.loadBalancerIP Odoo service Load Balancer IP + ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer + ## + loadBalancerIP: "" + +ingress: + ## @param ingress.enabled Enable ingress record generation for Odoo + ## + enabled: false + + ## @param ingress.pathType Ingress path type + ## + pathType: ImplementationSpecific + ## @param ingress.recommendedNginxSettings Set of ingress annotations that increase nginx timeout and provides g-zip + ## compression and other opinionated proxy settings to make Odoo run smoothly. + recommendedNginxSettings: true + + ## @param ingress.wwwRedirect Enable redirect from www domain to non-www domain using an ingress annotation + wwwRedirect: false + + ## @param ingress.annotations Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. + ## For a full list of possible ingress annotations, please see + ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md + ## Use this parameter to set the required annotations for cert-manager, see + ## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations + ## + ## e.g: + ## annotations: + ## kubernetes.io/ingress.class: nginx + ## cert-manager.io/cluster-issuer: cluster-issuer-name + ## + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + + ## @param ingress.hosts An array with hostname(s) to be covered with the ingress record + ## e.g: + ## hosts: + ## - name: odoo.local + ## + hosts: [] + + ## @param ingress.tls An array of hostname(s) provided in ingress.hosts to be covered by TLS + ## - secretName: chart-example-tls + ## hosts: + ## - odoo.local + tls: [] + + ## @param ingress.cache.enabled Enable cache by creating a separate ingress with rules and headers just for cacheable paths (/static/*) + ## default value: False + ## NGINX-INGRESS config needed for this cache ingress to work (has to be setup in nginx-ingress chart) + ## More info about this snippet on https://www.nginx.com/blog/nginx-caching-guide/ + ## # config: + ## # http-snippet: | + ## # proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=static-cache:10m max_size=1g inactive=7d use_temp_path=off; + ## # proxy_cache_key $scheme$proxy_host$request_uri; + ## # proxy_cache_lock on; + ## # proxy_cache_use_stale updating; + cache: + enabled: false + + + ## @param ingress.cache.recommendedNginxSettings Add recommended (default) nginx annotations for nginx cache to work + ## default value: True + recommendedNginxSettings: true + + ## @param ingress.cache.annotations Additional annotations for the Cache Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. + ## For a full list of possible ingress annotations, please see + ## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md + ## Use this parameter to set the required annotations for cert-manager, see + ## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations + ## + ## e.g: + ## annotations: + ## kubernetes.io/ingress.class: nginx + ## cert-manager.io/cluster-issuer: cluster-issuer-name + ## + annotations: {} + + ## @param ingress.cache.hosts + ## Hosts that will have the cache paths applied to + ## hosts: + ## - foo.com + ## - bar.com + hosts: [] + + ## @param ingress.cache.paths + ## Paths that will be added to the cache ingress (examples below make use of nginx.ingress.kubernetes.io/use-regex: true) + ## paths: + ## - "/*/static/*" + ## - "/web/image/*" + ## - "/web/content/*" + ## - "/website/image/*" + paths: [] + + ## @param ingress.cache.tls Same tls configuration as in the main ingress if cache is applied over SSL connection + tls: [] + +## Persistence Parameters +## ref: https://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + + ## @param persistence.enabled Enable persistence using Persistent Volume Claims + ## + enabled: true + + ## @param persistence.initVolume Activate init-container which casts chown on the odoo-volume (filestore) + ## to be set with the UID of the odoo user in the container + ## default value: True + initVolume: true + + ## @param persistence.storageClass Persistent Volume storage class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner + ## + storageClass: "" + + ## @param persistence.accessMode [array] Persistent Volume access modes + ## + accessMode: ReadWriteOnce + + ## @param persistence.size Persistent Volume size + ## + size: 8Gi + + ## @param persistence.volumeName The name of the PVC + ## default value: odoo + volumeName: odoo + + ## @param persistence.subPath refer to a path within the mounted volume (useful for NFS shared storage and multiple environments/deployments) + subPath: "" + + ## @param persistence.annotations Additional annotations for the PVC + annotations: {} + + ## @param persistence.existingClaim refers to the full name of an existing PVC so as to not create a new one but reuse the existing resource + existingClaim: "" + + ## @param persistence.extraVolumeMounts additional server volumeMounts (usefull in NFS scenarios to access live filestore for staging replication) + ## - name: odoo + ## mountPath: /var/lib/odoo-live + ## subpath: live + ## readOnly: true + extraVolumeMounts: [] + + +## Odoo containers' resource requests and limits +## ref: https://kubernetes.io/docs/user-guide/compute-resources/ +## @param resources.limits The resources limits for the Odoo container +## @param resources.requests [object] The requested resources for the Odoo container +## +resources: + requests: + cpu: 200m + memory: 512Mi + limits: {} + +## Configure extra options for Odoo containers' liveness and readiness probes +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes +## @param livenessProbe.enabled Enable livenessProbe +## @param livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe +## @param livenessProbe.periodSeconds Period seconds for livenessProbe +## @param livenessProbe.timeoutSeconds Timeout seconds for livenessProbe +## @param livenessProbe.failureThreshold Failure threshold for livenessProbe +## @param livenessProbe.successThreshold Success threshold for livenessProbe +## +livenessProbe: + enabled: true + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 5 + failureThreshold: 10 + successThreshold: 1 + +## @param readinessProbe.enabled Enable readinessProbe +## @param readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe +## @param readinessProbe.periodSeconds Period seconds for readinessProbe +## @param readinessProbe.timeoutSeconds Timeout seconds for readinessProbe +## @param readinessProbe.failureThreshold Failure threshold for readinessProbe +## @param readinessProbe.successThreshold Success threshold for readinessProbe +## +readinessProbe: + enabled: true + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 10 + successThreshold: 1 + +## @param nodeSelector Node labels for pod assignment +## ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + +## @param tolerations Tolerations for pod assignment +## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## @param affinity 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: {} From a2381587e3ff28e8c77192e6c50961dad806b956 Mon Sep 17 00:00:00 2001 From: Paul Catinean Date: Sat, 23 Jul 2022 19:20:36 +0300 Subject: [PATCH 2/2] Moved charts to dir helm-charts --- {odoo-doodba => helm-charts/odoo-doodba}/.helmignore | 0 {odoo-doodba => helm-charts/odoo-doodba}/Chart.yaml | 0 {odoo-doodba => helm-charts/odoo-doodba}/README.md | 0 {odoo-doodba => helm-charts/odoo-doodba}/templates/NOTES.txt | 0 {odoo-doodba => helm-charts/odoo-doodba}/templates/_helpers.tpl | 0 {odoo-doodba => helm-charts/odoo-doodba}/templates/configmap.yaml | 0 .../odoo-doodba}/templates/deployment.yaml | 0 .../odoo-doodba}/templates/ingress-cache.yaml | 0 {odoo-doodba => helm-charts/odoo-doodba}/templates/ingress.yaml | 0 {odoo-doodba => helm-charts/odoo-doodba}/templates/pvc.yaml | 0 {odoo-doodba => helm-charts/odoo-doodba}/templates/secret.yaml | 0 {odoo-doodba => helm-charts/odoo-doodba}/templates/service.yaml | 0 .../odoo-doodba}/templates/serviceaccount.yaml | 0 .../odoo-doodba}/templates/tests/test-connection.yaml | 0 {odoo-doodba => helm-charts/odoo-doodba}/values.yaml | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename {odoo-doodba => helm-charts/odoo-doodba}/.helmignore (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/Chart.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/README.md (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/NOTES.txt (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/_helpers.tpl (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/configmap.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/deployment.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/ingress-cache.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/ingress.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/pvc.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/secret.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/service.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/serviceaccount.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/templates/tests/test-connection.yaml (100%) rename {odoo-doodba => helm-charts/odoo-doodba}/values.yaml (100%) diff --git a/odoo-doodba/.helmignore b/helm-charts/odoo-doodba/.helmignore similarity index 100% rename from odoo-doodba/.helmignore rename to helm-charts/odoo-doodba/.helmignore diff --git a/odoo-doodba/Chart.yaml b/helm-charts/odoo-doodba/Chart.yaml similarity index 100% rename from odoo-doodba/Chart.yaml rename to helm-charts/odoo-doodba/Chart.yaml diff --git a/odoo-doodba/README.md b/helm-charts/odoo-doodba/README.md similarity index 100% rename from odoo-doodba/README.md rename to helm-charts/odoo-doodba/README.md diff --git a/odoo-doodba/templates/NOTES.txt b/helm-charts/odoo-doodba/templates/NOTES.txt similarity index 100% rename from odoo-doodba/templates/NOTES.txt rename to helm-charts/odoo-doodba/templates/NOTES.txt diff --git a/odoo-doodba/templates/_helpers.tpl b/helm-charts/odoo-doodba/templates/_helpers.tpl similarity index 100% rename from odoo-doodba/templates/_helpers.tpl rename to helm-charts/odoo-doodba/templates/_helpers.tpl diff --git a/odoo-doodba/templates/configmap.yaml b/helm-charts/odoo-doodba/templates/configmap.yaml similarity index 100% rename from odoo-doodba/templates/configmap.yaml rename to helm-charts/odoo-doodba/templates/configmap.yaml diff --git a/odoo-doodba/templates/deployment.yaml b/helm-charts/odoo-doodba/templates/deployment.yaml similarity index 100% rename from odoo-doodba/templates/deployment.yaml rename to helm-charts/odoo-doodba/templates/deployment.yaml diff --git a/odoo-doodba/templates/ingress-cache.yaml b/helm-charts/odoo-doodba/templates/ingress-cache.yaml similarity index 100% rename from odoo-doodba/templates/ingress-cache.yaml rename to helm-charts/odoo-doodba/templates/ingress-cache.yaml diff --git a/odoo-doodba/templates/ingress.yaml b/helm-charts/odoo-doodba/templates/ingress.yaml similarity index 100% rename from odoo-doodba/templates/ingress.yaml rename to helm-charts/odoo-doodba/templates/ingress.yaml diff --git a/odoo-doodba/templates/pvc.yaml b/helm-charts/odoo-doodba/templates/pvc.yaml similarity index 100% rename from odoo-doodba/templates/pvc.yaml rename to helm-charts/odoo-doodba/templates/pvc.yaml diff --git a/odoo-doodba/templates/secret.yaml b/helm-charts/odoo-doodba/templates/secret.yaml similarity index 100% rename from odoo-doodba/templates/secret.yaml rename to helm-charts/odoo-doodba/templates/secret.yaml diff --git a/odoo-doodba/templates/service.yaml b/helm-charts/odoo-doodba/templates/service.yaml similarity index 100% rename from odoo-doodba/templates/service.yaml rename to helm-charts/odoo-doodba/templates/service.yaml diff --git a/odoo-doodba/templates/serviceaccount.yaml b/helm-charts/odoo-doodba/templates/serviceaccount.yaml similarity index 100% rename from odoo-doodba/templates/serviceaccount.yaml rename to helm-charts/odoo-doodba/templates/serviceaccount.yaml diff --git a/odoo-doodba/templates/tests/test-connection.yaml b/helm-charts/odoo-doodba/templates/tests/test-connection.yaml similarity index 100% rename from odoo-doodba/templates/tests/test-connection.yaml rename to helm-charts/odoo-doodba/templates/tests/test-connection.yaml diff --git a/odoo-doodba/values.yaml b/helm-charts/odoo-doodba/values.yaml similarity index 100% rename from odoo-doodba/values.yaml rename to helm-charts/odoo-doodba/values.yaml