Skip to content
25 changes: 25 additions & 0 deletions manifests/centurion_erp/base/00.settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
DEBUG = False

# FEATURE_FLAG_OVERRIDES = [
# {'disable_downloading': False},
# ]

METRICS_ENABLED = False
# PROMETHEUS_EXPORT_MIGRATIONS = True

AUTH_PASSWORD_VALIDATORS = []

SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
SECURE_SSL_REDIRECT = True

USE_X_FORWARDED_HOST = True

LOG_FILES = {
"catch_all":"/var/log/catch-all.log",
"centurion_trace": "/var/log/trace.log",
"centurion": "/var/log/centurion.log",
"error": "/var/log/error.log",
"gunicorn": "/var/log/gunicorn.log",
"rest_api": "/var/log/rest_api.log",
"weblog": "/var/log/weblog.log",
}
2 changes: 2 additions & 0 deletions manifests/centurion_erp/base/10.celery-broker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# amqp://<username>:<password>@<rabbitmq cluster dns name>/<exchange name>
CELERY_BROKER_URL = ''
2 changes: 2 additions & 0 deletions manifests/centurion_erp/base/15.ui-redirect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "login"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure lf at end file

11 changes: 11 additions & 0 deletions manifests/centurion_erp/base/20.database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DATABASES = {
'default': {
'ENGINE': 'django_prometheus.db.backends.postgresql',
'NAME': 'centurion', # Database name
'USER': '', # PostgreSQL username
'PASSWORD': '', # PostgreSQL password
'HOST': '', # Database server
'PORT': '', # Database port (leave blank for default)
'CONN_MAX_AGE': 300, # Max database connection age
}
}
14 changes: 14 additions & 0 deletions manifests/centurion_erp/base/80.csrf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SITE_URL = 'https://<domain.tld>'

TRUSTED_ORIGINS = [
'https://<domain.tld>',
'https://<sub-domain.domain.tld>',
]

# SSL
SECURE_SSL_HOST = '<domain.tld>'
SECURE_SSL_REDIRECT = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")

USE_X_FORWARDED_HOST = True
SESSION_COOKIE_SECURE = True
2 changes: 2 additions & 0 deletions manifests/centurion_erp/base/90.secret_key.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Add your secret key here
SECRET_KEY = ''
114 changes: 114 additions & 0 deletions manifests/centurion_erp/base/Deployment-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: centurion
app.kubernetes.io/part-of: centurion-erp
name: api
spec:
selector:
matchLabels:
app.kubernetes.io/name: centurion
app.kubernetes.io/part-of: centurion-erp
replicas: 1
minReadySeconds: 10
template:
metadata:
labels:
app.kubernetes.io/name: centurion
app.kubernetes.io/part-of: centurion-erp
spec:
terminationGracePeriodSeconds: 10
affinity: {}
containers:

- name: web
image: nofusscomputing/centurion-erp:dev
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 400m
memory: 800Mi

ports:
- containerPort: 8000
name: api

volumeMounts:

- name: configuration
mountPath: /etc/itsm
readOnly: true

- name: data
mountPath: /data
subPath: data

- mountPath: /var/log
name: logs

- mountPath: /tmp
name: tmp
subPath: tmp


- name: ui
image: nofusscomputing/centurion-erp-ui:dev
env: []
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 10m
memory: 20Mi

ports:
- containerPort: 80
name: ui

volumeMounts: []

tolerations: []
volumes:

- name: configuration
projected:
sources:
- configMap:
name: configuration
items:
- key: 00.settings.py
path: 00.settings.py
- key: 15.ui-redirect.py
path: 15.ui-redirect.py
- key: 80.csrf.py
path: 80.csrf.py
- secret:
name: celery-broker
items:
- key: 10.celery-broker.py
path: 10.celery-broker.py
- secret:
name: database
items:
- key: 20.database.py
path: 20.database.py

- name: data
persistentVolumeClaim:
claimName: centurion

- name: logs
hostPath:
path: /opt/logs/centurion-api
type: DirectoryOrCreate

- name: tmp
emptyDir:
medium: Memory
# sizeLimit: 64Mi
86 changes: 86 additions & 0 deletions manifests/centurion_erp/base/Deployment-worker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: worker
app.kubernetes.io/part-of: centurion-erp
name: worker
spec:
selector:
matchLabels:
app.kubernetes.io/name: worker
app.kubernetes.io/part-of: centurion-erp
replicas: 1
minReadySeconds: 10
template:
metadata:
labels:
app.kubernetes.io/name: worker
app.kubernetes.io/part-of: centurion-erp
spec:
terminationGracePeriodSeconds: 10
affinity: {}
containers:
- name: worker
image: nofusscomputing/centurion-erp:dev
env:
- name: IS_WORKER
value: "true"
resources:
limits:
cpu: 800m
memory: 200Mi
requests:
cpu: 10m
memory: 20Mi

ports:
- containerPort: 8080
name: metrics

volumeMounts:

- name: configuration
mountPath: /etc/itsm
readOnly: true

- mountPath: /var/log
name: logs

- mountPath: /tmp
name: tmp
subPath: tmp

tolerations: []
volumes:

- name: configuration
projected:
sources:
- configMap:
name: configuration
items:
- key: 00.settings.py
path: 00.settings.py
- secret:
name: celery-broker
items:
- key: 10.celery-broker.py
path: 10.celery-broker.py
- secret:
name: database
items:
- key: 20.database.py
path: 20.database.py

- name: logs
hostPath:
path: /opt/logs/centurion-worker
type: DirectoryOrCreate

- name: tmp
emptyDir:
medium: Memory
# sizeLimit: 64Mi
15 changes: 15 additions & 0 deletions manifests/centurion_erp/base/PVC-centurion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: centurion
app.kubernetes.io/part-of: centurion-erp
name: centurion
spec:
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
19 changes: 19 additions & 0 deletions manifests/centurion_erp/base/Service-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Service
metadata:
name: centurion
labels:
app.kubernetes.io/name: centurion
app.kubernetes.io/part-of: centurion-erp
spec:
selector:
app.kubernetes.io/name: centurion
app.kubernetes.io/part-of: centurion-erp
ports:
- name: api
port: 8000
targetPort: api
- name: ui
port: 80
targetPort: ui
52 changes: 52 additions & 0 deletions manifests/centurion_erp/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

configMapGenerator:
- name: configuration
files:
- 00.settings.py
- 15.ui-redirect.py
- 80.csrf.py

generatorOptions:
disableNameSuffixHash: true

# patches:
# - patch: |-
# apiVersion: apps/v1
# kind: Deployment
# metadata:
# name: api
# spec:
# template:
# spec:
# containers:
# - name: ui
# env:
# - name: API_URL
# value: https://<domain.tld>/api/v2

# target:
# kind: Deployment
# name: api
# version: v1

resources:
- PVC-centurion.yaml
- Deployment-api.yaml
- Deployment-worker.yaml
- Service-api.yaml

secretGenerator:
- name: secret-key
files:
- 90.secret_key.py

- name: celery-broker
files:
- 10.celery-broker.py

- name: database
files:
- 20.database.py
Loading
Loading