postinstall stuff (tailscale ingresses)
This commit is contained in:
62
odoo/templates/_helpers.tpl
Normal file
62
odoo/templates/_helpers.tpl
Normal file
@@ -0,0 +1,62 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "odoo.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.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.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "odoo.labels" -}}
|
||||
helm.sh/chart: {{ include "odoo.chart" . }}
|
||||
{{ include "odoo.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "odoo.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "odoo.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "odoo.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "odoo.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
26
odoo/templates/db-deployment.yaml
Normal file
26
odoo/templates/db-deployment.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: odoo-db
|
||||
# namespace: odoo
|
||||
spec:
|
||||
instances: 2
|
||||
storage:
|
||||
size: 2Gi
|
||||
storageClass: longhorn
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-secret
|
||||
key: POSTGRES_DB
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-secret
|
||||
key: POSTGRES_PASSWORD
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-secret
|
||||
key: POSTGRES_USER
|
||||
36
odoo/templates/odoo-deployment.yaml
Normal file
36
odoo/templates/odoo-deployment.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: odoo
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: HOST
|
||||
value: odoo-db-rw.odoo
|
||||
- name: USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-secret
|
||||
key: POSTGRES_USER
|
||||
- name: PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: odoo-secret
|
||||
key: POSTGRES_PASSWORD
|
||||
image: "{{ .Values.image.odoo.repository }}:{{ .Values.image.odoo.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.odoo.pullPolicy }}
|
||||
name: odoo
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- mountPath: /code/media
|
||||
name: odoo-media
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: odoo-media
|
||||
persistentVolumeClaim:
|
||||
claimName: odoo-media
|
||||
9
odoo/templates/secrets.yaml
Normal file
9
odoo/templates/secrets.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: odoo-secret
|
||||
type: Opaque
|
||||
data:
|
||||
POSTGRES_DB: YWR2ZW50dXJlbG9nCg==
|
||||
POSTGRES_PASSWORD: c2VjcmV0cGFzc3dvcmQK
|
||||
POSTGRES_USER: YWR2ZW50dXJlbG9nCg==
|
||||
Reference in New Issue
Block a user