Skip to content

Commit 23e00da

Browse files
committed
chore(valkey): use valkey replace redis
1 parent 234cb2b commit 23e00da

12 files changed

Lines changed: 81 additions & 58 deletions

File tree

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Some uses for short name:
33
# - Container image name
44
# - Kubernetes service, rc, pod, secret, volume names
5-
SHORT_NAME := redis
5+
SHORT_NAME := valkey
66
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
77
IMAGE_PREFIX ?= drycc
88
PLATFORM ?= linux/amd64,linux/arm64
@@ -29,7 +29,8 @@ podman-build:
2929
podman build --build-arg CODENAME=${CODENAME} -t ${IMAGE} rootfs
3030
podman tag ${IMAGE} ${MUTABLE_IMAGE}
3131

32-
test: test-style
32+
test: podman-build test-style
33+
./_test/test.sh ${VERSION}
3334

3435
test-style:
3536
${DEV_ENV_CMD} shellcheck $(SHELL_SCRIPTS)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Drycc Redis
2-
[![Build Status](https://woodpecker.drycc.cc/api/badges/drycc/redis/status.svg)](https://woodpecker.drycc.cc/drycc/redis)
1+
# Drycc Valkey
2+
[![Build Status](https://woodpecker.drycc.cc/api/badges/drycc/valkey/status.svg)](https://woodpecker.drycc.cc/drycc/valkey)
33

44
Drycc (pronounced DAY-iss) Workflow is an open source Platform as a Service (PaaS) that adds a developer-friendly layer to any [Kubernetes](http://kubernetes.io) cluster, making it easy to deploy and manage applications on your own servers.
55

66
## Description
7-
A Container image for running standalone (not clustered) Redis on a Kubernetes cluster.
7+
A Container image for running standalone (not clustered) Valkey on a Kubernetes cluster.
88

99
[v2.18]: https://github.com/drycc/workflow/releases/tag/v2.18.0

_test/test.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
VERSION="$1"
4+
CONTAINER_NAME="valkey-benchmark"
5+
6+
function clean_before_exit {
7+
# delay before exiting, so stdout/stderr flushes through the logging system
8+
clean-valkey
9+
}
10+
trap clean_before_exit EXIT
11+
12+
start-valkey() {
13+
podman run -d --name "$CONTAINER_NAME" --rm registry.drycc.cc/drycc/valkey:$VERSION
14+
}
15+
16+
clean-valkey() {
17+
podman rm -f "$CONTAINER_NAME"
18+
}
19+
20+
clean-valkey
21+
start-valkey
22+
podman exec "$CONTAINER_NAME" /opt/drycc/valkey/bin/valkey-benchmark

charts/redis/templates/redis-secret-creds.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: redis
2-
home: https://github.com/drycc/redis
1+
name: valkey
2+
home: https://github.com/drycc/valkey
33
apiVersion: v2
44
appVersion: 1.0.0
55
dependencies:
66
- name: common
77
repository: oci://registry.drycc.cc/charts
88
version: ~1.1.2
9-
description: A Redis database for use inside a Kubernetes cluster.
9+
description: A Valkey database for use inside a Kubernetes cluster.
1010
maintainers:
1111
- name: Drycc Team
1212
email: engineering@drycc.com
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: valkey-creds
5+
labels:
6+
app: drycc-valkey
7+
heritage: drycc
8+
data:
9+
{{ if eq .Values.global.valkeyLocation "on-cluster"}}
10+
{{- $valkeyAddrs := (list ) }}
11+
{{- $valkeyNodeCount := .Values.replicas | int }}
12+
{{- range $i := until $valkeyNodeCount }}
13+
{{- $valkeyAddrs = (append $valkeyAddrs (printf "drycc-valkey-%d.drycc-valkey.%s.svc.%s:6379" $i $.Release.Namespace $.Values.global.clusterDomain)) }}
14+
{{- end -}}
15+
addrs: {{ join "," $valkeyAddrs | b64enc }}
16+
password: {{ include "common.secrets.lookup" (dict "secret" "valkey-creds" "key" "password" "defaultValue" (randAlphaNum 32) "context" $) }}
17+
{{ else if eq .Values.global.valkeyLocation "off-cluster"}}
18+
addrs: {{ .Values.addrs | b64enc }}
19+
password: {{ .Values.password | b64enc }}
20+
{{ end }}

charts/redis/templates/redis-statefulset.yaml renamed to charts/valkey/templates/valkey-statefulset.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
{{- if eq .Values.global.redisLocation "on-cluster" }}
1+
{{- if eq .Values.global.valkeyLocation "on-cluster" }}
22
apiVersion: apps/v1
33
kind: StatefulSet
44
metadata:
5-
name: drycc-redis
5+
name: drycc-valkey
66
labels:
77
heritage: drycc
88
annotations:
99
component.drycc.cc/version: {{ .Values.imageTag }}
1010
spec:
11-
serviceName: drycc-redis
11+
serviceName: drycc-valkey
1212
replicas: {{ .Values.replicas }}
1313
selector:
1414
matchLabels:
15-
app: drycc-redis
15+
app: drycc-valkey
1616
template:
1717
metadata:
1818
labels: {{- include "common.labels.standard" . | nindent 8 }}
19-
app: drycc-redis
19+
app: drycc-valkey
2020
spec:
2121
affinity:
2222
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset.type "component" "" "extraMatchLabels" .Values.podAffinityPreset.extraMatchLabels "topologyKey" "" "context" $) | nindent 10 }}
2323
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset.type "component" "" "extraMatchLabels" .Values.podAntiAffinityPreset.extraMatchLabels "topologyKey" "" "context" $) | nindent 10 }}
2424
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values ) | nindent 10 }}
2525
containers:
26-
- name: drycc-redis
27-
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/redis:{{ .Values.imageTag }}
26+
- name: drycc-valkey
27+
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/valkey:{{ .Values.imageTag }}
2828
imagePullPolicy: {{ .Values.imagePullPolicy }}
2929
{{- if or (.Values.limitsCpu) (.Values.limitsMemory)}}
3030
resources:
@@ -48,14 +48,14 @@ spec:
4848
ports:
4949
- containerPort: 6379
5050
env:
51-
- name: DRYCC_REDIS_PASSWORD
51+
- name: DRYCC_VALKEY_PASSWORD
5252
valueFrom:
5353
secretKeyRef:
54-
name: redis-creds
54+
name: valkey-creds
5555
key: password
5656
{{- if .Values.persistence.enabled }}
5757
volumeMounts:
58-
- name: redis-data
58+
- name: valkey-data
5959
mountPath: /data
6060
{{- end }}
6161
securityContext:
@@ -65,7 +65,7 @@ spec:
6565
{{- if .Values.persistence.enabled }}
6666
volumeClaimTemplates:
6767
- metadata:
68-
name: redis-data
68+
name: valkey-data
6969
spec:
7070
accessModes: [ "ReadWriteOnce" ]
7171
{{- if .Values.persistence.storageClass }}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
{{- if eq .Values.global.redisLocation "on-cluster" }}
1+
{{- if eq .Values.global.valkeyLocation "on-cluster" }}
22
apiVersion: v1
33
kind: Service
44
metadata:
5-
name: drycc-redis
5+
name: drycc-valkey
66
annotations:
77
{{- with .Values.service.annotations }}
88
{{- toYaml . | nindent 4 }}
@@ -12,5 +12,5 @@ metadata:
1212
spec:
1313
clusterIP: None
1414
selector:
15-
app: drycc-redis
15+
app: drycc-valkey
1616
{{- end }}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ podAffinityPreset:
3434
podAntiAffinityPreset:
3535
type: "soft"
3636
extraMatchLabels:
37-
app: "drycc-redis"
37+
app: "drycc-valkey"
3838

