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.

810 lines
20 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 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
6 years ago
8 years ago
6 years ago
8 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. ---
  2. stages:
  3. - unit-tests
  4. - moderator
  5. - deploy-part1
  6. - deploy-part2
  7. - deploy-special
  8. variables:
  9. FAILFASTCI_NAMESPACE: 'kargo-ci'
  10. GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
  11. # DOCKER_HOST: tcp://localhost:2375
  12. ANSIBLE_FORCE_COLOR: "true"
  13. MAGIC: "ci check this"
  14. TEST_ID: "$CI_PIPELINE_ID-$CI_BUILD_ID"
  15. CI_TEST_VARS: "./tests/files/${CI_JOB_NAME}.yml"
  16. GS_ACCESS_KEY_ID: $GS_KEY
  17. GS_SECRET_ACCESS_KEY: $GS_SECRET
  18. CONTAINER_ENGINE: docker
  19. SSH_USER: root
  20. GCE_PREEMPTIBLE: "false"
  21. ANSIBLE_KEEP_REMOTE_FILES: "1"
  22. ANSIBLE_CONFIG: ./tests/ansible.cfg
  23. ANSIBLE_INVENTORY: ./inventory/sample/${CI_JOB_NAME}-${BUILD_NUMBER}.ini
  24. IDEMPOT_CHECK: "false"
  25. RESET_CHECK: "false"
  26. UPGRADE_TEST: "false"
  27. LOG_LEVEL: "-vv"
  28. # asia-east1-a
  29. # asia-northeast1-a
  30. # europe-west1-b
  31. # us-central1-a
  32. # us-east1-b
  33. # us-west1-a
  34. before_script:
  35. - /usr/bin/python -m pip install -r tests/requirements.txt
  36. - mkdir -p /.ssh
  37. .job: &job
  38. tags:
  39. - kubernetes
  40. - docker
  41. image: quay.io/kubespray/kubespray:v2.8
  42. .docker_service: &docker_service
  43. services:
  44. - docker:dind
  45. .create_cluster: &create_cluster
  46. <<: *job
  47. <<: *docker_service
  48. .gce_variables: &gce_variables
  49. GCE_USER: travis
  50. SSH_USER: $GCE_USER
  51. CLOUD_MACHINE_TYPE: "g1-small"
  52. CI_PLATFORM: "gce"
  53. PRIVATE_KEY: $GCE_PRIVATE_KEY
  54. .do_variables: &do_variables
  55. PRIVATE_KEY: $DO_PRIVATE_KEY
  56. CI_PLATFORM: "do"
  57. SSH_USER: root
  58. .testcases: &testcases
  59. <<: *job
  60. <<: *docker_service
  61. cache:
  62. key: "$CI_BUILD_REF_NAME"
  63. paths:
  64. - downloads/
  65. - $HOME/.cache
  66. before_script:
  67. - docker info
  68. - /usr/bin/python -m pip install -r requirements.txt
  69. - /usr/bin/python -m pip install -r tests/requirements.txt
  70. - mkdir -p /.ssh
  71. - mkdir -p $HOME/.ssh
  72. - ansible-playbook --version
  73. - export PYPATH=$([[ ! "$CI_JOB_NAME" =~ "coreos" ]] && echo /usr/bin/python || echo /opt/bin/python)
  74. - echo "CI_JOB_NAME is $CI_JOB_NAME"
  75. - echo "PYPATH is $PYPATH"
  76. script:
  77. - pwd
  78. - ls
  79. - echo ${PWD}
  80. - echo "${STARTUP_SCRIPT}"
  81. - cd tests && make create-${CI_PLATFORM} -s ; cd -
  82. # Check out latest tag if testing upgrade
  83. - test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
  84. # Checkout the CI vars file so it is available
  85. - test "${UPGRADE_TEST}" != "false" && git checkout "${CI_BUILD_REF}" tests/files/${CI_JOB_NAME}.yml
  86. # Workaround https://github.com/kubernetes-sigs/kubespray/issues/2021
  87. - 'sh -c "echo ignore_assert_errors: true | tee -a tests/files/${CI_JOB_NAME}.yml"'
  88. # Create cluster
  89. - >
  90. ansible-playbook
  91. -i ${ANSIBLE_INVENTORY}
  92. -b --become-user=root
  93. --private-key=${HOME}/.ssh/id_rsa
  94. -u $SSH_USER
  95. ${SSH_ARGS}
  96. ${LOG_LEVEL}
  97. -e @${CI_TEST_VARS}
  98. -e ansible_ssh_user=${SSH_USER}
  99. -e local_release_dir=${PWD}/downloads
  100. --limit "all:!fake_hosts"
  101. cluster.yml
  102. # Repeat deployment if testing upgrade
  103. - >
  104. if [ "${UPGRADE_TEST}" != "false" ]; then
  105. test "${UPGRADE_TEST}" == "basic" && PLAYBOOK="cluster.yml";
  106. test "${UPGRADE_TEST}" == "graceful" && PLAYBOOK="upgrade-cluster.yml";
  107. git checkout "${CI_BUILD_REF}";
  108. ansible-playbook
  109. -i ${ANSIBLE_INVENTORY}
  110. -b --become-user=root
  111. --private-key=${HOME}/.ssh/id_rsa
  112. -u $SSH_USER
  113. ${SSH_ARGS}
  114. ${LOG_LEVEL}
  115. -e @${CI_TEST_VARS}
  116. -e ansible_ssh_user=${SSH_USER}
  117. -e local_release_dir=${PWD}/downloads
  118. --limit "all:!fake_hosts"
  119. $PLAYBOOK;
  120. fi
  121. # Tests Cases
  122. ## Test Master API
  123. - ansible-playbook -i ${ANSIBLE_INVENTORY} -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/010_check-apiserver.yml $LOG_LEVEL
  124. ## Ping the between 2 pod
  125. - ansible-playbook -i ${ANSIBLE_INVENTORY} -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/030_check-network.yml $LOG_LEVEL
  126. ## Advanced DNS checks
  127. - ansible-playbook -i ${ANSIBLE_INVENTORY} -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml $LOG_LEVEL
  128. ## Idempotency checks 1/5 (repeat deployment)
  129. - >
  130. if [ "${IDEMPOT_CHECK}" = "true" ]; then
  131. ansible-playbook
  132. -i ${ANSIBLE_INVENTORY}
  133. -b --become-user=root
  134. --private-key=${HOME}/.ssh/id_rsa
  135. -u $SSH_USER
  136. ${SSH_ARGS}
  137. ${LOG_LEVEL}
  138. -e @${CI_TEST_VARS}
  139. -e ansible_python_interpreter=${PYPATH}
  140. -e local_release_dir=${PWD}/downloads
  141. --limit "all:!fake_hosts"
  142. cluster.yml;
  143. fi
  144. ## Idempotency checks 2/5 (Advanced DNS checks)
  145. - >
  146. if [ "${IDEMPOT_CHECK}" = "true" ]; then
  147. ansible-playbook
  148. -i ${ANSIBLE_INVENTORY}
  149. -b --become-user=root
  150. --private-key=${HOME}/.ssh/id_rsa
  151. -u $SSH_USER
  152. ${SSH_ARGS}
  153. ${LOG_LEVEL}
  154. -e @${CI_TEST_VARS}
  155. --limit "all:!fake_hosts"
  156. tests/testcases/040_check-network-adv.yml $LOG_LEVEL;
  157. fi
  158. ## Idempotency checks 3/5 (reset deployment)
  159. - >
  160. if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
  161. ansible-playbook
  162. -i ${ANSIBLE_INVENTORY}
  163. -b --become-user=root
  164. --private-key=${HOME}/.ssh/id_rsa
  165. -u $SSH_USER
  166. ${SSH_ARGS}
  167. ${LOG_LEVEL}
  168. -e @${CI_TEST_VARS}
  169. -e ansible_python_interpreter=${PYPATH}
  170. -e reset_confirmation=yes
  171. --limit "all:!fake_hosts"
  172. reset.yml;
  173. fi
  174. ## Idempotency checks 4/5 (redeploy after reset)
  175. - >
  176. if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
  177. ansible-playbook
  178. -i ${ANSIBLE_INVENTORY}
  179. -b --become-user=root
  180. --private-key=${HOME}/.ssh/id_rsa
  181. -u $SSH_USER
  182. ${SSH_ARGS}
  183. ${LOG_LEVEL}
  184. -e @${CI_TEST_VARS}
  185. -e ansible_python_interpreter=${PYPATH}
  186. -e local_release_dir=${PWD}/downloads
  187. --limit "all:!fake_hosts"
  188. cluster.yml;
  189. fi
  190. ## Idempotency checks 5/5 (Advanced DNS checks)
  191. - >
  192. if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
  193. ansible-playbook -i ${ANSIBLE_INVENTORY} -e ansible_python_interpreter=${PYPATH}
  194. -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root
  195. --limit "all:!fake_hosts"
  196. tests/testcases/040_check-network-adv.yml $LOG_LEVEL;
  197. fi
  198. after_script:
  199. - cd tests && make delete-${CI_PLATFORM} -s ; cd -
  200. .gce: &gce
  201. <<: *testcases
  202. variables:
  203. <<: *gce_variables
  204. .do: &do
  205. variables:
  206. <<: *do_variables
  207. <<: *testcases
  208. # Test matrix. Leave the comments for markup scripts.
  209. .coreos_calico_aio_variables: &coreos_calico_aio_variables
  210. # stage: deploy-part1
  211. MOVED_TO_GROUP_VARS: "true"
  212. .ubuntu18_flannel_aio_variables: &ubuntu18_flannel_aio_variables
  213. # stage: deploy-part1
  214. MOVED_TO_GROUP_VARS: "true"
  215. .centos_weave_kubeadm_variables: &centos_weave_kubeadm_variables
  216. # stage: deploy-part1
  217. UPGRADE_TEST: "graceful"
  218. .ubuntu_canal_kubeadm_variables: &ubuntu_canal_kubeadm_variables
  219. # stage: deploy-part1
  220. MOVED_TO_GROUP_VARS: "true"
  221. .ubuntu_canal_ha_variables: &ubuntu_canal_ha_variables
  222. # stage: deploy-special
  223. MOVED_TO_GROUP_VARS: "true"
  224. .ubuntu_contiv_sep_variables: &ubuntu_contiv_sep_variables
  225. # stage: deploy-special
  226. MOVED_TO_GROUP_VARS: "true"
  227. .coreos_cilium_variables: &coreos_cilium_variables
  228. # stage: deploy-special
  229. MOVED_TO_GROUP_VARS: "true"
  230. .ubuntu_cilium_sep_variables: &ubuntu_cilium_sep_variables
  231. # stage: deploy-special
  232. MOVED_TO_GROUP_VARS: "true"
  233. .rhel7_weave_variables: &rhel7_weave_variables
  234. # stage: deploy-part1
  235. MOVED_TO_GROUP_VARS: "true"
  236. .centos7_flannel_addons_variables: &centos7_flannel_addons_variables
  237. # stage: deploy-part2
  238. MOVED_TO_GROUP_VARS: "true"
  239. .debian9_calico_variables: &debian9_calico_variables
  240. # stage: deploy-part2
  241. MOVED_TO_GROUP_VARS: "true"
  242. .coreos_canal_variables: &coreos_canal_variables
  243. # stage: deploy-part2
  244. MOVED_TO_GROUP_VARS: "true"
  245. .rhel7_canal_sep_variables: &rhel7_canal_sep_variables
  246. # stage: deploy-special
  247. MOVED_TO_GROUP_VARS: "true"
  248. .ubuntu_weave_sep_variables: &ubuntu_weave_sep_variables
  249. # stage: deploy-special
  250. MOVED_TO_GROUP_VARS: "true"
  251. .centos7_calico_ha_variables: &centos7_calico_ha_variables
  252. # stage: deploy-special
  253. MOVED_TO_GROUP_VARS: "true"
  254. .centos7_kube_router_variables: &centos7_kube_router_variables
  255. # stage: deploy-special
  256. MOVED_TO_GROUP_VARS: "true"
  257. .centos7_multus_calico_variables: &centos7_multus_calico_variables
  258. # stage: deploy-part2
  259. UPGRADE_TEST: "graceful"
  260. .coreos_alpha_weave_ha_variables: &coreos_alpha_weave_ha_variables
  261. # stage: deploy-special
  262. MOVED_TO_GROUP_VARS: "true"
  263. .coreos_kube_router_variables: &coreos_kube_router_variables
  264. # stage: deploy-special
  265. MOVED_TO_GROUP_VARS: "true"
  266. .ubuntu_rkt_sep_variables: &ubuntu_rkt_sep_variables
  267. # stage: deploy-part1
  268. MOVED_TO_GROUP_VARS: "true"
  269. .ubuntu_flannel_variables: &ubuntu_flannel_variables
  270. # stage: deploy-part2
  271. MOVED_TO_GROUP_VARS: "true"
  272. .ubuntu_kube_router_variables: &ubuntu_kube_router_variables
  273. # stage: deploy-special
  274. MOVED_TO_GROUP_VARS: "true"
  275. .opensuse_canal_variables: &opensuse_canal_variables
  276. # stage: deploy-part2
  277. MOVED_TO_GROUP_VARS: "true"
  278. # Builds for PRs only (premoderated by unit-tests step) and triggers (auto)
  279. ### PR JOBS PART1
  280. gce_ubuntu18-flannel-aio:
  281. stage: deploy-part1
  282. <<: *job
  283. <<: *gce
  284. variables:
  285. <<: *ubuntu18_flannel_aio_variables
  286. <<: *gce_variables
  287. when: on_success
  288. except: ['triggers']
  289. only: [/^pr-.*$/]
  290. ### PR JOBS PART2
  291. gce_coreos-calico-aio:
  292. stage: deploy-part2
  293. <<: *job
  294. <<: *gce
  295. variables:
  296. <<: *coreos_calico_aio_variables
  297. <<: *gce_variables
  298. when: on_success
  299. except: ['triggers']
  300. only: [/^pr-.*$/]
  301. gce_centos7-flannel-addons:
  302. stage: deploy-part2
  303. <<: *job
  304. <<: *gce
  305. variables:
  306. <<: *gce_variables
  307. <<: *centos7_flannel_addons_variables
  308. when: on_success
  309. except: ['triggers']
  310. only: [/^pr-.*$/]
  311. ### MANUAL JOBS
  312. gce_centos-weave-kubeadm-sep:
  313. stage: deploy-part2
  314. <<: *job
  315. <<: *gce
  316. variables:
  317. <<: *gce_variables
  318. <<: *centos_weave_kubeadm_variables
  319. when: on_success
  320. only: ['triggers']
  321. gce_ubuntu-weave-sep:
  322. stage: deploy-part2
  323. <<: *job
  324. <<: *gce
  325. variables:
  326. <<: *gce_variables
  327. <<: *ubuntu_weave_sep_variables
  328. when: manual
  329. only: ['triggers']
  330. gce_coreos-calico-sep-triggers:
  331. stage: deploy-part2
  332. <<: *job
  333. <<: *gce
  334. variables:
  335. <<: *gce_variables
  336. <<: *coreos_calico_aio_variables
  337. when: on_success
  338. only: ['triggers']
  339. gce_ubuntu-canal-ha-triggers:
  340. stage: deploy-special
  341. <<: *job
  342. <<: *gce
  343. variables:
  344. <<: *gce_variables
  345. <<: *ubuntu_canal_ha_variables
  346. when: on_success
  347. only: ['triggers']
  348. gce_centos7-flannel-addons-triggers:
  349. stage: deploy-part2
  350. <<: *job
  351. <<: *gce
  352. variables:
  353. <<: *gce_variables
  354. <<: *centos7_flannel_addons_variables
  355. when: on_success
  356. only: ['triggers']
  357. gce_ubuntu-weave-sep-triggers:
  358. stage: deploy-part2
  359. <<: *job
  360. <<: *gce
  361. variables:
  362. <<: *gce_variables
  363. <<: *ubuntu_weave_sep_variables
  364. when: on_success
  365. only: ['triggers']
  366. # More builds for PRs/merges (manual) and triggers (auto)
  367. do_ubuntu-canal-ha:
  368. stage: deploy-part2
  369. <<: *job
  370. <<: *do
  371. variables:
  372. <<: *do_variables
  373. when: manual
  374. except: ['triggers']
  375. only: ['master', /^pr-.*$/]
  376. gce_ubuntu-canal-ha:
  377. stage: deploy-special
  378. <<: *job
  379. <<: *gce
  380. variables:
  381. <<: *gce_variables
  382. <<: *ubuntu_canal_ha_variables
  383. when: manual
  384. except: ['triggers']
  385. only: ['master', /^pr-.*$/]
  386. gce_ubuntu-canal-kubeadm:
  387. stage: deploy-part2
  388. <<: *job
  389. <<: *gce
  390. variables:
  391. <<: *gce_variables
  392. <<: *ubuntu_canal_kubeadm_variables
  393. when: manual
  394. except: ['triggers']
  395. only: ['master', /^pr-.*$/]
  396. gce_ubuntu-canal-kubeadm-triggers:
  397. stage: deploy-part2
  398. <<: *job
  399. <<: *gce
  400. variables:
  401. <<: *gce_variables
  402. <<: *ubuntu_canal_kubeadm_variables
  403. when: on_success
  404. only: ['triggers']
  405. gce_ubuntu-flannel-ha:
  406. stage: deploy-part2
  407. <<: *job
  408. <<: *gce
  409. variables:
  410. <<: *gce_variables
  411. <<: *ubuntu_flannel_variables
  412. when: manual
  413. except: ['triggers']
  414. gce_centos-weave-kubeadm-triggers:
  415. stage: deploy-part2
  416. <<: *job
  417. <<: *gce
  418. variables:
  419. <<: *gce_variables
  420. <<: *centos_weave_kubeadm_variables
  421. when: on_success
  422. only: ['triggers']
  423. gce_ubuntu-contiv-sep:
  424. stage: deploy-special
  425. <<: *job
  426. <<: *gce
  427. variables:
  428. <<: *gce_variables
  429. <<: *ubuntu_contiv_sep_variables
  430. when: manual
  431. except: ['triggers']
  432. only: ['master', /^pr-.*$/]
  433. gce_coreos-cilium:
  434. stage: deploy-special
  435. <<: *job
  436. <<: *gce
  437. variables:
  438. <<: *gce_variables
  439. <<: *coreos_cilium_variables
  440. when: manual
  441. except: ['triggers']
  442. only: ['master', /^pr-.*$/]
  443. gce_ubuntu-cilium-sep:
  444. stage: deploy-special
  445. <<: *job
  446. <<: *gce
  447. variables:
  448. <<: *gce_variables
  449. <<: *ubuntu_cilium_sep_variables
  450. when: manual
  451. except: ['triggers']
  452. only: ['master', /^pr-.*$/]
  453. gce_rhel7-weave:
  454. stage: deploy-part2
  455. <<: *job
  456. <<: *gce
  457. variables:
  458. <<: *gce_variables
  459. <<: *rhel7_weave_variables
  460. when: manual
  461. except: ['triggers']
  462. only: ['master', /^pr-.*$/]
  463. gce_rhel7-weave-triggers:
  464. stage: deploy-part2
  465. <<: *job
  466. <<: *gce
  467. variables:
  468. <<: *gce_variables
  469. <<: *rhel7_weave_variables
  470. when: on_success
  471. only: ['triggers']
  472. gce_debian9-calico-upgrade:
  473. stage: deploy-part2
  474. <<: *job
  475. <<: *gce
  476. variables:
  477. <<: *gce_variables
  478. <<: *debian9_calico_variables
  479. when: manual
  480. except: ['triggers']
  481. only: ['master', /^pr-.*$/]
  482. gce_debian9-calico-triggers:
  483. stage: deploy-part2
  484. <<: *job
  485. <<: *gce
  486. variables:
  487. <<: *gce_variables
  488. <<: *debian9_calico_variables
  489. when: on_success
  490. only: ['triggers']
  491. gce_coreos-canal:
  492. stage: deploy-part2
  493. <<: *job
  494. <<: *gce
  495. variables:
  496. <<: *gce_variables
  497. <<: *coreos_canal_variables
  498. when: manual
  499. except: ['triggers']
  500. only: ['master', /^pr-.*$/]
  501. gce_coreos-canal-triggers:
  502. stage: deploy-part2
  503. <<: *job
  504. <<: *gce
  505. variables:
  506. <<: *gce_variables
  507. <<: *coreos_canal_variables
  508. when: on_success
  509. only: ['triggers']
  510. gce_rhel7-canal-sep:
  511. stage: deploy-special
  512. <<: *job
  513. <<: *gce
  514. variables:
  515. <<: *gce_variables
  516. <<: *rhel7_canal_sep_variables
  517. when: manual
  518. except: ['triggers']
  519. only: ['master', /^pr-.*$/]
  520. gce_rhel7-canal-sep-triggers:
  521. stage: deploy-part2
  522. <<: *job
  523. <<: *gce
  524. variables:
  525. <<: *gce_variables
  526. <<: *rhel7_canal_sep_variables
  527. when: on_success
  528. only: ['triggers']
  529. gce_centos7-calico-ha:
  530. stage: deploy-special
  531. <<: *job
  532. <<: *gce
  533. variables:
  534. <<: *gce_variables
  535. <<: *centos7_calico_ha_variables
  536. when: manual
  537. except: ['triggers']
  538. only: ['master', /^pr-.*$/]
  539. gce_centos7-calico-ha-triggers:
  540. stage: deploy-part2
  541. <<: *job
  542. <<: *gce
  543. variables:
  544. <<: *gce_variables
  545. <<: *centos7_calico_ha_variables
  546. when: on_success
  547. only: ['triggers']
  548. gce_centos7-kube-router:
  549. stage: deploy-special
  550. <<: *job
  551. <<: *gce
  552. variables:
  553. <<: *gce_variables
  554. <<: *centos7_kube_router_variables
  555. when: manual
  556. except: ['triggers']
  557. only: ['master', /^pr-.*$/]
  558. gce_centos7-multus-calico:
  559. stage: deploy-part2
  560. <<: *job
  561. <<: *gce
  562. variables:
  563. <<: *gce_variables
  564. <<: *centos7_multus_calico_variables
  565. when: manual
  566. except: ['triggers']
  567. only: ['master', /^pr-.*$/]
  568. gce_opensuse-canal:
  569. stage: deploy-part2
  570. <<: *job
  571. <<: *gce
  572. variables:
  573. <<: *gce_variables
  574. <<: *opensuse_canal_variables
  575. when: manual
  576. except: ['triggers']
  577. only: ['master', /^pr-.*$/]
  578. # no triggers yet https://github.com/kubernetes-incubator/kargo/issues/613
  579. gce_coreos-alpha-weave-ha:
  580. stage: deploy-special
  581. <<: *job
  582. <<: *gce
  583. variables:
  584. <<: *gce_variables
  585. <<: *coreos_alpha_weave_ha_variables
  586. when: manual
  587. except: ['triggers']
  588. only: ['master', /^pr-.*$/]
  589. gce_coreos-kube-router:
  590. stage: deploy-special
  591. <<: *job
  592. <<: *gce
  593. variables:
  594. <<: *gce_variables
  595. <<: *coreos_kube_router_variables
  596. when: manual
  597. except: ['triggers']
  598. only: ['master', /^pr-.*$/]
  599. gce_ubuntu-rkt-sep:
  600. stage: deploy-part2
  601. <<: *job
  602. <<: *gce
  603. variables:
  604. <<: *gce_variables
  605. <<: *ubuntu_rkt_sep_variables
  606. when: manual
  607. except: ['triggers']
  608. only: ['master', /^pr-.*$/]
  609. gce_ubuntu-kube-router-sep:
  610. stage: deploy-special
  611. <<: *job
  612. <<: *gce
  613. variables:
  614. <<: *gce_variables
  615. <<: *ubuntu_kube_router_variables
  616. when: manual
  617. except: ['triggers']
  618. only: ['master', /^pr-.*$/]
  619. # Premoderated with manual actions
  620. ci-authorized:
  621. <<: *job
  622. stage: moderator
  623. before_script:
  624. - apt-get -y install jq
  625. script:
  626. - /bin/sh scripts/premoderator.sh
  627. except: ['triggers', 'master']
  628. syntax-check:
  629. <<: *job
  630. stage: unit-tests
  631. script:
  632. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root cluster.yml -vvv --syntax-check
  633. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root upgrade-cluster.yml -vvv --syntax-check
  634. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root reset.yml -vvv --syntax-check
  635. - ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root extra_playbooks/upgrade-only-k8s.yml -vvv --syntax-check
  636. except: ['triggers', 'master']
  637. yamllint:
  638. <<: *job
  639. stage: unit-tests
  640. script:
  641. - yamllint .
  642. except: ['triggers', 'master']
  643. tox-inventory-builder:
  644. stage: unit-tests
  645. <<: *job
  646. script:
  647. - pip install tox
  648. - cd contrib/inventory_builder && tox
  649. when: manual
  650. except: ['triggers', 'master']
  651. # Tests for contrib/terraform/
  652. .terraform_install: &terraform_install
  653. <<: *job
  654. before_script:
  655. # Set Ansible config
  656. - cp ansible.cfg ~/.ansible.cfg
  657. # Install Terraform
  658. - apt-get install -y unzip
  659. - curl https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip > /tmp/terraform.zip
  660. - unzip /tmp/terraform.zip && mv ./terraform /usr/local/bin/ && terraform --version
  661. # Prepare inventory
  662. - cp -LRp contrib/terraform/$PROVIDER/sample-inventory inventory/$CLUSTER
  663. - cd inventory/$CLUSTER
  664. - ln -s ../../contrib/terraform/$PROVIDER/hosts
  665. - terraform init ../../contrib/terraform/$PROVIDER
  666. # Copy SSH keypair
  667. - mkdir -p ~/.ssh
  668. - echo "$PACKET_PRIVATE_KEY" | base64 -d > ~/.ssh/id_rsa
  669. - chmod 400 ~/.ssh/id_rsa
  670. - echo "$PACKET_PUBLIC_KEY" | base64 -d > ~/.ssh/id_rsa.pub
  671. - export TF_VAR_public_key_path=""
  672. only: ['master', /^pr-.*$/]
  673. .terraform_validate: &terraform_validate
  674. <<: *terraform_install
  675. stage: unit-tests
  676. script:
  677. - terraform validate -var-file=cluster.tf ../../contrib/terraform/$PROVIDER
  678. .terraform_apply: &terraform_apply
  679. <<: *terraform_install
  680. stage: deploy-part2
  681. when: manual
  682. script:
  683. - terraform apply -auto-approve ../../contrib/terraform/$PROVIDER
  684. - ansible-playbook -i hosts ../../cluster.yml
  685. after_script:
  686. # Cleanup regardless of exit code
  687. - cd inventory/$CLUSTER
  688. - terraform destroy -auto-approve ../../contrib/terraform/$PROVIDER
  689. tf-validate-openstack:
  690. <<: *terraform_validate
  691. variables:
  692. TF_VERSION: 0.11.11
  693. PROVIDER: openstack
  694. CLUSTER: $CI_COMMIT_REF_NAME
  695. tf-validate-packet:
  696. <<: *terraform_validate
  697. variables:
  698. TF_VERSION: 0.11.11
  699. PROVIDER: packet
  700. CLUSTER: $CI_COMMIT_REF_NAME
  701. tf-apply-packet:
  702. <<: *terraform_apply
  703. variables:
  704. TF_VERSION: 0.11.11
  705. PROVIDER: packet
  706. CLUSTER: $CI_COMMIT_REF_NAME
  707. TF_VAR_cluster_name: $CI_COMMIT_REF_NAME
  708. TF_VAR_number_of_k8s_masters: "1"
  709. TF_VAR_number_of_k8s_nodes: "1"
  710. TF_VAR_plan_k8s_masters: t1.small.x86
  711. TF_VAR_plan_k8s_nodes: t1.small.x86
  712. TF_VAR_facility: "ewr1"