2016-11-18 12:29:03 +00:00
|
|
|
sudo: required
|
|
|
|
|
|
|
|
services:
|
|
|
|
- docker
|
2015-12-22 10:50:55 +00:00
|
|
|
|
2016-02-10 10:51:39 +00:00
|
|
|
git:
|
|
|
|
depth: 5
|
2015-12-22 10:50:55 +00:00
|
|
|
|
|
|
|
env:
|
2016-02-10 10:51:39 +00:00
|
|
|
global:
|
|
|
|
GCE_USER=travis
|
|
|
|
SSH_USER=$GCE_USER
|
|
|
|
TEST_ID=$TRAVIS_JOB_NUMBER
|
|
|
|
CONTAINER_ENGINE=docker
|
|
|
|
PRIVATE_KEY=$GCE_PRIVATE_KEY
|
2016-11-03 12:57:33 +00:00
|
|
|
GS_ACCESS_KEY_ID=$GS_KEY
|
|
|
|
GS_SECRET_ACCESS_KEY=$GS_SECRET
|
2016-02-10 10:51:39 +00:00
|
|
|
ANSIBLE_KEEP_REMOTE_FILES=1
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=default
|
2016-11-15 17:17:30 +00:00
|
|
|
BOOTSTRAP_OS=none
|
2016-02-10 10:51:39 +00:00
|
|
|
matrix:
|
|
|
|
# Debian Jessie
|
|
|
|
- >-
|
2016-11-29 17:33:25 +00:00
|
|
|
KUBE_NETWORK_PLUGIN=canal
|
2016-11-29 09:25:07 +00:00
|
|
|
CLOUD_IMAGE=debian-8
|
2016-11-29 17:33:25 +00:00
|
|
|
CLOUD_REGION=europe-west1-d
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=default
|
2016-02-10 10:51:39 +00:00
|
|
|
- >-
|
|
|
|
KUBE_NETWORK_PLUGIN=calico
|
2016-11-29 09:25:07 +00:00
|
|
|
CLOUD_IMAGE=debian-8
|
2016-11-29 17:33:25 +00:00
|
|
|
CLOUD_REGION=us-central1-b
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=default
|
2015-12-22 10:50:55 +00:00
|
|
|
|
2016-02-10 10:51:39 +00:00
|
|
|
# Centos 7
|
|
|
|
- >-
|
|
|
|
KUBE_NETWORK_PLUGIN=flannel
|
2016-11-29 09:25:07 +00:00
|
|
|
CLOUD_IMAGE=centos-7
|
2016-11-29 17:33:25 +00:00
|
|
|
CLOUD_REGION=europe-west1-d
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=default
|
2016-02-13 14:48:18 +00:00
|
|
|
- >-
|
|
|
|
KUBE_NETWORK_PLUGIN=calico
|
2016-11-29 09:25:07 +00:00
|
|
|
CLOUD_IMAGE=centos-7
|
2016-02-24 10:33:41 +00:00
|
|
|
CLOUD_REGION=europe-west1-b
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=default
|
2016-02-10 10:51:39 +00:00
|
|
|
|
2016-02-13 14:48:18 +00:00
|
|
|
# Redhat 7
|
|
|
|
- >-
|
|
|
|
KUBE_NETWORK_PLUGIN=weave
|
2016-11-29 09:25:07 +00:00
|
|
|
CLOUD_IMAGE=rhel-7
|
2016-02-24 10:33:41 +00:00
|
|
|
CLOUD_REGION=europe-west1-b
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=default
|
2016-02-10 10:51:39 +00:00
|
|
|
|
2016-11-15 17:17:30 +00:00
|
|
|
# CoreOS stable
|
2016-11-29 17:33:25 +00:00
|
|
|
#- >-
|
|
|
|
# KUBE_NETWORK_PLUGIN=weave
|
|
|
|
# CLOUD_IMAGE=coreos-stable
|
|
|
|
# CLOUD_REGION=europe-west1-a
|
|
|
|
# CLUSTER_MODE=default
|
|
|
|
# BOOTSTRAP_OS=coreos
|
2016-11-15 17:17:30 +00:00
|
|
|
- >-
|
|
|
|
KUBE_NETWORK_PLUGIN=canal
|
|
|
|
CLOUD_IMAGE=coreos-stable
|
|
|
|
CLOUD_REGION=us-east1-d
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=default
|
2016-11-15 17:17:30 +00:00
|
|
|
BOOTSTRAP_OS=coreos
|
2016-02-10 22:02:12 +00:00
|
|
|
|
2016-10-28 12:56:48 +00:00
|
|
|
# Extra cases for separated roles
|
2016-02-11 22:08:16 +00:00
|
|
|
- >-
|
2016-11-15 17:17:30 +00:00
|
|
|
KUBE_NETWORK_PLUGIN=canal
|
2016-11-29 09:25:07 +00:00
|
|
|
CLOUD_IMAGE=rhel-7
|
2016-11-29 17:33:25 +00:00
|
|
|
CLOUD_REGION=europe-west1-c
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=separate
|
2016-02-11 22:08:16 +00:00
|
|
|
- >-
|
|
|
|
KUBE_NETWORK_PLUGIN=weave
|
2016-11-29 17:33:25 +00:00
|
|
|
CLOUD_IMAGE=ubuntu-1604-xenial
|
|
|
|
CLOUD_REGION=us-west1-b
|
2016-10-28 12:56:48 +00:00
|
|
|
CLUSTER_MODE=separate
|
2016-11-15 17:17:30 +00:00
|
|
|
- >-
|
|
|
|
KUBE_NETWORK_PLUGIN=calico
|
|
|
|
CLOUD_IMAGE=coreos-stable
|
2016-11-29 17:33:25 +00:00
|
|
|
CLOUD_REGION=us-central1-f
|
2016-11-15 17:17:30 +00:00
|
|
|
CLUSTER_MODE=separate
|
|
|
|
BOOTSTRAP_OS=coreos
|
2016-02-10 10:51:39 +00:00
|
|
|
|
2016-11-18 16:13:33 +00:00
|
|
|
matrix:
|
|
|
|
allow_failures:
|
2016-11-29 17:33:25 +00:00
|
|
|
- env: KUBE_NETWORK_PLUGIN=weave CLOUD_IMAGE=coreos-stable CLOUD_REGION=europe-west1-a CLUSTER_MODE=default BOOTSTRAP_OS=coreos
|
2016-02-10 10:51:39 +00:00
|
|
|
|
|
|
|
before_install:
|
2015-12-22 10:50:55 +00:00
|
|
|
# Install Ansible.
|
2016-02-10 10:51:39 +00:00
|
|
|
- pip install --user ansible
|
|
|
|
- pip install --user netaddr
|
2016-10-28 12:56:48 +00:00
|
|
|
# W/A https://github.com/ansible/ansible-modules-core/issues/5196#issuecomment-253766186
|
|
|
|
- pip install --user apache-libcloud==0.20.1
|
2016-11-09 13:15:27 +00:00
|
|
|
- pip install --user boto==2.9.0 -U
|
2016-11-18 12:29:03 +00:00
|
|
|
# Load cached docker images
|
|
|
|
- if [ -d /var/tmp/releases ]; then find /var/tmp/releases -type f -name "*.tar" | xargs -I {} sh -c "zcat {} | docker load"; fi
|
2015-12-22 10:50:55 +00:00
|
|
|
|
|
|
|
cache:
|
2016-02-10 10:51:39 +00:00
|
|
|
- directories:
|
2015-12-22 10:50:55 +00:00
|
|
|
- $HOME/.cache/pip
|
2016-02-10 10:51:39 +00:00
|
|
|
- $HOME/.local
|
2016-11-16 10:59:39 +00:00
|
|
|
- /var/tmp/releases
|
2015-12-22 10:50:55 +00:00
|
|
|
|
|
|
|
before_script:
|
2016-02-10 10:51:39 +00:00
|
|
|
- echo "RUN $TRAVIS_JOB_NUMBER $KUBE_NETWORK_PLUGIN $CONTAINER_ENGINE "
|
|
|
|
- mkdir -p $HOME/.ssh
|
|
|
|
- echo $PRIVATE_KEY | base64 -d > $HOME/.ssh/id_rsa
|
|
|
|
- echo $GCE_PEM_FILE | base64 -d > $HOME/.ssh/gce
|
|
|
|
- chmod 400 $HOME/.ssh/id_rsa
|
|
|
|
- chmod 755 $HOME/.local/bin/ansible-playbook
|
|
|
|
- $HOME/.local/bin/ansible-playbook --version
|
|
|
|
- cp tests/ansible.cfg .
|
2016-11-15 17:17:30 +00:00
|
|
|
- export PYPATH=$([ $BOOTSTRAP_OS = none ] && echo /usr/bin/python || echo /opt/bin/python)
|
2016-02-10 10:51:39 +00:00
|
|
|
# - "echo $HOME/.local/bin/ansible-playbook -i inventory.ini -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root -e '{\"cloud_provider\": true}' $LOG_LEVEL -e kube_network_plugin=${KUBE_NETWORK_PLUGIN} setup-kubernetes/cluster.yml"
|
2015-12-22 10:50:55 +00:00
|
|
|
|
|
|
|
script:
|
2016-02-10 10:51:39 +00:00
|
|
|
- >
|
2016-10-28 12:56:48 +00:00
|
|
|
$HOME/.local/bin/ansible-playbook tests/cloud_playbooks/create-gce.yml -i tests/local_inventory/hosts.cfg -c local $LOG_LEVEL
|
|
|
|
-e mode=${CLUSTER_MODE}
|
2016-02-10 10:51:39 +00:00
|
|
|
-e test_id=${TEST_ID}
|
|
|
|
-e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
|
|
|
|
-e gce_project_id=${GCE_PROJECT_ID}
|
|
|
|
-e gce_service_account_email=${GCE_ACCOUNT}
|
|
|
|
-e gce_pem_file=${HOME}/.ssh/gce
|
|
|
|
-e cloud_image=${CLOUD_IMAGE}
|
|
|
|
-e inventory_path=${PWD}/inventory/inventory.ini
|
|
|
|
-e cloud_region=${CLOUD_REGION}
|
2015-12-22 10:50:55 +00:00
|
|
|
|
2016-02-10 10:51:39 +00:00
|
|
|
# Create cluster
|
2016-11-15 17:17:30 +00:00
|
|
|
- >
|
|
|
|
$HOME/.local/bin/ansible-playbook -i inventory/inventory.ini -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS
|
|
|
|
-b --become-user=root -e cloud_provider=gce $LOG_LEVEL -e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
|
|
|
|
-e bootstrap_os=${BOOTSTRAP_OS}
|
|
|
|
-e ansible_python_interpreter=${PYPATH}
|
2016-11-16 10:59:39 +00:00
|
|
|
-e download_run_once=true
|
2016-11-18 12:29:03 +00:00
|
|
|
-e download_localhost=true
|
2016-11-16 10:59:39 +00:00
|
|
|
-e local_release_dir=/var/tmp/releases
|
2016-11-15 17:17:30 +00:00
|
|
|
cluster.yml
|
|
|
|
|
2016-02-10 10:51:39 +00:00
|
|
|
# Tests Cases
|
|
|
|
## Test Master API
|
2016-11-15 17:17:30 +00:00
|
|
|
- $HOME/.local/bin/ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH} tests/testcases/010_check-apiserver.yml $LOG_LEVEL
|
2016-02-10 10:51:39 +00:00
|
|
|
## Create a POD
|
2016-11-15 17:17:30 +00:00
|
|
|
- $HOME/.local/bin/ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root tests/testcases/020_check-create-pod.yml $LOG_LEVEL
|
2016-02-10 10:51:39 +00:00
|
|
|
## Ping the between 2 pod
|
2016-11-15 17:17:30 +00:00
|
|
|
- $HOME/.local/bin/ansible-playbook -i inventory/inventory.ini -e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root tests/testcases/030_check-network.yml $LOG_LEVEL
|
2016-11-03 12:57:33 +00:00
|
|
|
|
2016-02-10 10:51:39 +00:00
|
|
|
after_script:
|
2015-12-22 10:50:55 +00:00
|
|
|
- >
|
2016-02-10 10:51:39 +00:00
|
|
|
$HOME/.local/bin/ansible-playbook -i inventory/inventory.ini tests/cloud_playbooks/delete-gce.yml -c local $LOG_LEVEL
|
|
|
|
-e test_id=${TEST_ID}
|
|
|
|
-e kube_network_plugin=${KUBE_NETWORK_PLUGIN}
|
|
|
|
-e gce_project_id=${GCE_PROJECT_ID}
|
|
|
|
-e gce_service_account_email=${GCE_ACCOUNT}
|
|
|
|
-e gce_pem_file=${HOME}/.ssh/gce
|
|
|
|
-e cloud_image=${CLOUD_IMAGE}
|
|
|
|
-e inventory_path=${PWD}/inventory/inventory.ini
|
|
|
|
-e cloud_region=${CLOUD_REGION}
|