2021-09-08 19:18:54 -04:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: PersistentVolumeClaim
|
|
|
|
metadata:
|
2023-11-17 11:16:31 -05:00
|
|
|
name: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
spec:
|
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 1Gi
|
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2023-11-17 11:16:31 -05:00
|
|
|
name: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
labels:
|
2023-11-17 11:16:31 -05:00
|
|
|
app: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
role: leader
|
|
|
|
tier: backend
|
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2023-11-17 11:16:31 -05:00
|
|
|
app: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2023-11-17 11:16:31 -05:00
|
|
|
app: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
role: leader
|
|
|
|
tier: backend
|
|
|
|
spec:
|
|
|
|
volumes:
|
|
|
|
- name: redis-storage
|
|
|
|
persistentVolumeClaim:
|
2023-11-17 11:16:31 -05:00
|
|
|
claimName: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
containers:
|
|
|
|
- name: leader
|
2023-12-10 07:32:50 -05:00
|
|
|
image: docker.io/redis:6.2.5-alpine
|
2021-09-08 19:18:54 -04:00
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
cpu: 100m
|
|
|
|
memory: 100Mi
|
|
|
|
ports:
|
|
|
|
- containerPort: 6379
|
|
|
|
volumeMounts:
|
2023-12-10 07:32:50 -05:00
|
|
|
- mountPath: /data
|
2021-09-08 19:18:54 -04:00
|
|
|
name: redis-storage
|
|
|
|
livenessProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: 6379
|
|
|
|
initialDelaySeconds: 15
|
|
|
|
readinessProbe:
|
|
|
|
exec:
|
|
|
|
command:
|
|
|
|
- redis-cli
|
|
|
|
- ping
|
|
|
|
initialDelaySeconds: 5
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2023-11-17 11:16:31 -05:00
|
|
|
name: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
labels:
|
2023-11-17 11:16:31 -05:00
|
|
|
app: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
role: leader
|
|
|
|
tier: backend
|
|
|
|
spec:
|
|
|
|
ports:
|
|
|
|
- port: 6379
|
|
|
|
targetPort: 6379
|
|
|
|
selector:
|
2023-11-17 11:16:31 -05:00
|
|
|
app: ots-redis
|
2021-09-08 19:18:54 -04:00
|
|
|
role: leader
|
|
|
|
tier: backend
|
2023-11-17 11:16:31 -05:00
|
|
|
---
|
2023-12-10 07:32:50 -05:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
2023-11-17 11:16:31 -05:00
|
|
|
metadata:
|
2023-12-10 07:32:50 -05:00
|
|
|
name: ots-customize
|
2023-11-17 11:16:31 -05:00
|
|
|
data:
|
|
|
|
customize.yml: |
|
|
|
|
appTitle: "My very customized OTS"
|
|
|
|
disableQRSupport: true
|
|
|
|
maxAttachmentSizeTotal: 1048576
|
|
|
|
maxSecretSize: 2097152
|
2021-09-08 19:18:54 -04:00
|
|
|
---
|
|
|
|
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:
|
2023-11-17 11:16:31 -05:00
|
|
|
volumes:
|
|
|
|
- name: custom
|
|
|
|
configMap:
|
|
|
|
name: ots-cutomize
|
2021-09-08 19:18:54 -04:00
|
|
|
containers:
|
|
|
|
- name: ots
|
2023-12-12 17:23:24 -05:00
|
|
|
image: luzifer/ots:v1.11.1
|
2023-12-10 07:32:50 -05:00
|
|
|
args:
|
|
|
|
- --storage-type
|
|
|
|
- redis
|
|
|
|
- --customize
|
|
|
|
- /custom/customize.yml
|
2021-09-08 19:18:54 -04:00
|
|
|
env:
|
|
|
|
- name: REDIS_URL
|
2023-12-10 07:32:50 -05:00
|
|
|
value: tcp://ots-redis:6379
|
2021-09-08 19:18:54 -04:00
|
|
|
- name: REDIS_KEY
|
2023-12-10 07:32:50 -05:00
|
|
|
value: ots
|
2021-09-08 19:18:54 -04:00
|
|
|
- name: SECRET_EXPIRY
|
|
|
|
value: "172800"
|
2023-11-17 11:16:31 -05:00
|
|
|
volumeMounts:
|
2023-12-10 07:32:50 -05:00
|
|
|
- mountPath: /custom
|
2023-11-17 11:16:31 -05:00
|
|
|
name: custom
|
2021-09-08 19:18:54 -04:00
|
|
|
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
|
2023-11-17 11:16:31 -05:00
|
|
|
secretName: ots-ingress-tls
|