redis-slave-controller.yaml 1.1 KB

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