kube/shared/redis-noauth.yml

45 lines
801 B
YAML
Raw Normal View History

2022-08-16 09:40:54 +00:00
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
spec:
serviceName: redis
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:alpine
ports:
- containerPort: 6379
name: client
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 999
command: ["redis-server", "--save"]
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
---
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
type: ClusterIP
ports:
- port: 6379
targetPort: 6379
name: client
selector:
app: redis