ReplicationController 和 ReplicaSet

    1. kind: ReplicaSet
    2. metadata:
    3. name: frontend
    4. # these labels can be applied automatically
    5. # from the labels in the pod template if not set
    6. # labels:
    7. # app: guestbook
    8. # tier: frontend
    9. spec:
    10. # this replicas value is default
    11. # modify it according to your case
    12. # selector can be applied automatically
    13. # from the labels in the pod template if not set,
    14. # demonstrate its usage.
    15. selector:
    16. matchLabels:
    17. tier: frontend
    18. matchExpressions:
    19. - {key: tier, operator: In, values: [frontend]}
    20. template:
    21. metadata:
    22. labels:
    23. app: guestbook
    24. tier: frontend
    25. spec:
    26. - name: php-redis
    27. resources:
    28. requests:
    29. cpu: 100m
    30. memory: 100Mi
    31. env:
    32. - name: GET_HOSTS_FROM
    33. value: dns
    34. # If your cluster config does not include a dns service, then to
    35. # instead access environment variables to find service host
    36. # info, comment out the 'value: dns' line above, and uncomment the
    37. # line below.
    38. # value: env
    39. ports: