redis-slave-deployment.yaml.in 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: redis-slave
  5. spec:
  6. replicas: 2
  7. selector:
  8. matchLabels:
  9. app: redis
  10. role: slave
  11. tier: backend
  12. template:
  13. metadata:
  14. labels:
  15. app: redis
  16. role: slave
  17. tier: backend
  18. spec:
  19. containers:
  20. - name: slave
  21. image: {{.RedisImage}}
  22. # We are only implementing the dns option of:
  23. # https://github.com/kubernetes/examples/blob/97c7ed0eb6555a4b667d2877f965d392e00abc45/guestbook/redis-slave/run.sh
  24. command: [ "redis-server", "--slaveof", "redis-master", "6379" ]
  25. resources:
  26. requests:
  27. cpu: 100m
  28. memory: 100Mi
  29. env:
  30. - name: GET_HOSTS_FROM
  31. value: dns
  32. # If your cluster config does not include a dns service, then to
  33. # instead access an environment variable to find the master
  34. # service's host, comment out the 'value: dns' line above, and
  35. # uncomment the line below:
  36. # value: env
  37. ports:
  38. - containerPort: 6379