forgejo: update storageclass for valkey

updating valkey configuration/deploy

Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
David Kirwan 2025-05-07 14:39:46 +01:00
parent 0b774e7106
commit 646a938dbe
No known key found for this signature in database
GPG key ID: A5893AB6474AC37D
5 changed files with 2 additions and 106 deletions

View file

@ -37,25 +37,6 @@
- valkey
- name: Create the valkey sentinel service template
ansible.builtin.template:
src: "valkey-sentinel-service.yaml.j2"
dest: "/root/ocp4/openshift-apps/forgejo/valkey-sentinel-service.yaml"
mode: "0770"
tags:
- valkey
# apply created openshift resources
- name: Oc apply resources
ansible.builtin.command: "/root/bin/oc apply -f /root/ocp4/openshift-apps/forgejo/valkey-sentinel-service.yaml"
retries: 3
delay: 5
register: deployment_result
until: deployment_result.rc == 0
tags:
- valkey
- name: Create the valkey statefulset template
ansible.builtin.template:
src: "valkey-statefulset.yaml.j2"
@ -74,21 +55,3 @@
tags:
- valkey
- name: Create the valkey sentinel statefulset template
ansible.builtin.template:
src: "valkey-sentinel-statefulset.yaml.j2"
dest: "/root/ocp4/openshift-apps/forgejo/valkey-sentinel-statefulset.yaml"
mode: "0770"
tags:
- valkey
# apply created openshift resources
- name: Oc apply resources
ansible.builtin.command: "/root/bin/oc apply -f /root/ocp4/openshift-apps/forgejo/valkey-sentinel-statefulset.yaml"
retries: 3
delay: 5
register: deployment_result
until: deployment_result.rc == 0
tags:
- valkey

View file

@ -8,6 +8,7 @@ data:
valkey.conf: |
bind 0.0.0.0
port 6379
cluster-enabled yes
requirepass valkeypassword
masterauth valkeypassword
protected-mode no
@ -17,13 +18,3 @@ data:
save 300 10
save 60 10000
logfile /data/valkey.log
sentinel.conf: |
port 26379
dir /data
logfile /data/sentinel.log
protected-mode no
sentinel monitor mymaster valkey-0.valkey-headless.default.svc.cluster.local 6379 2
sentinel auth-pass mymaster valkeypassword
sentinel down-after-milliseconds mymaster 5000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 180000

View file

@ -1,14 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: sentinel-headless
namespace: forgejo
spec:
clusterIP: None # Headless Service
selector:
app: sentinel
ports:
- name: sentinel
port: 26379
targetPort: 26379

View file

@ -1,44 +0,0 @@
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: sentinel
namespace: forgejo
spec:
serviceName: sentinel-headless
replicas: 3
selector:
matchLabels:
app: sentinel
template:
metadata:
labels:
app: sentinel
spec:
containers:
- name: sentinel
image: valkey/valkey:7.2.5
command: ["valkey-sentinel"]
args: ["/etc/valkey/sentinel.conf"]
ports:
- containerPort: 26379
name: sentinel
volumeMounts:
- name: config
mountPath: /etc/valkey/sentinel.conf
subPath: sentinel.conf
- name: data
mountPath: /data
volumes:
- name: config
configMap:
name: valkey-config
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: standard
resources:
requests:
storage: 100Mi

View file

@ -37,7 +37,7 @@ spec:
name: data
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: standard
storageClassName: ocs-storagecluster-ceph-rbd
resources:
requests:
storage: 1Gi