grandfathermagic

Create Redis Deployment.yaml

Mar 15th, 2022 (edited)
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.24 KB | None | 0 0
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4.   name: redis-deployment
  5.   namespace: default
  6.   labels:
  7.     app: redis-deployment
  8. spec:
  9.   selector:
  10.     matchLabels:
  11.       app: redis-deployment
  12.   replicas: 1
  13.   strategy:
  14.     rollingUpdate:
  15.       maxSurge: 25%
  16.       maxUnavailable: 25%
  17.     type: RollingUpdate
  18.   template:
  19.     metadata:
  20.       labels:
  21.         app: redis-deployment
  22.     spec:
  23.       containers:
  24.       - name: redis-container
  25.         image: redis:alpine
  26.         resources:
  27.           limits:
  28.             cpu: "1"
  29.             memory: 100Mi
  30.         env:
  31.         - name: my-redis-config
  32.           valueFrom:
  33.             configMapKeyRef:
  34.               name: my-redis-config
  35.               key: my-redis-config
  36.         ports:
  37.         - containerPort: 6379
  38.           name: redis-container
  39.         volumeMounts:
  40.         - mountPath: /redis-master-data
  41.           name: data
  42.         - mountPath: /redis-master
  43.           name: redis-config
  44.       volumes:
  45.         - name: data
  46.           emptyDir: {}
  47.         - name: redis-config
  48.           configMap:
  49.             name: my-redis-config
  50.             items:
  51.             - key: redis-config
  52.               path: redis-master
  53.                
  54.       restartPolicy: Always
Add Comment
Please, Sign In to add comment