Added odoo

This commit is contained in:
2024-11-11 15:43:45 +00:00
parent 8984a8d724
commit e3225f7857
17 changed files with 414 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# 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
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@@ -0,0 +1,5 @@
apiVersion: v2
name: odoo-argocd-apps
description: A Helm chart for deploying the requirements, main charts and postinstall as ArgoCD apps for Odoo
type: application
version: 0.1.0

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "odoo-argocd-apps.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-argocd-apps.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 }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "odoo-argocd-apps.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "odoo-argocd-apps.labels" -}}
helm.sh/chart: {{ include "odoo-argocd-apps.chart" . }}
{{ include "odoo-argocd-apps.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "odoo-argocd-apps.selectorLabels" -}}
app.kubernetes.io/name: {{ include "odoo-argocd-apps.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "odoo-argocd-apps.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "odoo-argocd-apps.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,41 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: odoo-chart
namespace: {{ .Values.argocd.namespace }}
annotations:
argocd.argoproj.io/sync-wave: "0"
notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578"
spec:
project: {{ .Values.argocd.project }}
source:
repoURL: registry-1.docker.io/bitnamicharts
chart: odoo
targetRevision: 28.x
helm:
releaseName: odoo
valuesObject:
odooEmail: {{ .Values.odoo.odooEmail }}
replicaCount: {{ .Values.odoo.replicaCount }}
persistence:
existingClaim: {{ .Values.odoo.dataPvc.name }}
postgresql:
enabled: false
externalDatabase:
host: odoo-db-rw
port: 5432
postgresqlPostgresUser: app
existingSecret: odoo-db-app
existingSecretPostgresPasswordKey: password
destination:
server: {{ .Values.destination.server }}
namespace: {{ .Values.destination.namespace }}
syncPolicy:
automated:
prune: true # Automatically remove resources no longer in the repo
selfHeal: true # Automatically self-heal when drift is detected
syncOptions:
- ApplyOutOfSyncOnly=true
- ServerSideApply=true
- CreateNamespace=true

View File

@@ -0,0 +1,36 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: odoo-requirements
namespace: {{ .Values.argocd.namespace }}
annotations:
argocd.argoproj.io/sync-wave: "-1"
notifications.argoproj.io/subscribe.on-sync-succeeded.telegram: "-1002270587578"
spec:
project: {{ .Values.argocd.project }}
source:
repoURL: {{ .Values.argocd.requirements.repoURL }}
targetRevision: {{ .Values.requirements.targetRevision }}
path: {{ .Values.requirements.path }}
helm:
releaseName: odoo-requirements
valuesObject:
odoo:
dbCluster:
numInstances: {{ .Values.odoo.dbCluster.numInstances }}
size: {{ .Values.odoo.dbCluster.size }}
dataPvc:
name: {{ .Values.odoo.dataPvc.name }}
storageClassName: {{ .Values.odoo.dataPvc.storageClassName }}
size: {{ .Values.odoo.dataPvc.size }}
destination:
server: {{ .Values.destination.server }}
namespace: {{ .Values.destination.namespace }}
syncPolicy:
automated:
prune: true # Automatically remove resources no longer in the repo
selfHeal: true # Automatically self-heal when drift is detected
syncOptions:
- ApplyOutOfSyncOnly=true
- ServerSideApply=true
- CreateNamespace=true

View File

@@ -0,0 +1,22 @@
argocd:
namespace: argocd
project: default
requirements:
repoURL: "https://git.blarre.net/thomas/helm-charts.git"
targetRevision: HEAD
path: odoo-requirements
destination:
server: "https://kubernetes.default.svc"
namespace: odoo
odoo:
dbCluster:
numInstances: 3
size: 10Gi
dataPvc:
name: odoo-data
storageClassName: ''
size: 40Gi
odooEmail: "admin@domain.net"
replicaCount: 1