From 3a4e2a58bb40398b291dfed12f468d591b35e4cd Mon Sep 17 00:00:00 2001 From: Vic Demuzere <65006+sorcix@users.noreply.github.com> Date: Fri, 17 Nov 2023 17:16:31 +0100 Subject: [PATCH] Update K8s example and include customize.yaml (#147) --- docs/k8s_example.yml | 57 +++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/docs/k8s_example.yml b/docs/k8s_example.yml index 063031e..32623d6 100644 --- a/docs/k8s_example.yml +++ b/docs/k8s_example.yml @@ -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