39-
# The following parameters are configured only when using an on-cluster Redis instance
39+
# The following parameters are configured only when using an on-cluster Valkey instance
4040
replicas: 1
4141

42-
# The following parameters are configured only when using an off-cluster Redis instance
42+
# The following parameters are configured only when using an off-cluster Valkey instance
4343
addrs: "" # A list of clusters: "127.0.0.1:7001/1,127.0.0.2:7002/1"
44-
password: "redis password" # "" == no password
44+
password: "valkey password" # "" == no password
4545

4646
# Service
4747
service:
@@ -55,9 +55,9 @@ persistence:
5555
storageClass: ""
5656

5757
global:
58-
# Set the location of Workflow's redis instance
58+
# Set the location of Workflow's valkey instance
5959
#
6060
# Valid values are:
61-
# - on-cluster: Run Redis within the Kubernetes cluster
62-
# - off-cluster: Run Redis outside the Kubernetes cluster (configure in redis section)
63-
redisLocation: "on-cluster"
61+
# - on-cluster: Run Valkey within the Kubernetes cluster
62+
# - off-cluster: Run Valkey outside the Kubernetes cluster (configure in valkey section)
63+
valkeyLocation: "on-cluster"

rootfs/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ FROM registry.drycc.cc/drycc/base:${CODENAME}
44
ENV DRYCC_UID=1001 \
55
DRYCC_GID=1001 \
66
DRYCC_HOME_DIR=/data \
7-
REDIS_VERSION="7.0.11"
7+
VALKEY_VERSION="8.0.1"
88

99
RUN groupadd drycc --gid ${DRYCC_GID} \
1010
&& useradd drycc -u ${DRYCC_UID} -g ${DRYCC_GID} -s /bin/bash -m -d ${DRYCC_HOME_DIR}
1111

1212
COPY bin/boot /bin/boot
13-
COPY etc/redis/redis.conf /etc/redis/redis.conf
13+
COPY etc/valkey/valkey.conf /etc/valkey/valkey.conf
1414

15-
RUN install-stack redis ${REDIS_VERSION} \
15+
RUN install-stack valkey ${VALKEY_VERSION} \
1616
&& rm -rf \
1717
/usr/share/doc \
1818
/usr/share/man \
@@ -27,7 +27,7 @@ RUN install-stack redis ${REDIS_VERSION} \
2727
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \
2828
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \
2929
&& mkdir -p /usr/share/man/man{1..8} \
30-
&& chown -R ${DRYCC_UID}:${DRYCC_GID} /etc/redis ${DRYCC_HOME_DIR}
30+
&& chown -R ${DRYCC_UID}:${DRYCC_GID} /etc/valkey ${DRYCC_HOME_DIR}
3131

3232
USER ${DRYCC_UID}
3333
WORKDIR ${DRYCC_HOME_DIR}

0 commit comments

Comments
 (0)