etcd.yaml 7.9 KB

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