Add Elastx CI (#6127)

This commit is contained in:
Maxime Guyot 2020-06-03 09:00:17 +02:00 committed by GitHub
parent 0b54e8e04c
commit fd59556222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 69 additions and 14 deletions

View file

@ -18,6 +18,7 @@
- echo "$PACKET_PRIVATE_KEY" | base64 -d > ~/.ssh/id_rsa - echo "$PACKET_PRIVATE_KEY" | base64 -d > ~/.ssh/id_rsa
- chmod 400 ~/.ssh/id_rsa - chmod 400 ~/.ssh/id_rsa
- echo "$PACKET_PUBLIC_KEY" | base64 -d > ~/.ssh/id_rsa.pub - echo "$PACKET_PUBLIC_KEY" | base64 -d > ~/.ssh/id_rsa.pub
- mkdir -p group_vars
.terraform_validate: .terraform_validate:
extends: .terraform_install extends: .terraform_install
@ -109,16 +110,63 @@ tf-validate-aws:
# OS_INTERFACE: public # OS_INTERFACE: public
# OS_IDENTITY_API_VERSION: "3" # OS_IDENTITY_API_VERSION: "3"
# tf-ovh_cleanup: # Elastx is generously donating resources for Kubespray on Openstack CI
# stage: unit-tests # Contacts: @gix @bl0m1
# tags: [light] .elastx_variables: &elastx_variables
# image: python OS_AUTH_URL: https://ops.elastx.cloud:5000
# variables: OS_PROJECT_ID: 564c6b461c6b44b1bb19cdb9c2d928e4
# <<: *ovh_variables OS_PROJECT_NAME: kubespray_ci
# before_script: OS_USER_DOMAIN_NAME: Default
# - pip install -r scripts/openstack-cleanup/requirements.txt OS_PROJECT_DOMAIN_ID: default
# script: OS_USERNAME: kubespray@root314.com
# - ./scripts/openstack-cleanup/main.py OS_REGION_NAME: se-sto
OS_INTERFACE: public
OS_IDENTITY_API_VERSION: "3"
TF_VAR_router_id: "ab95917c-41fb-4881-b507-3a6dfe9403df"
# Since ELASTX is in Stockholm, Mitogen helps with latency
MITOGEN_ENABLE: "true"
tf-elastx_cleanup:
stage: unit-tests
tags: [light]
image: python
variables:
<<: *elastx_variables
before_script:
- pip install -r scripts/openstack-cleanup/requirements.txt
script:
- ./scripts/openstack-cleanup/main.py
tf-elastx_ubuntu18-calico:
extends: .terraform_apply
when: on_success
variables:
<<: *elastx_variables
TF_VERSION: 0.12.24
PROVIDER: openstack
CLUSTER: $CI_COMMIT_REF_NAME
ANSIBLE_TIMEOUT: "60"
SSH_USER: ubuntu
TF_VAR_number_of_k8s_masters: "1"
TF_VAR_number_of_k8s_masters_no_floating_ip: "0"
TF_VAR_number_of_k8s_masters_no_floating_ip_no_etcd: "0"
TF_VAR_number_of_etcd: "0"
TF_VAR_number_of_k8s_nodes: "1"
TF_VAR_number_of_k8s_nodes_no_floating_ip: "0"
TF_VAR_number_of_gfs_nodes_no_floating_ip: "0"
TF_VAR_number_of_bastions: "0"
TF_VAR_number_of_k8s_masters_no_etcd: "0"
TF_VAR_floatingip_pool: "elx-public1"
TF_VAR_dns_nameservers: '["1.1.1.1", "8.8.8.8", "8.8.4.4"]'
TF_VAR_use_access_ip: "0"
TF_VAR_external_net: "600b8501-78cb-4155-9c9f-23dfcba88828"
TF_VAR_network_name: "ci-$CI_JOB_ID"
TF_VAR_az_list: '["sto1"]'
TF_VAR_az_list_node: '["sto1"]'
TF_VAR_flavor_k8s_master: 3f73fc93-ec61-4808-88df-2580d94c1a9b # v1-standard-2
TF_VAR_flavor_k8s_node: 3f73fc93-ec61-4808-88df-2580d94c1a9b # v1-standard-2
TF_VAR_image: ubuntu-18.04-server-latest
TF_VAR_k8s_allowed_remote_ips: '["0.0.0.0/0"]'
# tf-ovh_ubuntu18-calico: # tf-ovh_ubuntu18-calico:
# extends: .terraform_apply # extends: .terraform_apply

View file

@ -0,0 +1,7 @@
---
dns_min_replicas: 1
deploy_netchecker: true
sonobuoy_enabled: true
# Ignore ping errors
ignore_assert_errors: true

View file

@ -2,4 +2,4 @@
set -euxo pipefail set -euxo pipefail
cd .. cd ..
terraform apply -auto-approve "contrib/terraform/$PROVIDER" terraform apply -auto-approve -parallelism=1 "contrib/terraform/$PROVIDER"

View file

@ -188,7 +188,7 @@
EOF EOF
when: when:
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|bool|default(false) - kube_network_plugin_multus|default(false)|bool
- name: Annotate pod with macvlan network - name: Annotate pod with macvlan network
# We cannot use only shell: below because Ansible will render the text # We cannot use only shell: below because Ansible will render the text
@ -212,7 +212,7 @@
EOF EOF
when: when:
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|bool|default(false) - kube_network_plugin_multus|default(false)|bool
- name: Check secondary macvlan interface - name: Check secondary macvlan interface
shell: "{{ bin_dir }}/kubectl exec samplepod -- ip addr show dev net1" shell: "{{ bin_dir }}/kubectl exec samplepod -- ip addr show dev net1"
@ -222,4 +222,4 @@
changed_when: false changed_when: false
when: when:
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- kube_network_plugin_multus|bool|default(false) - kube_network_plugin_multus|default(false)|bool