mirror of
https://github.com/Luzifer/ots.git
synced 2024-10-01 01:06:09 -04:00
178 lines
3.3 KiB
YAML
178 lines
3.3 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: ots-redis
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ots-redis
|
|
labels:
|
|
app: ots-redis
|
|
role: leader
|
|
tier: backend
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: ots-redis
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ots-redis
|
|
role: leader
|
|
tier: backend
|
|
spec:
|
|
volumes:
|
|
- name: redis-storage
|
|
persistentVolumeClaim:
|
|
claimName: ots-redis
|
|
containers:
|
|
- name: leader
|
|
image: "docker.io/redis:6.2.5-alpine"
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 100Mi
|
|
ports:
|
|
- containerPort: 6379
|
|
volumeMounts:
|
|
- mountPath: "/data"
|
|
name: redis-storage
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 6379
|
|
initialDelaySeconds: 15
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- redis-cli
|
|
- ping
|
|
initialDelaySeconds: 5
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ots-redis
|
|
labels:
|
|
app: ots-redis
|
|
role: leader
|
|
tier: backend
|
|
spec:
|
|
ports:
|
|
- port: 6379
|
|
targetPort: 6379
|
|
selector:
|
|
app: ots-redis
|
|
role: leader
|
|
tier: backend
|
|
|
|
---
|
|
apiVersion: "v1"
|
|
kind: "ConfigMap"
|
|
metadata:
|
|
name: "ots-customize"
|
|
data:
|
|
customize.yml: |
|
|
appTitle: "My very customized OTS"
|
|
disableQRSupport: true
|
|
maxAttachmentSizeTotal: 1048576
|
|
maxSecretSize: 2097152
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ots
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: ots
|
|
tier: frontend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: ots
|
|
tier: frontend
|
|
spec:
|
|
volumes:
|
|
- name: custom
|
|
configMap:
|
|
name: ots-cutomize
|
|
containers:
|
|
- name: ots
|
|
image: "luzifer/ots:v1.10.0"
|
|
args: ["--storage-type", "redis", "--customize", "/custom/customize.yml"]
|
|
env:
|
|
- name: REDIS_URL
|
|
value: "tcp://ots-redis:6379"
|
|
- name: REDIS_KEY
|
|
value: "ots"
|
|
- name: SECRET_EXPIRY
|
|
value: "172800"
|
|
volumeMounts:
|
|
- mountPath: "/custom"
|
|
name: custom
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 100Mi
|
|
ports:
|
|
- containerPort: 3000
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
initialDelaySeconds: 5
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ots
|
|
labels:
|
|
app: ots
|
|
tier: frontend
|
|
spec:
|
|
ports:
|
|
- port: 3000
|
|
targetPort: 3000
|
|
selector:
|
|
app: ots
|
|
tier: frontend
|
|
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: ots
|
|
annotations:
|
|
kubernetes.io/ingress.class: nginx
|
|
kubernetes.io/tls-acme: "true"
|
|
spec:
|
|
rules:
|
|
- host: ots.example.com
|
|
http:
|
|
paths:
|
|
- backend:
|
|
service:
|
|
name: ots
|
|
port:
|
|
number: 3000
|
|
path: /
|
|
pathType: ImplementationSpecific
|
|
tls:
|
|
- hosts:
|
|
- ots.example.com
|
|
secretName: ots-ingress-tls
|