valkey initial
This commit is contained in:
168
valkey/main.yaml
Normal file
168
valkey/main.yaml
Normal file
@@ -0,0 +1,168 @@
|
||||
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.3
|
||||
helm.sh/chart: valkey-0.7.4
|
||||
name: valkey
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
init.sh: "#!/bin/bash\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.3
|
||||
helm.sh/chart: valkey-0.7.4
|
||||
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.3
|
||||
helm.sh/chart: valkey-0.7.4
|
||||
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.3
|
||||
helm.sh/chart: valkey-0.7.4
|
||||
name: valkey
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 8
|
||||
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.3
|
||||
helm.sh/chart: valkey-0.7.4
|
||||
name: valkey
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: valkey
|
||||
app.kubernetes.io/name: valkey
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/instance: valkey
|
||||
app.kubernetes.io/name: valkey
|
||||
checksum/initconfig: 4ca0bfa021f2da0c4554a57544b03cfc
|
||||
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.3
|
||||
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
|
||||
initContainers:
|
||||
- command:
|
||||
- /scripts/init.sh
|
||||
image: docker.io/valkey/valkey:8.1.3
|
||||
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
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
runAsGroup: 1000
|
||||
runAsUser: 1000
|
||||
serviceAccountName: valkey
|
||||
volumes:
|
||||
- configMap:
|
||||
defaultMode: 365
|
||||
name: valkey-init-scripts
|
||||
name: scripts
|
||||
- name: valkey-data
|
||||
persistentVolumeClaim:
|
||||
claimName: valkey
|
||||
Reference in New Issue
Block a user