etcd.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: etcd-client
  5. spec:
  6. ports:
  7. - name: etcd-client-port
  8. port: 2379
  9. protocol: TCP
  10. targetPort: 2379
  11. selector:
  12. app: etcd
  13. ---
  14. apiVersion: v1
  15. kind: Pod
  16. metadata:
  17. labels:
  18. app: etcd
  19. etcd_node: etcd0
  20. name: etcd0
  21. spec:
  22. containers:
  23. - command:
  24. - /etcd
  25. - --name
  26. - etcd0
  27. - --initial-advertise-peer-urls
  28. - http://etcd0:2380
  29. - --listen-peer-urls
  30. - http://0.0.0.0:2380
  31. - --listen-client-urls
  32. - http://0.0.0.0:2379
  33. - --advertise-client-urls
  34. - http://etcd0:2379
  35. - --initial-cluster
  36. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
  37. - --initial-cluster-state
  38. - new
  39. image: quay.io/coreos/etcd:latest
  40. name: etcd0
  41. ports:
  42. - containerPort: 2379
  43. name: client
  44. protocol: TCP
  45. - containerPort: 2380
  46. name: server
  47. protocol: TCP
  48. restartPolicy: Never
  49. ---
  50. apiVersion: v1
  51. kind: Service
  52. metadata:
  53. labels:
  54. etcd_node: etcd0
  55. name: etcd0
  56. spec:
  57. ports:
  58. - name: client
  59. port: 2379
  60. protocol: TCP
  61. targetPort: 2379
  62. - name: server
  63. port: 2380
  64. protocol: TCP
  65. targetPort: 2380
  66. selector:
  67. etcd_node: etcd0
  68. ---
  69. apiVersion: v1
  70. kind: Pod
  71. metadata:
  72. labels:
  73. app: etcd
  74. etcd_node: etcd1
  75. name: etcd1
  76. spec:
  77. containers:
  78. - command:
  79. - /etcd
  80. - --name
  81. - etcd1
  82. - --initial-advertise-peer-urls
  83. - http://etcd1:2380
  84. - --listen-peer-urls
  85. - http://0.0.0.0:2380
  86. - --listen-client-urls
  87. - http://0.0.0.0:2379
  88. - --advertise-client-urls
  89. - http://etcd1:2379
  90. - --initial-cluster
  91. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
  92. - --initial-cluster-state
  93. - new
  94. image: quay.io/coreos/etcd:latest
  95. name: etcd1
  96. ports:
  97. - containerPort: 2379
  98. name: client
  99. protocol: TCP
  100. - containerPort: 2380
  101. name: server
  102. protocol: TCP
  103. restartPolicy: Never
  104. ---
  105. apiVersion: v1
  106. kind: Service
  107. metadata:
  108. labels:
  109. etcd_node: etcd1
  110. name: etcd1
  111. spec:
  112. ports:
  113. - name: client
  114. port: 2379
  115. protocol: TCP
  116. targetPort: 2379
  117. - name: server
  118. port: 2380
  119. protocol: TCP
  120. targetPort: 2380
  121. selector:
  122. etcd_node: etcd1
  123. ---
  124. apiVersion: v1
  125. kind: Pod
  126. metadata:
  127. labels:
  128. app: etcd
  129. etcd_node: etcd2
  130. name: etcd2
  131. spec:
  132. containers:
  133. - command:
  134. - /etcd
  135. - --name
  136. - etcd2
  137. - --initial-advertise-peer-urls
  138. - http://etcd2:2380
  139. - --listen-peer-urls
  140. - http://0.0.0.0:2380
  141. - --listen-client-urls
  142. - http://0.0.0.0:2379
  143. - --advertise-client-urls
  144. - http://etcd2:2379
  145. - --initial-cluster
  146. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
  147. - --initial-cluster-state
  148. - new
  149. image: quay.io/coreos/etcd:latest
  150. name: etcd2
  151. ports:
  152. - containerPort: 2379
  153. name: client
  154. protocol: TCP
  155. - containerPort: 2380
  156. name: server
  157. protocol: TCP
  158. restartPolicy: Never
  159. ---
  160. apiVersion: v1
  161. kind: Service
  162. metadata:
  163. labels:
  164. etcd_node: etcd2
  165. name: etcd2
  166. spec:
  167. ports:
  168. - name: client
  169. port: 2379
  170. protocol: TCP
  171. targetPort: 2379
  172. - name: server
  173. port: 2380
  174. protocol: TCP
  175. targetPort: 2380
  176. selector:
  177. etcd_node: etcd2