etcd.yaml 8.0 KB

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