Update K8s example and include customize.yaml (#147)

This commit is contained in:
Vic Demuzere 2023-11-17 17:16:31 +01:00 committed by GitHub
parent a71563b19b
commit 3a4e2a58bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,8 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: ots
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis
namespace: ots
name: ots-redis
spec:
accessModes:
- ReadWriteOnce
@ -21,28 +14,27 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: ots
name: ots-redis
labels:
app: redis
app: ots-redis
role: leader
tier: backend
spec:
replicas: 1
selector:
matchLabels:
app: redis
app: ots-redis
template:
metadata:
labels:
app: redis
app: ots-redis
role: leader
tier: backend
spec:
volumes:
- name: redis-storage
persistentVolumeClaim:
claimName: redis
claimName: ots-redis
containers:
- name: leader
image: "docker.io/redis:6.2.5-alpine"
@ -70,10 +62,9 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: ots
name: ots-redis
labels:
app: redis
app: ots-redis
role: leader
tier: backend
spec:
@ -81,16 +72,27 @@ spec:
- port: 6379
targetPort: 6379
selector:
app: redis
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
namespace: ots
spec:
replicas: 2
selector:
@ -103,17 +105,24 @@ spec:
app: ots
tier: frontend
spec:
volumes:
- name: custom
configMap:
name: ots-cutomize
containers:
- name: ots
image: "luzifer/ots:v0.19.0"
args: ["--storage-type", "redis"]
image: "luzifer/ots:v1.10.0"
args: ["--storage-type", "redis", "--customize", "/custom/customize.yml"]
env:
- name: REDIS_URL
value: "tcp://redis.ots.svc.cluster.local:6379"
value: "tcp://ots-redis:6379"
- name: REDIS_KEY
value: "ots"
- name: SECRET_EXPIRY
value: "172800"
volumeMounts:
- mountPath: "/custom"
name: custom
resources:
requests:
cpu: 100m
@ -131,7 +140,6 @@ apiVersion: v1
kind: Service
metadata:
name: ots
namespace: ots
labels:
app: ots
tier: frontend
@ -148,7 +156,6 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ots
namespace: ots
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
@ -167,4 +174,4 @@ spec:
tls:
- hosts:
- ots.example.com
secretName: ingress-tls
secretName: ots-ingress-tls