197 lines
5.5 KiB
YAML
197 lines
5.5 KiB
YAML
apiVersion: v1
|
|
automountServiceAccountToken: false
|
|
kind: ServiceAccount
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: valkey
|
|
app.kubernetes.io/version: 8.1.4
|
|
helm.sh/chart: valkey-0.7.7
|
|
name: valkey
|
|
---
|
|
apiVersion: v1
|
|
data:
|
|
valkey.conf: |
|
|
include /run/secrets/valkey/requirepass
|
|
kind: ConfigMap
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: valkey
|
|
app.kubernetes.io/version: 8.1.4
|
|
helm.sh/chart: valkey-0.7.7
|
|
name: valkey-config
|
|
---
|
|
apiVersion: v1
|
|
data:
|
|
init.sh: "#!/bin/sh\nset -euo pipefail\n\n# Default config paths\nVALKEY_CONFIG=${VALKEY_CONFIG_PATH:-/data/conf/valkey.conf}\n\nLOGFILE=\"/data/init.log\"\nDATA_DIR=\"/data/conf\"\n\n#
|
|
Logging function\nlog() {\n echo \"$(date) $1\" | tee -a \"$LOGFILE\"\n}\n\n#
|
|
Clean old log if requested\nif [ \"${KEEP_OLD_LOGS:-false}\" != \"true\" ]; then\n
|
|
\ rm -f \"$LOGFILE\"\nfi\n\nif [ -f \"$LOGFILE\" ]; then\n log \"Detected restart
|
|
of this instance ($HOSTNAME)\"\nfi\n\nlog \"Creating configuration in $DATA_DIR...\"\nmkdir
|
|
-p \"$DATA_DIR\"\nrm -f \"$VALKEY_CONFIG\" \n\n\n# Base valkey.conf\nlog \"Generating
|
|
base valkey.conf\"\n{\n echo \"port 6379\"\n echo \"protected-mode no\"\n echo
|
|
\"bind 0.0.0.0\"\n echo \"dir /data\"\n} >>\"$VALKEY_CONFIG\"\n\n# Append extra
|
|
configs if present\nif [ -f /usr/local/etc/valkey/valkey.conf ]; then\n log \"Appending
|
|
/usr/local/etc/valkey/valkey.conf\"\n cat /usr/local/etc/valkey/valkey.conf >>\"$VALKEY_CONFIG\"\nfi\nif
|
|
[ -d /extravalkeyconfigs ]; then\n log \"Appending files in /extravalkeyconfigs/\"\n
|
|
\ cat /extravalkeyconfigs/* >>\"$VALKEY_CONFIG\"\nfi"
|
|
kind: ConfigMap
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: valkey
|
|
app.kubernetes.io/version: 8.1.4
|
|
helm.sh/chart: valkey-0.7.7
|
|
name: valkey-init-scripts
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: valkey
|
|
app.kubernetes.io/version: 8.1.4
|
|
helm.sh/chart: valkey-0.7.7
|
|
name: valkey
|
|
spec:
|
|
ports:
|
|
- name: tcp
|
|
port: 6379
|
|
protocol: TCP
|
|
targetPort: tcp
|
|
selector:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/name: valkey
|
|
type: ClusterIP
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: valkey
|
|
app.kubernetes.io/version: 8.1.4
|
|
helm.sh/chart: valkey-0.7.7
|
|
name: valkey
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 8Gi
|
|
storageClassName: openebs-3-replicas
|
|
volumeMode: Filesystem
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: valkey
|
|
app.kubernetes.io/version: 8.1.4
|
|
helm.sh/chart: valkey-0.7.7
|
|
name: valkey
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/name: valkey
|
|
strategy:
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: valkey
|
|
app.kubernetes.io/name: valkey
|
|
checksum/initconfig: 8c2eef07ad2fb92d71b03c260963d0b0
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
containers:
|
|
- args:
|
|
- /data/conf/valkey.conf
|
|
command:
|
|
- valkey-server
|
|
env:
|
|
- name: VALKEY_LOGLEVEL
|
|
value: notice
|
|
image: docker.io/valkey/valkey:8.1.4
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- valkey-cli ping
|
|
name: valkey
|
|
ports:
|
|
- containerPort: 6379
|
|
name: tcp
|
|
protocol: TCP
|
|
resources: {}
|
|
securityContext:
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: true
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
startupProbe:
|
|
exec:
|
|
command:
|
|
- sh
|
|
- -c
|
|
- valkey-cli ping
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: valkey-data
|
|
- mountPath: /run/secrets/valkey
|
|
name: valkey-pass-valkey
|
|
initContainers:
|
|
- command:
|
|
- /scripts/init.sh
|
|
image: docker.io/valkey/valkey:8.1.4
|
|
imagePullPolicy: IfNotPresent
|
|
name: valkey-init
|
|
securityContext:
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: true
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: valkey-data
|
|
- mountPath: /scripts
|
|
name: scripts
|
|
- mountPath: /usr/local/etc/valkey/valkey.conf
|
|
name: valkey-config
|
|
subPath: valkey.conf
|
|
securityContext:
|
|
fsGroup: 1000
|
|
runAsGroup: 1000
|
|
runAsUser: 1000
|
|
serviceAccountName: valkey
|
|
volumes:
|
|
- configMap:
|
|
defaultMode: 365
|
|
name: valkey-init-scripts
|
|
name: scripts
|
|
- configMap:
|
|
name: valkey-config
|
|
name: valkey-config
|
|
- name: valkey-pass-valkey
|
|
secret:
|
|
defaultMode: 288
|
|
secretName: valkey-pass
|
|
- name: valkey-data
|
|
persistentVolumeClaim:
|
|
claimName: valkey
|