redis-slave-controller.yaml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. apiVersion: v1
  2. kind: ReplicationController
  3. metadata:
  4. name: redis-slave
  5. # these labels can be applied automatically
  6. # from the labels in the pod template if not set
  7. labels:
  8. app: redis
  9. role: slave
  10. tier: backend
  11. spec:
  12. # this replicas value is default
  13. # modify it according to your case
  14. replicas: 2
  15. # selector can be applied automatically
  16. # from the labels in the pod template if not set
  17. # selector:
  18. # app: guestbook
  19. # role: slave
  20. # tier: backend
  21. template:
  22. metadata:
  23. labels:
  24. app: redis
  25. role: slave
  26. tier: backend
  27. spec:
  28. containers:
  29. - name: slave
  30. image: gcr.io/google_samples/gb-redisslave:v1
  31. resources:
  32. requests:
  33. cpu: 100m
  34. memory: 100Mi
  35. env:
  36. - name: GET_HOSTS_FROM
  37. value: dns
  38. # If your cluster config does not include a dns service, then to
  39. # instead access an environment variable to find the master
  40. # service's host, comment out the 'value: dns' line above, and
  41. # uncomment the line below.
  42. # value: env
  43. ports:
  44. - containerPort: 6379