50 lines
1.0 KiB
YAML
50 lines
1.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: redis
|
|
labels:
|
|
app.kubernetes.io/name: redis
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: redis
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: redis
|
|
spec:
|
|
containers:
|
|
- name: redis
|
|
image: redis
|
|
args: ["--appendonly", "yes", "--requirepass", "$(REDIS_PASSWORD)"]
|
|
env:
|
|
- name: REDIS_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: redis-credentials
|
|
key: password
|
|
ports:
|
|
- name: redis
|
|
containerPort: 6379
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 500Mi
|
|
limits:
|
|
cpu: 1000m
|
|
memory: 1Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: redis
|
|
labels:
|
|
app.kubernetes.io/name: redis
|
|
spec:
|
|
selector:
|
|
app.kubernetes.io/name: redis
|
|
ports:
|
|
- name: redis
|
|
port: 6379
|
|
targetPort: redis |