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