|
| 1 | +apiVersion: v1 |
| 2 | +kind: Service |
| 3 | +metadata: |
| 4 | + name: redis-master |
| 5 | + labels: |
| 6 | + app: redis |
| 7 | + tier: backend |
| 8 | + role: master |
| 9 | +spec: |
| 10 | + ports: |
| 11 | + # the port that this service should serve on |
| 12 | + - port: 6379 |
| 13 | + targetPort: 6379 |
| 14 | + selector: |
| 15 | + app: redis |
| 16 | + tier: backend |
| 17 | + role: master |
| 18 | +--- |
| 19 | +apiVersion: v1 |
| 20 | +kind: ReplicationController |
| 21 | +metadata: |
| 22 | + name: redis-master |
| 23 | + # these labels can be applied automatically |
| 24 | + # from the labels in the pod template if not set |
| 25 | + labels: |
| 26 | + app: redis |
| 27 | + role: master |
| 28 | + tier: backend |
| 29 | +spec: |
| 30 | + # this replicas value is default |
| 31 | + # modify it according to your case |
| 32 | + replicas: 1 |
| 33 | + # selector can be applied automatically |
| 34 | + # from the labels in the pod template if not set |
| 35 | + # selector: |
| 36 | + # app: guestbook |
| 37 | + # role: master |
| 38 | + # tier: backend |
| 39 | + template: |
| 40 | + metadata: |
| 41 | + labels: |
| 42 | + app: redis |
| 43 | + role: master |
| 44 | + tier: backend |
| 45 | + spec: |
| 46 | + containers: |
| 47 | + - name: master |
| 48 | + image: redis |
| 49 | + resources: |
| 50 | + requests: |
| 51 | + cpu: 100m |
| 52 | + memory: 100Mi |
| 53 | + ports: |
| 54 | + - containerPort: 6379 |
| 55 | +--- |
| 56 | +apiVersion: v1 |
| 57 | +kind: Service |
| 58 | +metadata: |
| 59 | + name: redis-slave |
| 60 | + labels: |
| 61 | + app: redis |
| 62 | + tier: backend |
| 63 | + role: slave |
| 64 | +spec: |
| 65 | + ports: |
| 66 | + # the port that this service should serve on |
| 67 | + - port: 6379 |
| 68 | + selector: |
| 69 | + app: redis |
| 70 | + tier: backend |
| 71 | + role: slave |
| 72 | +--- |
| 73 | +apiVersion: v1 |
| 74 | +kind: ReplicationController |
| 75 | +metadata: |
| 76 | + name: redis-slave |
| 77 | + # these labels can be applied automatically |
| 78 | + # from the labels in the pod template if not set |
| 79 | + labels: |
| 80 | + app: redis |
| 81 | + role: slave |
| 82 | + tier: backend |
| 83 | +spec: |
| 84 | + # this replicas value is default |
| 85 | + # modify it according to your case |
| 86 | + replicas: 2 |
| 87 | + # selector can be applied automatically |
| 88 | + # from the labels in the pod template if not set |
| 89 | + # selector: |
| 90 | + # app: guestbook |
| 91 | + # role: slave |
| 92 | + # tier: backend |
| 93 | + template: |
| 94 | + metadata: |
| 95 | + labels: |
| 96 | + app: redis |
| 97 | + role: slave |
| 98 | + tier: backend |
| 99 | + spec: |
| 100 | + containers: |
| 101 | + - name: slave |
| 102 | + image: gcr.io/google_samples/gb-redisslave:v1 |
| 103 | + resources: |
| 104 | + requests: |
| 105 | + cpu: 100m |
| 106 | + memory: 100Mi |
| 107 | + env: |
| 108 | + - name: GET_HOSTS_FROM |
| 109 | + value: env |
| 110 | + # If your cluster config does not include a dns service, then to |
| 111 | + # instead access an environment variable to find the master |
| 112 | + # service's host, comment out the 'value: dns' line above, and |
| 113 | + # uncomment the line below. |
| 114 | + # value: env |
| 115 | + ports: |
| 116 | + - containerPort: 6379 |
| 117 | +--- |
| 118 | +apiVersion: v1 |
| 119 | +kind: Service |
| 120 | +metadata: |
| 121 | + name: frontend |
| 122 | + labels: |
| 123 | + app: guestbook |
| 124 | + tier: frontend |
| 125 | +spec: |
| 126 | + # if your cluster supports it, uncomment the following to automatically create |
| 127 | + # an external load-balanced IP for the frontend service. |
| 128 | + type: LoadBalancer |
| 129 | + ports: |
| 130 | + # the port that this service should serve on |
| 131 | + - port: 80 |
| 132 | + selector: |
| 133 | + app: guestbook |
| 134 | + tier: frontend |
| 135 | +--- |
| 136 | +apiVersion: v1 |
| 137 | +kind: ReplicationController |
| 138 | +metadata: |
| 139 | + name: frontend |
| 140 | + # these labels can be applied automatically |
| 141 | + # from the labels in the pod template if not set |
| 142 | + labels: |
| 143 | + app: guestbook |
| 144 | + tier: frontend |
| 145 | +spec: |
| 146 | + # this replicas value is default |
| 147 | + # modify it according to your case |
| 148 | + replicas: 1 |
| 149 | + # selector can be applied automatically |
| 150 | + # from the labels in the pod template if not set |
| 151 | + # selector: |
| 152 | + # app: guestbook |
| 153 | + # tier: frontend |
| 154 | + template: |
| 155 | + metadata: |
| 156 | + labels: |
| 157 | + app: guestbook |
| 158 | + tier: frontend |
| 159 | + spec: |
| 160 | + containers: |
| 161 | + - name: php-redis |
| 162 | + image: gcr.io/google_samples/gb-frontend:v3 |
| 163 | + resources: |
| 164 | + requests: |
| 165 | + cpu: 500m |
| 166 | + memory: 100Mi |
| 167 | + env: |
| 168 | + - name: GET_HOSTS_FROM |
| 169 | + value: env |
| 170 | + # If your cluster config does not include a dns service, then to |
| 171 | + # instead access environment variables to find service host |
| 172 | + # info, comment out the 'value: dns' line above, and uncomment the |
| 173 | + # line below. |
| 174 | + # value: env |
| 175 | + ports: |
| 176 | + - containerPort: 80 |
0 commit comments