You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

353 lines
13 KiB

7 years ago
contiv network support (#1914) * Add Contiv support Contiv is a network plugin for Kubernetes and Docker. It supports vlan/vxlan/BGP/Cisco ACI technologies. It support firewall policies, multiple networks and bridging pods onto physical networks. * Update contiv version to 1.1.4 Update contiv version to 1.1.4 and added SVC_SUBNET in contiv-config. * Load openvswitch module to workaround on CentOS7.4 * Set contiv cni version to 0.1.0 Correct contiv CNI version to 0.1.0. * Use kube_apiserver_endpoint for K8S_API_SERVER Use kube_apiserver_endpoint as K8S_API_SERVER to make contiv talks to a available endpoint no matter if there's a loadbalancer or not. * Make contiv use its own etcd Before this commit, contiv is using a etcd proxy mode to k8s etcd, this work fine when the etcd hosts are co-located with contiv etcd proxy, however the k8s peering certs are only in etcd group, as a result the etcd-proxy is not able to peering with the k8s etcd on etcd group, plus the netplugin is always trying to find the etcd endpoint on localhost, this will cause problem for all netplugins not runnign on etcd group nodes. This commit make contiv uses its own etcd, separate from k8s one. on kube-master nodes (where net-master runs), it will run as leader mode and on all rest nodes it will run as proxy mode. * Use cp instead of rsync to copy cni binaries Since rsync has been removed from hyperkube, this commit changes it to use cp instead. * Make contiv-etcd able to run on master nodes * Add rbac_enabled flag for contiv pods * Add contiv into CNI network plugin lists * migrate contiv test to tests/files Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> * Add required rules for contiv netplugin * Better handling json return of fwdMode * Make contiv etcd port configurable * Use default var instead of templating * roles/download/defaults/main.yml: use contiv 1.1.7 Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
7 years ago
contiv network support (#1914) * Add Contiv support Contiv is a network plugin for Kubernetes and Docker. It supports vlan/vxlan/BGP/Cisco ACI technologies. It support firewall policies, multiple networks and bridging pods onto physical networks. * Update contiv version to 1.1.4 Update contiv version to 1.1.4 and added SVC_SUBNET in contiv-config. * Load openvswitch module to workaround on CentOS7.4 * Set contiv cni version to 0.1.0 Correct contiv CNI version to 0.1.0. * Use kube_apiserver_endpoint for K8S_API_SERVER Use kube_apiserver_endpoint as K8S_API_SERVER to make contiv talks to a available endpoint no matter if there's a loadbalancer or not. * Make contiv use its own etcd Before this commit, contiv is using a etcd proxy mode to k8s etcd, this work fine when the etcd hosts are co-located with contiv etcd proxy, however the k8s peering certs are only in etcd group, as a result the etcd-proxy is not able to peering with the k8s etcd on etcd group, plus the netplugin is always trying to find the etcd endpoint on localhost, this will cause problem for all netplugins not runnign on etcd group nodes. This commit make contiv uses its own etcd, separate from k8s one. on kube-master nodes (where net-master runs), it will run as leader mode and on all rest nodes it will run as proxy mode. * Use cp instead of rsync to copy cni binaries Since rsync has been removed from hyperkube, this commit changes it to use cp instead. * Make contiv-etcd able to run on master nodes * Add rbac_enabled flag for contiv pods * Add contiv into CNI network plugin lists * migrate contiv test to tests/files Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> * Add required rules for contiv netplugin * Better handling json return of fwdMode * Make contiv etcd port configurable * Use default var instead of templating * roles/download/defaults/main.yml: use contiv 1.1.7 Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
7 years ago
contiv network support (#1914) * Add Contiv support Contiv is a network plugin for Kubernetes and Docker. It supports vlan/vxlan/BGP/Cisco ACI technologies. It support firewall policies, multiple networks and bridging pods onto physical networks. * Update contiv version to 1.1.4 Update contiv version to 1.1.4 and added SVC_SUBNET in contiv-config. * Load openvswitch module to workaround on CentOS7.4 * Set contiv cni version to 0.1.0 Correct contiv CNI version to 0.1.0. * Use kube_apiserver_endpoint for K8S_API_SERVER Use kube_apiserver_endpoint as K8S_API_SERVER to make contiv talks to a available endpoint no matter if there's a loadbalancer or not. * Make contiv use its own etcd Before this commit, contiv is using a etcd proxy mode to k8s etcd, this work fine when the etcd hosts are co-located with contiv etcd proxy, however the k8s peering certs are only in etcd group, as a result the etcd-proxy is not able to peering with the k8s etcd on etcd group, plus the netplugin is always trying to find the etcd endpoint on localhost, this will cause problem for all netplugins not runnign on etcd group nodes. This commit make contiv uses its own etcd, separate from k8s one. on kube-master nodes (where net-master runs), it will run as leader mode and on all rest nodes it will run as proxy mode. * Use cp instead of rsync to copy cni binaries Since rsync has been removed from hyperkube, this commit changes it to use cp instead. * Make contiv-etcd able to run on master nodes * Add rbac_enabled flag for contiv pods * Add contiv into CNI network plugin lists * migrate contiv test to tests/files Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> * Add required rules for contiv netplugin * Better handling json return of fwdMode * Make contiv etcd port configurable * Use default var instead of templating * roles/download/defaults/main.yml: use contiv 1.1.7 Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
7 years ago
  1. ---
  2. local_release_dir: /tmp
  3. # Used to only evaluate vars from download role
  4. skip_downloads: false
  5. # if this is set to true will only download files once. Doesn't work
  6. # on Container Linux by CoreOS unless the download_localhost is true and localhost
  7. # is running another OS type. Default compress level is 1 (fastest).
  8. download_run_once: False
  9. download_compress: 1
  10. # if this is set to true, uses the localhost for download_run_once mode
  11. # (requires docker and sudo to access docker). You may want this option for
  12. # local caching of docker images or for Container Linux by CoreOS cluster nodes.
  13. # Otherwise, uses the first node in the kube-master group to store images
  14. # in the download_run_once mode.
  15. download_localhost: False
  16. # Always pull images if set to True. Otherwise check by the repo's tag/digest.
  17. download_always_pull: False
  18. # Use the first kube-master if download_localhost is not set
  19. download_delegate: "{% if download_localhost %}localhost{% else %}{{groups['kube-master'][0]}}{% endif %}"
  20. # Versions
  21. kube_version: v1.9.1
  22. kubeadm_version: "{{ kube_version }}"
  23. etcd_version: v3.2.4
  24. # TODO(mattymo): Move calico versions to roles/network_plugins/calico/defaults
  25. # after migration to container download
  26. calico_version: "v2.6.2"
  27. calico_ctl_version: "v1.6.1"
  28. calico_cni_version: "v1.11.0"
  29. calico_policy_version: "v1.0.0"
  30. calico_rr_version: "v0.4.0"
  31. flannel_version: "v0.9.1"
  32. flannel_cni_version: "v0.3.0"
  33. istio_version: "0.2.6"
  34. vault_version: 0.8.1
  35. weave_version: 2.1.3
  36. pod_infra_version: 3.0
  37. contiv_version: 1.1.7
  38. # Download URLs
  39. istioctl_download_url: "https://storage.googleapis.com/istio-release/releases/{{ istio_version }}/istioctl/istioctl-linux"
  40. kubeadm_download_url: "https://storage.googleapis.com/kubernetes-release/release/{{ kubeadm_version }}/bin/linux/amd64/kubeadm"
  41. vault_download_url: "https://releases.hashicorp.com/vault/{{ vault_version }}/vault_{{ vault_version }}_linux_amd64.zip"
  42. # Checksums
  43. istioctl_checksum: fd703063c540b8c0ab943f478c05ab257d88ae27224c746a27d0526ddbf7c370
  44. kubeadm_checksum: 312aeca9f56605e5d117ef901a2d8bceb701cca9662017ceb362c0d1aa91e13a
  45. vault_binary_checksum: 3c4d70ba71619a43229e65c67830e30e050eab7a81ac6b28325ff707e5914188
  46. # Containers
  47. etcd_image_repo: "quay.io/coreos/etcd"
  48. etcd_image_tag: "{{ etcd_version }}"
  49. flannel_image_repo: "quay.io/coreos/flannel"
  50. flannel_image_tag: "{{ flannel_version }}"
  51. flannel_cni_image_repo: "quay.io/coreos/flannel-cni"
  52. flannel_cni_image_tag: "{{ flannel_cni_version }}"
  53. calicoctl_image_repo: "quay.io/calico/ctl"
  54. calicoctl_image_tag: "{{ calico_ctl_version }}"
  55. calico_node_image_repo: "quay.io/calico/node"
  56. calico_node_image_tag: "{{ calico_version }}"
  57. calico_cni_image_repo: "quay.io/calico/cni"
  58. calico_cni_image_tag: "{{ calico_cni_version }}"
  59. calico_policy_image_repo: "quay.io/calico/kube-controllers"
  60. calico_policy_image_tag: "{{ calico_policy_version }}"
  61. calico_rr_image_repo: "quay.io/calico/routereflector"
  62. calico_rr_image_tag: "{{ calico_rr_version }}"
  63. hyperkube_image_repo: "quay.io/coreos/hyperkube"
  64. hyperkube_image_tag: "{{ kube_version }}_coreos.0"
  65. pod_infra_image_repo: "gcr.io/google_containers/pause-amd64"
  66. pod_infra_image_tag: "{{ pod_infra_version }}"
  67. install_socat_image_repo: "xueshanf/install-socat"
  68. install_socat_image_tag: "latest"
  69. netcheck_version: "v1.0"
  70. netcheck_agent_img_repo: "quay.io/l23network/k8s-netchecker-agent"
  71. netcheck_agent_tag: "{{ netcheck_version }}"
  72. netcheck_server_img_repo: "quay.io/l23network/k8s-netchecker-server"
  73. netcheck_server_tag: "{{ netcheck_version }}"
  74. weave_kube_image_repo: "weaveworks/weave-kube"
  75. weave_kube_image_tag: "{{ weave_version }}"
  76. weave_npc_image_repo: "weaveworks/weave-npc"
  77. weave_npc_image_tag: "{{ weave_version }}"
  78. contiv_image_repo: "contiv/netplugin"
  79. contiv_image_tag: "{{ contiv_version }}"
  80. contiv_auth_proxy_image_repo: "contiv/auth_proxy"
  81. contiv_auth_proxy_image_tag: "{{ contiv_version }}"
  82. nginx_image_repo: nginx
  83. nginx_image_tag: 1.13
  84. dnsmasq_version: 2.78
  85. dnsmasq_image_repo: "andyshinn/dnsmasq"
  86. dnsmasq_image_tag: "{{ dnsmasq_version }}"
  87. kubedns_version: 1.14.8
  88. kubedns_image_repo: "gcr.io/google_containers/k8s-dns-kube-dns-amd64"
  89. kubedns_image_tag: "{{ kubedns_version }}"
  90. dnsmasq_nanny_image_repo: "gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64"
  91. dnsmasq_nanny_image_tag: "{{ kubedns_version }}"
  92. dnsmasq_sidecar_image_repo: "gcr.io/google_containers/k8s-dns-sidecar-amd64"
  93. dnsmasq_sidecar_image_tag: "{{ kubedns_version }}"
  94. dnsmasqautoscaler_version: 1.1.2
  95. dnsmasqautoscaler_image_repo: "gcr.io/google_containers/cluster-proportional-autoscaler-amd64"
  96. dnsmasqautoscaler_image_tag: "{{ dnsmasqautoscaler_version }}"
  97. kubednsautoscaler_version: 1.1.2
  98. kubednsautoscaler_image_repo: "gcr.io/google_containers/cluster-proportional-autoscaler-amd64"
  99. kubednsautoscaler_image_tag: "{{ kubednsautoscaler_version }}"
  100. test_image_repo: busybox
  101. test_image_tag: latest
  102. elasticsearch_version: "v2.4.1"
  103. elasticsearch_image_repo: "gcr.io/google_containers/elasticsearch"
  104. elasticsearch_image_tag: "{{ elasticsearch_version }}"
  105. fluentd_version: "1.22"
  106. fluentd_image_repo: "gcr.io/google_containers/fluentd-elasticsearch"
  107. fluentd_image_tag: "{{ fluentd_version }}"
  108. kibana_version: "v4.6.1"
  109. kibana_image_repo: "gcr.io/google_containers/kibana"
  110. kibana_image_tag: "{{ kibana_version }}"
  111. helm_version: "v2.7.2"
  112. helm_image_repo: "lachlanevenson/k8s-helm"
  113. helm_image_tag: "{{ helm_version }}"
  114. tiller_image_repo: "gcr.io/kubernetes-helm/tiller"
  115. tiller_image_tag: "{{ helm_version }}"
  116. vault_image_repo: "vault"
  117. vault_image_tag: "{{ vault_version }}"
  118. downloads:
  119. netcheck_server:
  120. enabled: "{{ deploy_netchecker }}"
  121. container: true
  122. repo: "{{ netcheck_server_img_repo }}"
  123. tag: "{{ netcheck_server_tag }}"
  124. sha256: "{{ netcheck_server_digest_checksum|default(None) }}"
  125. netcheck_agent:
  126. enabled: "{{ deploy_netchecker }}"
  127. container: true
  128. repo: "{{ netcheck_agent_img_repo }}"
  129. tag: "{{ netcheck_agent_tag }}"
  130. sha256: "{{ netcheck_agent_digest_checksum|default(None) }}"
  131. etcd:
  132. enabled: true
  133. container: true
  134. repo: "{{ etcd_image_repo }}"
  135. tag: "{{ etcd_image_tag }}"
  136. sha256: "{{ etcd_digest_checksum|default(None) }}"
  137. kubeadm:
  138. enabled: "{{ kubeadm_enabled }}"
  139. file: true
  140. version: "{{ kubeadm_version }}"
  141. dest: "kubeadm"
  142. sha256: "{{ kubeadm_checksum }}"
  143. source_url: "{{ kubeadm_download_url }}"
  144. url: "{{ kubeadm_download_url }}"
  145. unarchive: false
  146. owner: "root"
  147. mode: "0755"
  148. istioctl:
  149. enabled: "{{ istio_enabled }}"
  150. file: true
  151. version: "{{ istio_version }}"
  152. dest: "istio/istioctl"
  153. sha256: "{{ istioctl_checksum }}"
  154. source_url: "{{ istioctl_download_url }}"
  155. url: "{{ istioctl_download_url }}"
  156. unarchive: false
  157. owner: "root"
  158. mode: "0755"
  159. hyperkube:
  160. enabled: true
  161. container: true
  162. repo: "{{ hyperkube_image_repo }}"
  163. tag: "{{ hyperkube_image_tag }}"
  164. sha256: "{{ hyperkube_digest_checksum|default(None) }}"
  165. flannel:
  166. enabled: "{{ kube_network_plugin == 'flannel' or kube_network_plugin == 'canal' }}"
  167. container: true
  168. repo: "{{ flannel_image_repo }}"
  169. tag: "{{ flannel_image_tag }}"
  170. sha256: "{{ flannel_digest_checksum|default(None) }}"
  171. flannel_cni:
  172. enabled: "{{ kube_network_plugin == 'flannel' }}"
  173. container: true
  174. repo: "{{ flannel_cni_image_repo }}"
  175. tag: "{{ flannel_cni_image_tag }}"
  176. sha256: "{{ flannel_cni_digest_checksum|default(None) }}"
  177. calicoctl:
  178. enabled: "{{ kube_network_plugin == 'calico' or kube_network_plugin == 'canal' }}"
  179. container: true
  180. repo: "{{ calicoctl_image_repo }}"
  181. tag: "{{ calicoctl_image_tag }}"
  182. sha256: "{{ calicoctl_digest_checksum|default(None) }}"
  183. calico_node:
  184. enabled: "{{ kube_network_plugin == 'calico' or kube_network_plugin == 'canal' }}"
  185. container: true
  186. repo: "{{ calico_node_image_repo }}"
  187. tag: "{{ calico_node_image_tag }}"
  188. sha256: "{{ calico_node_digest_checksum|default(None) }}"
  189. calico_cni:
  190. enabled: "{{ kube_network_plugin == 'calico' or kube_network_plugin == 'canal' }}"
  191. container: true
  192. repo: "{{ calico_cni_image_repo }}"
  193. tag: "{{ calico_cni_image_tag }}"
  194. sha256: "{{ calico_cni_digest_checksum|default(None) }}"
  195. calico_policy:
  196. enabled: "{{ enable_network_policy or kube_network_plugin == 'canal' }}"
  197. container: true
  198. repo: "{{ calico_policy_image_repo }}"
  199. tag: "{{ calico_policy_image_tag }}"
  200. sha256: "{{ calico_policy_digest_checksum|default(None) }}"
  201. calico_rr:
  202. enabled: "{{ peer_with_calico_rr is defined and peer_with_calico_rr}} and kube_network_plugin == 'calico'"
  203. container: true
  204. repo: "{{ calico_rr_image_repo }}"
  205. tag: "{{ calico_rr_image_tag }}"
  206. sha256: "{{ calico_rr_digest_checksum|default(None) }}"
  207. weave_kube:
  208. enabled: "{{ kube_network_plugin == 'weave' }}"
  209. container: true
  210. repo: "{{ weave_kube_image_repo }}"
  211. tag: "{{ weave_kube_image_tag }}"
  212. sha256: "{{ weave_kube_digest_checksum|default(None) }}"
  213. weave_npc:
  214. enabled: "{{ kube_network_plugin == 'weave' }}"
  215. container: true
  216. repo: "{{ weave_npc_image_repo }}"
  217. tag: "{{ weave_npc_image_tag }}"
  218. sha256: "{{ weave_npc_digest_checksum|default(None) }}"
  219. contiv:
  220. enabled: "{{ kube_network_plugin == 'contiv' }}"
  221. container: true
  222. repo: "{{ contiv_image_repo }}"
  223. tag: "{{ contiv_image_tag }}"
  224. sha256: "{{ contiv_digest_checksum|default(None) }}"
  225. contiv_auth_proxy:
  226. enabled: "{{ kube_network_plugin == 'contiv' }}"
  227. container: true
  228. repo: "{{ contiv_auth_proxy_image_repo }}"
  229. tag: "{{ contiv_auth_proxy_image_tag }}"
  230. sha256: "{{ contiv_auth_proxy_digest_checksum|default(None) }}"
  231. pod_infra:
  232. enabled: true
  233. container: true
  234. repo: "{{ pod_infra_image_repo }}"
  235. tag: "{{ pod_infra_image_tag }}"
  236. sha256: "{{ pod_infra_digest_checksum|default(None) }}"
  237. install_socat:
  238. enabled: "{{ ansible_os_family in ['CoreOS', 'Container Linux by CoreOS'] }}"
  239. container: true
  240. repo: "{{ install_socat_image_repo }}"
  241. tag: "{{ install_socat_image_tag }}"
  242. sha256: "{{ install_socat_digest_checksum|default(None) }}"
  243. nginx:
  244. enabled: true
  245. container: true
  246. repo: "{{ nginx_image_repo }}"
  247. tag: "{{ nginx_image_tag }}"
  248. sha256: "{{ nginx_digest_checksum|default(None) }}"
  249. dnsmasq:
  250. enabled: "{{ dns_mode == 'dnsmasq_kubedns' }}"
  251. container: true
  252. repo: "{{ dnsmasq_image_repo }}"
  253. tag: "{{ dnsmasq_image_tag }}"
  254. sha256: "{{ dnsmasq_digest_checksum|default(None) }}"
  255. kubedns:
  256. enabled: true
  257. container: true
  258. repo: "{{ kubedns_image_repo }}"
  259. tag: "{{ kubedns_image_tag }}"
  260. sha256: "{{ kubedns_digest_checksum|default(None) }}"
  261. dnsmasq_nanny:
  262. enabled: true
  263. container: true
  264. repo: "{{ dnsmasq_nanny_image_repo }}"
  265. tag: "{{ dnsmasq_nanny_image_tag }}"
  266. sha256: "{{ dnsmasq_nanny_digest_checksum|default(None) }}"
  267. dnsmasq_sidecar:
  268. enabled: true
  269. container: true
  270. repo: "{{ dnsmasq_sidecar_image_repo }}"
  271. tag: "{{ dnsmasq_sidecar_image_tag }}"
  272. sha256: "{{ dnsmasq_sidecar_digest_checksum|default(None) }}"
  273. kubednsautoscaler:
  274. enabled: true
  275. container: true
  276. repo: "{{ kubednsautoscaler_image_repo }}"
  277. tag: "{{ kubednsautoscaler_image_tag }}"
  278. sha256: "{{ kubednsautoscaler_digest_checksum|default(None) }}"
  279. testbox:
  280. enabled: true
  281. container: true
  282. repo: "{{ test_image_repo }}"
  283. tag: "{{ test_image_tag }}"
  284. sha256: "{{ testbox_digest_checksum|default(None) }}"
  285. elasticsearch:
  286. enabled: "{{ efk_enabled }}"
  287. container: true
  288. repo: "{{ elasticsearch_image_repo }}"
  289. tag: "{{ elasticsearch_image_tag }}"
  290. sha256: "{{ elasticsearch_digest_checksum|default(None) }}"
  291. fluentd:
  292. enabled: "{{ efk_enabled }}"
  293. container: true
  294. repo: "{{ fluentd_image_repo }}"
  295. tag: "{{ fluentd_image_tag }}"
  296. sha256: "{{ fluentd_digest_checksum|default(None) }}"
  297. kibana:
  298. enabled: "{{ efk_enabled }}"
  299. container: true
  300. repo: "{{ kibana_image_repo }}"
  301. tag: "{{ kibana_image_tag }}"
  302. sha256: "{{ kibana_digest_checksum|default(None) }}"
  303. helm:
  304. enabled: "{{ helm_enabled }}"
  305. container: true
  306. repo: "{{ helm_image_repo }}"
  307. tag: "{{ helm_image_tag }}"
  308. sha256: "{{ helm_digest_checksum|default(None) }}"
  309. tiller:
  310. enabled: "{{ helm_enabled }}"
  311. container: true
  312. repo: "{{ tiller_image_repo }}"
  313. tag: "{{ tiller_image_tag }}"
  314. sha256: "{{ tiller_digest_checksum|default(None) }}"
  315. vault:
  316. enabled: "{{ cert_management == 'vault' }}"
  317. container: "{{ vault_deployment_type != 'host' }}"
  318. file: "{{ vault_deployment_type == 'host' }}"
  319. dest: "vault/vault_{{ vault_version }}_linux_amd64.zip"
  320. mode: "0755"
  321. owner: "vault"
  322. repo: "{{ vault_image_repo }}"
  323. sha256: "{{ vault_binary_checksum if vault_deployment_type == 'host' else vault_digest_checksum|d(none) }}"
  324. source_url: "{{ vault_download_url }}"
  325. tag: "{{ vault_image_tag }}"
  326. unarchive: true
  327. url: "{{ vault_download_url }}"
  328. version: "{{ vault_version }}"
  329. download_defaults:
  330. container: false
  331. file: false
  332. repo: None
  333. tag: None
  334. enabled: false
  335. dest: None
  336. version: None
  337. url: None
  338. unarchive: false
  339. owner: kube
  340. mode: None