46 lines
768 B
YAML
46 lines
768 B
YAML
|
---
|
||
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: redis
|
||
|
namespace: database
|
||
|
spec:
|
||
|
replicas: 1
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: redis
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: redis
|
||
|
spec:
|
||
|
nodeSelector:
|
||
|
role: dck
|
||
|
containers:
|
||
|
- name: redis
|
||
|
image: redis:7
|
||
|
ports:
|
||
|
- containerPort: 6379
|
||
|
volumeMounts:
|
||
|
- name: redis-data
|
||
|
mountPath: /data
|
||
|
volumes:
|
||
|
- name: redis-data
|
||
|
hostPath:
|
||
|
path: /dpool/services/redis/data
|
||
|
type: DirectoryOrCreate
|
||
|
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: redis
|
||
|
namespace: database
|
||
|
spec:
|
||
|
selector:
|
||
|
app: redis
|
||
|
ports:
|
||
|
- port: 6379
|
||
|
targetPort: 6379
|
||
|
|