postinstall stuff (tailscale ingresses)

This commit is contained in:
2024-11-03 22:57:11 +00:00
parent 8471de450f
commit c0097428df
27 changed files with 863 additions and 4 deletions

23
odoo/.helmignore Normal file
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/

6
odoo/Chart.yaml Normal file
View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: odoo
description: A Helm chart for deploying odoo
type: application
version: 0.1.0
appVersion: "1.16.0"

View 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 }}

View 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

View 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

View 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==

80
odoo/values.yaml Normal file
View File

@@ -0,0 +1,80 @@
replicaCount: 1
image:
odoo:
repository: odoo
pullPolicy: IfNotPresent
tag: "17.0"
# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
service:
# This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
type: ClusterIP
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
port: 80
# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80
# Additional volumes on the output Deployment definition.
volumes: []
# - name: foo
# secret:
# secretName: mysecret
# optional: false
# Additional volumeMounts on the output Deployment definition.
volumeMounts: []
# - name: foo
# mountPath: "/etc/foo"
# readOnly: true
nodeSelector: {}
tolerations: []
affinity: {}