ots/docs/k8s_example.yml

176 lines
3.4 KiB
YAML
Raw Permalink Normal View History

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