etcd.yaml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: etcd
  5. namespace: discov
  6. spec:
  7. ports:
  8. - name: etcd-port
  9. port: 2379
  10. protocol: TCP
  11. targetPort: 2379
  12. selector:
  13. app: etcd
  14. ---
  15. apiVersion: v1
  16. kind: Pod
  17. metadata:
  18. labels:
  19. app: etcd
  20. etcd_node: etcd0
  21. name: etcd0
  22. namespace: discov
  23. spec:
  24. containers:
  25. - command:
  26. - /usr/local/bin/etcd
  27. - --name
  28. - etcd0
  29. - --initial-advertise-peer-urls
  30. - http://etcd0:2380
  31. - --listen-peer-urls
  32. - http://0.0.0.0:2380
  33. - --listen-client-urls
  34. - http://0.0.0.0:2379
  35. - --advertise-client-urls
  36. - http://etcd0:2379
  37. - --initial-cluster
  38. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
  39. - --initial-cluster-state
  40. - new
  41. image: quay.io/coreos/etcd:latest
  42. name: etcd0
  43. ports:
  44. - containerPort: 2379
  45. name: client
  46. protocol: TCP
  47. - containerPort: 2380
  48. name: server
  49. protocol: TCP
  50. affinity:
  51. podAntiAffinity:
  52. requiredDuringSchedulingIgnoredDuringExecution:
  53. - labelSelector:
  54. matchExpressions:
  55. - key: app
  56. operator: In
  57. values:
  58. - etcd
  59. topologyKey: "kubernetes.io/hostname"
  60. restartPolicy: Always
  61. ---
  62. apiVersion: v1
  63. kind: Service
  64. metadata:
  65. labels:
  66. etcd_node: etcd0
  67. name: etcd0
  68. namespace: discov
  69. spec:
  70. ports:
  71. - name: client
  72. port: 2379
  73. protocol: TCP
  74. targetPort: 2379
  75. - name: server
  76. port: 2380
  77. protocol: TCP
  78. targetPort: 2380
  79. selector:
  80. etcd_node: etcd0
  81. ---
  82. apiVersion: v1
  83. kind: Pod
  84. metadata:
  85. labels:
  86. app: etcd
  87. etcd_node: etcd1
  88. name: etcd1
  89. namespace: discov
  90. spec:
  91. containers:
  92. - command:
  93. - /usr/local/bin/etcd
  94. - --name
  95. - etcd1
  96. - --initial-advertise-peer-urls
  97. - http://etcd1:2380
  98. - --listen-peer-urls
  99. - http://0.0.0.0:2380
  100. - --listen-client-urls
  101. - http://0.0.0.0:2379
  102. - --advertise-client-urls
  103. - http://etcd1:2379
  104. - --initial-cluster
  105. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
  106. - --initial-cluster-state
  107. - new
  108. image: quay.io/coreos/etcd:latest
  109. name: etcd1
  110. ports:
  111. - containerPort: 2379
  112. name: client
  113. protocol: TCP
  114. - containerPort: 2380
  115. name: server
  116. protocol: TCP
  117. affinity:
  118. podAntiAffinity:
  119. requiredDuringSchedulingIgnoredDuringExecution:
  120. - labelSelector:
  121. matchExpressions:
  122. - key: app
  123. operator: In
  124. values:
  125. - etcd
  126. topologyKey: "kubernetes.io/hostname"
  127. restartPolicy: Always
  128. ---
  129. apiVersion: v1
  130. kind: Service
  131. metadata:
  132. labels:
  133. etcd_node: etcd1
  134. name: etcd1
  135. namespace: discov
  136. spec:
  137. ports:
  138. - name: client
  139. port: 2379
  140. protocol: TCP
  141. targetPort: 2379
  142. - name: server
  143. port: 2380
  144. protocol: TCP
  145. targetPort: 2380
  146. selector:
  147. etcd_node: etcd1
  148. ---
  149. apiVersion: v1
  150. kind: Pod
  151. metadata:
  152. labels:
  153. app: etcd
  154. etcd_node: etcd2
  155. name: etcd2
  156. namespace: discov
  157. spec:
  158. containers:
  159. - command:
  160. - /usr/local/bin/etcd
  161. - --name
  162. - etcd2
  163. - --initial-advertise-peer-urls
  164. - http://etcd2:2380
  165. - --listen-peer-urls
  166. - http://0.0.0.0:2380
  167. - --listen-client-urls
  168. - http://0.0.0.0:2379
  169. - --advertise-client-urls
  170. - http://etcd2:2379
  171. - --initial-cluster
  172. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
  173. - --initial-cluster-state
  174. - new
  175. image: quay.io/coreos/etcd:latest
  176. name: etcd2
  177. ports:
  178. - containerPort: 2379
  179. name: client
  180. protocol: TCP
  181. - containerPort: 2380
  182. name: server
  183. protocol: TCP
  184. affinity:
  185. podAntiAffinity:
  186. requiredDuringSchedulingIgnoredDuringExecution:
  187. - labelSelector:
  188. matchExpressions:
  189. - key: app
  190. operator: In
  191. values:
  192. - etcd
  193. topologyKey: "kubernetes.io/hostname"
  194. restartPolicy: Always
  195. ---
  196. apiVersion: v1
  197. kind: Service
  198. metadata:
  199. labels:
  200. etcd_node: etcd2
  201. name: etcd2
  202. namespace: discov
  203. spec:
  204. ports:
  205. - name: client
  206. port: 2379
  207. protocol: TCP
  208. targetPort: 2379
  209. - name: server
  210. port: 2380
  211. protocol: TCP
  212. targetPort: 2380
  213. selector:
  214. etcd_node: etcd2
  215. ---
  216. apiVersion: v1
  217. kind: Pod
  218. metadata:
  219. labels:
  220. app: etcd
  221. etcd_node: etcd3
  222. name: etcd3
  223. namespace: discov
  224. spec:
  225. containers:
  226. - command:
  227. - /usr/local/bin/etcd
  228. - --name
  229. - etcd3
  230. - --initial-advertise-peer-urls
  231. - http://etcd3:2380
  232. - --listen-peer-urls
  233. - http://0.0.0.0:2380
  234. - --listen-client-urls
  235. - http://0.0.0.0:2379
  236. - --advertise-client-urls
  237. - http://etcd3:2379
  238. - --initial-cluster
  239. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
  240. - --initial-cluster-state
  241. - new
  242. image: quay.io/coreos/etcd:latest
  243. name: etcd3
  244. ports:
  245. - containerPort: 2379
  246. name: client
  247. protocol: TCP
  248. - containerPort: 2380
  249. name: server
  250. protocol: TCP
  251. affinity:
  252. podAntiAffinity:
  253. requiredDuringSchedulingIgnoredDuringExecution:
  254. - labelSelector:
  255. matchExpressions:
  256. - key: app
  257. operator: In
  258. values:
  259. - etcd
  260. topologyKey: "kubernetes.io/hostname"
  261. restartPolicy: Always
  262. ---
  263. apiVersion: v1
  264. kind: Service
  265. metadata:
  266. labels:
  267. etcd_node: etcd3
  268. name: etcd3
  269. namespace: discov
  270. spec:
  271. ports:
  272. - name: client
  273. port: 2379
  274. protocol: TCP
  275. targetPort: 2379
  276. - name: server
  277. port: 2380
  278. protocol: TCP
  279. targetPort: 2380
  280. selector:
  281. etcd_node: etcd3
  282. ---
  283. apiVersion: v1
  284. kind: Pod
  285. metadata:
  286. labels:
  287. app: etcd
  288. etcd_node: etcd4
  289. name: etcd4
  290. namespace: discov
  291. spec:
  292. containers:
  293. - command:
  294. - /usr/local/bin/etcd
  295. - --name
  296. - etcd4
  297. - --initial-advertise-peer-urls
  298. - http://etcd4:2380
  299. - --listen-peer-urls
  300. - http://0.0.0.0:2380
  301. - --listen-client-urls
  302. - http://0.0.0.0:2379
  303. - --advertise-client-urls
  304. - http://etcd4:2379
  305. - --initial-cluster
  306. - etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380,etcd4=http://etcd4:2380
  307. - --initial-cluster-state
  308. - new
  309. image: quay.io/coreos/etcd:latest
  310. name: etcd4
  311. ports:
  312. - containerPort: 2379
  313. name: client
  314. protocol: TCP
  315. - containerPort: 2380
  316. name: server
  317. protocol: TCP
  318. affinity:
  319. podAntiAffinity:
  320. requiredDuringSchedulingIgnoredDuringExecution:
  321. - labelSelector:
  322. matchExpressions:
  323. - key: app
  324. operator: In
  325. values:
  326. - etcd
  327. topologyKey: "kubernetes.io/hostname"
  328. restartPolicy: Always
  329. ---
  330. apiVersion: v1
  331. kind: Service
  332. metadata:
  333. labels:
  334. etcd_node: etcd4
  335. name: etcd4
  336. namespace: discov
  337. spec:
  338. ports:
  339. - name: client
  340. port: 2379
  341. protocol: TCP
  342. targetPort: 2379
  343. - name: server
  344. port: 2380
  345. protocol: TCP
  346. targetPort: 2380
  347. selector:
  348. etcd_node: etcd4