From 6d6d60a1e1935f6ea0a40960c4393011504025aa Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Fri, 20 Sep 2024 23:30:03 +0200 Subject: [PATCH] feat: add OpenShift definition for Valkey Signed-off-by: Matej Focko --- openshift/valkey.yml.j2 | 79 +++++++++++++++++++++++++++++++++++ vars/packit/prod_template.yml | 2 +- vars/packit/stg_template.yml | 2 +- 3 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 openshift/valkey.yml.j2 diff --git a/openshift/valkey.yml.j2 b/openshift/valkey.yml.j2 new file mode 100644 index 0000000..1deab4f --- /dev/null +++ b/openshift/valkey.yml.j2 @@ -0,0 +1,79 @@ +# Copyright Contributors to the Packit project. +# SPDX-License-Identifier: MIT + +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: valkey +spec: + selector: + matchLabels: + component: valkey + template: + metadata: + labels: + component: valkey +{% if managed_platform %} + paas.redhat.com/appcode: {{ appcode }} +{% endif %} + spec: + containers: + - name: valkey + image: valkey/valkey:8.0.0 + ports: + - containerPort: 6379 + volumeMounts: + - mountPath: /data + name: valkey-pv + resources: + # requests and limits have to be the same to have Guaranteed QoS + requests: + memory: "128Mi" + cpu: "10m" + limits: + memory: "256Mi" + cpu: "10m" + volumes: + - name: valkey-pv + persistentVolumeClaim: + claimName: valkey-pvc + replicas: 1 + strategy: + type: Recreate +--- +apiVersion: v1 +kind: Service +metadata: + name: valkey +{% if managed_platform %} + labels: + paas.redhat.com/appcode: {{ appcode }} +{% endif %} +spec: + ports: + - name: "6379" + port: 6379 + targetPort: 6379 + selector: + component: valkey +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: valkey-pvc +{% if managed_platform %} + labels: + paas.redhat.com/appcode: {{ appcode }} + annotations: + kubernetes.io/reclaimPolicy: Delete +{% endif %} +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +{% if managed_platform %} + storageClassName: aws-ebs +{% endif %} diff --git a/vars/packit/prod_template.yml b/vars/packit/prod_template.yml index e91ab23..c4ff4ba 100644 --- a/vars/packit/prod_template.yml +++ b/vars/packit/prod_template.yml @@ -32,7 +32,7 @@ api_key: "" # edit the queue name in secrets/*/fedora.toml # with_fedmsg: true -# kv_database: redict +# kv_database: valkey # with_kv_database: true # with_redis_commander: false diff --git a/vars/packit/stg_template.yml b/vars/packit/stg_template.yml index bc1b143..7040a1e 100644 --- a/vars/packit/stg_template.yml +++ b/vars/packit/stg_template.yml @@ -30,7 +30,7 @@ api_key: "" # edit the queue name in secrets/*/fedora.toml # with_fedmsg: true -# kv_database: redict +# kv_database: valkey # with_kv_database: true # with_redis_commander: false