Skip to content

Instantly share code, notes, and snippets.

@theangryangel
Last active July 1, 2022 05:33
Show Gist options
  • Save theangryangel/7397c615e043ccfcc3f24c9075c0ac31 to your computer and use it in GitHub Desktop.
Save theangryangel/7397c615e043ccfcc3f24c9075c0ac31 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: ConfigMap
metadata:
name: odoo-conf
data:
web: |
[options]
server_wide_modules = web
max_cron_threads = 0
workers = 4
longpolling_port = 8072
queue: |
[options]
server_wide_modules = queue_job
workers = 4
max_cron_threads = 1
[queue_job]
channels = root:4
---
apiVersion: v1
kind: ConfigMap
metadata:
name: odoo-env
namespace: odoo
data:
PGHOST: "????"
PGPORT: "????"
PGUSER: "????"
PGDATABASE: "????"
PROXY_MODE: "true"
WITHOUT_DEMO: "true"
SMTP_SERVER: "????"
SMTP_PORT: "????"
SMTP_USER: "????"
SMTP_SSL: "true"
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: odoo-web-ingress-route
spec:
entryPoints:
- websecure
routes:
- match: |
Host(`???`)
kind: Rule
middlewares:
services:
- name: odoo-web-service
port: 8069
tls:
certResolver: letsencrypt
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: odoo-longpolling-ingress-route
spec:
entryPoints:
- websecure
routes:
- match: |
Host(`????`) && PathPrefix(`/longpolling/`)
kind: Rule
middlewares:
services:
- name: odoo-web-service
port: 8072
tls:
certResolver: letsencrypt
# queue.yml would largely be a duplicate of the web.yml,
# just with a different deployment name, restricted to
# 1 replica and a different set of configs
# You could do the same with the longpolling
apiVersion: v1
kind: Secret
metadata:
name: odoo-secret
type: Opaque
data:
PGPASSWORD: "????"
ADMIN_PASSWORD: "????"
SMTP_PASSWORD: "????"
---
apiVersion: v1
kind: Service
metadata:
name: odoo-web-service
namespace: odoo
spec:
type: ClusterIP
ports:
- name: web
port: 8069
protocol: TCP
targetPort: 8069
- name: longpolling
protocol: TCP
port: 8072
targetPort: 8072
selector:
app: odoo-web
apiVersion: v1
kind: PersistentVolume
metadata:
name: odoo-pv
spec:
storageClassName: ""
capacity:
storage: 100Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
claimRef:
name: odoo-pvc
nfs:
path: "????"
server: "????"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: odoo-pvc
spec:
storageClassName: ""
accessModes:
- ReadWriteMany
volumeName: odoo-pv
resources:
requests:
storage: 100Gi
apiVersion: apps/v1
kind: Deployment
metadata:
name: odoo-web
spec:
selector:
matchLabels:
app: odoo-web
template:
metadata:
labels:
app: odoo-web
spec:
imagePullSecrets:
- name: "????"
containers:
- name: odoo-web
image: "????"
imagePullPolicy: Always
env:
- name: PGHOST
valueFrom:
configMapKeyRef:
name: odoo-env
key: PGHOST
- name: PGPORT
valueFrom:
configMapKeyRef:
name: odoo-env
key: PGPORT
- name: PGUSER
valueFrom:
configMapKeyRef:
name: odoo-env
key: PGUSER
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: odoo-secret
key: PGPASSWORD
- name: ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: odoo-secret
key: ADMIN_PASSWORD
- name: PROXY_MODE
valueFrom:
configMapKeyRef:
name: odoo-env
key: PROXY_MODE
- name: WITHOUT_DEMO
valueFrom:
configMapKeyRef:
name: odoo-env
key: WITHOUT_DEMO
- name: LIST_DB
valueFrom:
configMapKeyRef:
name: odoo-env
key: LIST_DB
- name: SMTP_SERVER
valueFrom:
configMapKeyRef:
name: odoo-env
key: SMTP_SERVER
- name: SMTP_PORT
valueFrom:
configMapKeyRef:
name: odoo-env
key: SMTP_PORT
- name: SMTP_USER
valueFrom:
configMapKeyRef:
name: odoo-env
key: SMTP_USER
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: odoo-secret
key: SMTP_PASSWORD
- name: SMTP_SSL
valueFrom:
configMapKeyRef:
name: odoo-env
key: SMTP_SSL
- name: PGDATABASE
valueFrom:
configMapKeyRef:
name: odoo-env
key: PGDATABASE
volumeMounts:
- name: vol-odoo
mountPath: /var/lib/odoo
- name: vol-conf
mountPath: "/opt/odoo/custom/conf.d/"
readOnly: true
volumes:
- name: vol-odoo
persistentVolumeClaim:
claimName: odoo-pvc
- name: vol-conf
configMap:
name: odoo-conf
items:
- key: "web"
path: "61-web.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment