Advertisement
Guest User

Untitled

a guest
Jan 19th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.84 KB | None | 0 0
  1. # Service to expose the etcd endpoint for Percona XtraDB Cluster
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: etcd
  6. spec:
  7. ports:
  8. - name: etcd-2379
  9. port: 2379
  10. protocol: TCP
  11. targetPort: 2379
  12. - name: etcd-4001
  13. port: 4001
  14. protocol: TCP
  15. targetPort: 4001
  16. - name: etcd-7001
  17. port: 7001
  18. protocol: TCP
  19. targetPort: 7001
  20. selector:
  21. app: etcd
  22.  
  23. ---
  24. # Endpoint for connecting external etcd clients. Delete this if not required
  25. apiVersion: v1
  26. kind: Service
  27. metadata:
  28. name: etcd-client
  29. labels:
  30. name: etcd-client
  31. spec:
  32. type: NodePort
  33. ports:
  34. - port: 2379
  35. name: client
  36. targetPort: 2379
  37. protocol: TCP
  38. selector:
  39. app: etcd
  40. ---
  41. apiVersion: v1
  42. kind: Pod
  43. metadata:
  44. labels:
  45. app: etcd
  46. etcd_node: etcd-0
  47. name: etcd-0
  48. spec:
  49. containers:
  50. - command:
  51. - /usr/local/bin/etcd
  52. - --name
  53. - etcd-0
  54. - --initial-advertise-peer-urls
  55. - http://etcd-0:2380
  56. - --listen-peer-urls
  57. - http://0.0.0.0:2380
  58. - --listen-client-urls
  59. - http://0.0.0.0:2379
  60. - --advertise-client-urls
  61. - http://etcd-0:2379
  62. - --initial-cluster
  63. - etcd-0=http://etcd-0:2380,etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380
  64. - --initial-cluster-state
  65. - new
  66. image: quay.io/coreos/etcd:latest
  67. name: etcd-0
  68. ports:
  69. - containerPort: 2379
  70. name: client
  71. protocol: TCP
  72. - containerPort: 2380
  73. name: server
  74. protocol: TCP
  75. - containerPort: 4001
  76. protocol: TCP
  77. - containerPort: 7001
  78. protocol: TCP
  79. restartPolicy: Never
  80. nodeSelector:
  81. name: node-1
  82.  
  83. ---
  84.  
  85. apiVersion: v1
  86. kind: Service
  87. metadata:
  88. labels:
  89. etcd_node: etcd-0
  90. name: etcd-0
  91. spec:
  92. ports:
  93. - name: client
  94. port: 2379
  95. protocol: TCP
  96. targetPort: 2379
  97. - name: server
  98. port: 2380
  99. protocol: TCP
  100. targetPort: 2380
  101. - name: etcd-4001
  102. port: 4001
  103. protocol: TCP
  104. targetPort: 4001
  105. - name: etcd-7001
  106. port: 7001
  107. protocol: TCP
  108. targetPort: 7001
  109. selector:
  110. etcd_node: etcd-0
  111.  
  112. ---
  113.  
  114. apiVersion: v1
  115. kind: Pod
  116. metadata:
  117. labels:
  118. app: etcd
  119. etcd_node: etcd-1
  120. name: etcd-1
  121. spec:
  122. containers:
  123. - command:
  124. - /usr/local/bin/etcd
  125. - --name
  126. - etcd-1
  127. - --initial-advertise-peer-urls
  128. - http://etcd-1:2380
  129. - --listen-peer-urls
  130. - http://0.0.0.0:2380
  131. - --listen-client-urls
  132. - http://0.0.0.0:2379
  133. - --advertise-client-urls
  134. - http://etcd-1:2379
  135. - --initial-cluster
  136. - etcd-0=http://etcd-0:2380,etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380
  137. - --initial-cluster-state
  138. - new
  139. image: quay.io/coreos/etcd:latest
  140. name: etcd-1
  141. ports:
  142. - containerPort: 2379
  143. name: client
  144. protocol: TCP
  145. - containerPort: 2380
  146. name: server
  147. protocol: TCP
  148. - containerPort: 4001
  149. protocol: TCP
  150. - containerPort: 7001
  151. protocol: TCP
  152. restartPolicy: Never
  153. nodeSelector:
  154. name: node-2
  155. ---
  156.  
  157. apiVersion: v1
  158. kind: Service
  159. metadata:
  160. labels:
  161. etcd_node: etcd-1
  162. name: etcd-1
  163. spec:
  164. ports:
  165. - name: client
  166. port: 2379
  167. protocol: TCP
  168. targetPort: 2379
  169. - name: server
  170. port: 2380
  171. protocol: TCP
  172. targetPort: 2380
  173. - name: etcd-4001
  174. port: 4001
  175. protocol: TCP
  176. targetPort: 4001
  177. - name: etcd-7001
  178. port: 7001
  179. protocol: TCP
  180. targetPort: 7001
  181. selector:
  182. etcd_node: etcd-1
  183.  
  184. ---
  185.  
  186. apiVersion: v1
  187. kind: Pod
  188. metadata:
  189. labels:
  190. app: etcd
  191. etcd_node: etcd-2
  192. name: etcd-2
  193. spec:
  194. containers:
  195. - command:
  196. - /usr/local/bin/etcd
  197. - --name
  198. - etcd-2
  199. - --initial-advertise-peer-urls
  200. - http://etcd-2:2380
  201. - --listen-peer-urls
  202. - http://0.0.0.0:2380
  203. - --listen-client-urls
  204. - http://0.0.0.0:2379
  205. - --advertise-client-urls
  206. - http://etcd-2:2379
  207. - --initial-cluster
  208. - etcd-0=http://etcd-0:2380,etcd-1=http://etcd-1:2380,etcd-2=http://etcd-2:2380
  209. - --initial-cluster-state
  210. - new
  211. image: quay.io/coreos/etcd:latest
  212. name: etcd-2
  213. ports:
  214. - containerPort: 2379
  215. name: client
  216. protocol: TCP
  217. - containerPort: 2380
  218. name: server
  219. protocol: TCP
  220. - containerPort: 4001
  221. protocol: TCP
  222. - containerPort: 7001
  223. protocol: TCP
  224. restartPolicy: Never
  225. nodeSelector:
  226. name: node-3
  227. ---
  228.  
  229. apiVersion: v1
  230. kind: Service
  231. metadata:
  232. labels:
  233. etcd_node: etcd-2
  234. name: etcd-2
  235. spec:
  236. ports:
  237. - name: client
  238. port: 2379
  239. protocol: TCP
  240. targetPort: 2379
  241. - name: server
  242. port: 2380
  243. protocol: TCP
  244. targetPort: 2380
  245. - name: etcd-4001
  246. port: 4001
  247. protocol: TCP
  248. targetPort: 4001
  249. - name: etcd-7001
  250. port: 7001
  251. protocol: TCP
  252. targetPort: 7001
  253. selector:
  254. etcd_node: etcd-2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement