redis.yaml 782 Bytes
Newer Older
1
2
3
apiVersion: apps/v1
kind: Deployment
metadata:
4
  name: redis
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  labels:
    app: redis
spec:
  selector:
    matchLabels:
      app: redis
  replicas: 1
  template:
    metadata:
      labels:
        app: redis
    spec:
      containers:
      - name: master
19
        image: k8s.gcr.io/redis
20
        resources:
21
          limits:
22
23
24
25
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 6379
26
        volumeMounts:
27
        - mountPath: "/data"
28
          name: redis-volume
29
      volumes:
30
      - name: redis-volume
31
        persistentVolumeClaim:
32
          claimName: redis-volume-claim
33
34
35
36
---
apiVersion: v1
kind: Service
metadata:
37
  name: redis-service
38
39
40
41
42
43
44
spec:
  selector:
    app: redis
  ports:
    - protocol: TCP
      port: 6379
      targetPort: 6379