67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: redis
|
||
|
|
namespace: iloom
|
||
|
|
spec:
|
||
|
|
clusterIP: None
|
||
|
|
ports:
|
||
|
|
- port: 6379
|
||
|
|
targetPort: 6379
|
||
|
|
selector:
|
||
|
|
app: redis
|
||
|
|
---
|
||
|
|
apiVersion: apps/v1
|
||
|
|
kind: StatefulSet
|
||
|
|
metadata:
|
||
|
|
name: redis
|
||
|
|
namespace: iloom
|
||
|
|
spec:
|
||
|
|
serviceName: redis
|
||
|
|
replicas: 1
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app: redis
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app: redis
|
||
|
|
spec:
|
||
|
|
imagePullSecrets:
|
||
|
|
- name: harbor-pull-secret
|
||
|
|
containers:
|
||
|
|
- name: redis
|
||
|
|
image: harbor-in-k3s.cheverjohn.me/iloom/redis:7-alpine
|
||
|
|
ports:
|
||
|
|
- containerPort: 6379
|
||
|
|
command: ["redis-server", "--appendonly", "yes"]
|
||
|
|
volumeMounts:
|
||
|
|
- name: redis-data
|
||
|
|
mountPath: /data
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
cpu: 100m
|
||
|
|
memory: 128Mi
|
||
|
|
limits:
|
||
|
|
cpu: 500m
|
||
|
|
memory: 256Mi
|
||
|
|
readinessProbe:
|
||
|
|
exec:
|
||
|
|
command: ["redis-cli", "ping"]
|
||
|
|
initialDelaySeconds: 5
|
||
|
|
periodSeconds: 10
|
||
|
|
livenessProbe:
|
||
|
|
exec:
|
||
|
|
command: ["redis-cli", "ping"]
|
||
|
|
initialDelaySeconds: 15
|
||
|
|
periodSeconds: 30
|
||
|
|
volumeClaimTemplates:
|
||
|
|
- metadata:
|
||
|
|
name: redis-data
|
||
|
|
spec:
|
||
|
|
accessModes: ["ReadWriteOnce"]
|
||
|
|
storageClassName: longhorn
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
storage: 2Gi
|