Remove unused smoke tests and Jenkinsfile

* Matchbox has unit tests. It is no longer tested by
provisioning full Kubernetes clusters, since that's a
sizeable undertaking
This commit is contained in:
Dalton Hubble
2019-03-10 22:40:07 -07:00
parent 8e3855bbb3
commit c1d4c53c2c
11 changed files with 0 additions and 430 deletions

63
Jenkinsfile vendored
View File

@@ -1,63 +0,0 @@
pipeline {
agent none
options {
timeout(time:45, unit:'MINUTES')
buildDiscarder(logRotator(numToKeepStr:'20'))
}
stages {
stage('Cluster Tests') {
steps {
parallel (
etcd3: {
node('fedora && bare-metal') {
timeout(time:5, unit:'MINUTES') {
checkout scm
sh '''#!/bin/bash -e
export ASSETS_DIR=~/assets; ./tests/smoke/etcd3
'''
deleteDir()
}
}
},
bootkube: {
node('fedora && bare-metal') {
timeout(time:60, unit:'MINUTES') {
checkout scm
sh '''#!/bin/bash -e
chmod 600 ./tests/smoke/fake_rsa
export ASSETS_DIR=~/assets; ./tests/smoke/bootkube
'''
deleteDir()
}
}
},
"etcd3-terraform": {
node('fedora && bare-metal') {
timeout(time:10, unit:'MINUTES') {
checkout scm
sh '''#!/bin/bash -e
export ASSETS_DIR=~/assets; export CONFIG_DIR=~/matchbox/examples/etc/matchbox; ./tests/smoke/etcd3-terraform
'''
deleteDir()
}
}
},
"bootkube-terraform": {
node('fedora && bare-metal') {
timeout(time:60, unit:'MINUTES') {
checkout scm
sh '''#!/bin/bash -e
chmod 600 ./tests/smoke/fake_rsa
export ASSETS_DIR=~/assets; export CONFIG_DIR=~/matchbox/examples/etc/matchbox; ./tests/smoke/bootkube-terraform
'''
deleteDir()
}
}
},
)
}
}
}
}

View File

@@ -1,85 +0,0 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/common"
main() {
rm -rf assets
cleanup
trap cleanup EXIT
./scripts/dev/get-kubectl
./scripts/dev/get-bootkube
./scripts/devnet create bootkube
./scripts/libvirt create
echo "bootkube render"
./bin/bootkube render --asset-dir=assets --api-servers=https://node1.example.com:443 --api-server-alt-names=DNS=node1.example.com --etcd-servers=https://node1.example.com:2379
for i in `seq 1 10`; do
ssh node1.example.com -o ConnectTimeout=5 -- 'echo "Connected"' && break
echo "Waiting for nodes to PXE boot..."
sleep 10
done
echo "Add etcd certs to nodes"
for node in 'node1'; do
scp -r assets/tls/etcd-* assets/tls/etcd core@$node.example.com:/home/core/
ssh core@$node.example.com 'sudo mkdir -p /etc/ssl/etcd && sudo mv etcd-* etcd /etc/ssl/etcd/ && sudo chown -R etcd:etcd /etc/ssl/etcd && sudo chmod -R 500 /etc/ssl/etcd/'
done
echo "Add kubeconfig to nodes"
for node in 'node1' 'node2' 'node3'; do
scp assets/auth/kubeconfig core@${node}.example.com:/home/core/kubeconfig
ssh core@${node}.example.com 'sudo mv kubeconfig /etc/kubernetes/kubeconfig'
done
until kubelet "node1.example.com" \
&& kubelet "node2.example.com" \
&& kubelet "node3.example.com"
do
sleep 10
echo "Waiting for Kubelets to start..."
done
echo "bootkube start"
scp -r assets core@node1.example.com:/home/core
ssh core@node1.example.com 'sudo mv assets /opt/bootkube/assets && sudo systemctl start bootkube'
until [[ "$(readyNodes)" == "3" ]]; do
sleep 5
echo "$(readyNodes) of 3 nodes are Ready..."
done
echo "Getting nodes..."
k8s get nodes || true
sleep 10
echo "Getting pods..."
k8s get pods --all-namespaces || true
echo "bootkube cluster came up!"
echo
rm -rf assets
cleanup
}
ssh() {
command ssh -i ${DIR}/fake_rsa -o stricthostkeychecking=no "$@"
}
scp() {
command scp -i ${DIR}/fake_rsa -o stricthostkeychecking=no "$@"
}
k8s() {
./bin/kubectl --kubeconfig=assets/auth/kubeconfig "$@"
}
readyNodes() {
k8s get nodes -o template --template='{{range .items}}{{range .status.conditions}}{{if eq .type "Ready"}}{{.}}{{end}}{{end}}{{end}}' | grep -o -E True | wc -l
}
main $@

View File

@@ -1,75 +0,0 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/common"
main() {
cleanup
trap cleanup EXIT
./scripts/dev/get-kubectl
./scripts/devnet create
# Add fake_rsa to ssh-agent
eval `ssh-agent -s`
chmod 600 ${DIR}/fake_rsa
ssh-add ${DIR}/fake_rsa
# Terraform apply to push resources to matchbox, don't wait for ssh
pushd examples/terraform/bootkube-install
terraform get
# Terraform should properly shutdown with a SIGINT
timeout 15 -s SIGINT --kill-after=20 /usr/local/bin/terraform apply -var-file ${DIR}/bootkube.tfvars || true
popd
# PXE boot QEMU/KVM VMs
./scripts/libvirt create
# Terraform apply and loop until it copies assets and bootstrapping succeeds
pushd examples/terraform/bootkube-install
until terraform apply -var-file ${DIR}/bootkube.tfvars; do
echo "Wait and retry terraform apply (copy-kubeconfig is expected to error loop)"
sleep 10
done
popd
until [[ "$(readyNodes)" == "3" ]]; do
sleep 5
echo "$(readyNodes) of 3 nodes are Ready..."
done
echo "Getting nodes..."
k8s get nodes || true
sleep 10
echo "Getting pods..."
k8s get pods --all-namespaces || true
echo "bootkube cluster came up!"
echo
rm -rf assets
cleanup
}
k8s() {
./bin/kubectl --kubeconfig=examples/terraform/bootkube-install/assets/auth/kubeconfig "$@"
}
readyNodes() {
k8s get nodes -o template --template='{{range .items}}{{range .status.conditions}}{{if eq .type "Ready"}}{{.}}{{end}}{{end}}{{end}}' | grep -o -E True | wc -l
}
cleanup() {
popd || true
./scripts/libvirt destroy || true
./scripts/devnet destroy || true
rkt gc --grace-period=0
pushd examples/terraform/bootkube-install
rm -f *.tfstate*
rm -rf assets
popd
}
main $@

View File

@@ -1,22 +0,0 @@
matchbox_http_endpoint = "http://matchbox.example.com:8080"
matchbox_rpc_endpoint = "matchbox.example.com:8081"
ssh_authorized_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPQFdwVLr+alsWIgYRz9OdqDhnx9jjuFbkdSdpqq4gd9uZApYlivMDD4UgjFazQpezx8DiNhu9ym7i6LgAcdwi+10hE4L9yoJv9uBgbBxOAd65znqLqF91NtV4mlKP5YfJtR7Ehs+pTB+IIC+o5veDbPn+BYgDMJ2x7Osbn1/gFSDken/yoOFbYbRMGMfVEQYjJzC4r/qCKH0bl/xuVNLxf9FkWSTCcQFKGOndwuGITDkshD4r2Kk8gUddXPxoahBv33/2QH0CY5zbKYjhgN6I6WtwO+O1uJwtNeV1AGhYjurdd60qggNwx+W7623uK3nIXvJd3hzDO8u5oa53/tIL fake-test-key"
cluster_name = "example"
container_linux_version = "1967.3.0"
container_linux_channel = "stable"
# Machines
controller_names = ["node1"]
controller_macs = ["52:54:00:a1:9c:ae"]
controller_domains = ["node1.example.com"]
worker_names = ["node2", "node3"]
worker_macs = ["52:54:00:b2:2f:86", "52:54:00:c3:61:77"]
worker_domains = ["node2.example.com", "node3.example.com"]
# Bootkube
k8s_domain_name = "cluster.example.com"
asset_dir = "assets"
# Optional
cached_install = "true"

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
set -e
# kubelet health checks the given kubelet endpoint
kubelet() {
curl --silent --fail -m 1 http://$1:10255/healthz > /dev/null
}
cleanup() {
./scripts/libvirt destroy || true
./scripts/devnet destroy || true
rkt gc --grace-period=0
}

View File

@@ -1,33 +0,0 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/common"
main() {
cleanup
trap cleanup EXIT
./scripts/devnet create etcd3
./scripts/libvirt create
until etcd "node1.example.com" \
&& etcd "node2.example.com" \
&& etcd "node3.example.com"
do
sleep 3
echo "Waiting for etcd cluster..."
done
echo "etcd3 cluster came up!"
echo
cleanup
}
# etcd health checks the given etcd client endpoint
etcd() {
curl --silent --fail -m 1 http://$1:2379/health > /dev/null
}
main $@

View File

@@ -1,48 +0,0 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
main() {
cleanup
trap cleanup EXIT
./scripts/devnet create
pushd examples/terraform/etcd3-install
terraform get
terraform apply -var-file $DIR/etcd3.tfvars
popd
./scripts/libvirt create
until etcd "node1.example.com" \
&& etcd "node2.example.com" \
&& etcd "node3.example.com"
do
sleep 3
echo "Waiting for etcd cluster..."
done
echo "etcd3 cluster came up!"
echo
cleanup
}
# etcd health checks the given etcd client endpoint
etcd() {
curl --silent --fail -m 1 http://$1:2379/health > /dev/null
}
cleanup() {
./scripts/libvirt destroy || true
./scripts/devnet destroy || true
rkt gc --grace-period=0
pushd examples/terraform/etcd3-install
echo "yes" | terraform destroy || true
rm -f *.tfstate*
popd
}
main $@

View File

@@ -1,3 +0,0 @@
matchbox_http_endpoint = "http://matchbox.example.com:8080"
matchbox_rpc_endpoint = "matchbox.example.com:8081"
ssh_authorized_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPQFdwVLr+alsWIgYRz9OdqDhnx9jjuFbkdSdpqq4gd9uZApYlivMDD4UgjFazQpezx8DiNhu9ym7i6LgAcdwi+10hE4L9yoJv9uBgbBxOAd65znqLqF91NtV4mlKP5YfJtR7Ehs+pTB+IIC+o5veDbPn+BYgDMJ2x7Osbn1/gFSDken/yoOFbYbRMGMfVEQYjJzC4r/qCKH0bl/xuVNLxf9FkWSTCcQFKGOndwuGITDkshD4r2Kk8gUddXPxoahBv33/2QH0CY5zbKYjhgN6I6WtwO+O1uJwtNeV1AGhYjurdd60qggNwx+W7623uK3nIXvJd3hzDO8u5oa53/tIL fake-test-key"

View File

@@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEoAIBAAKCAQEAz0BXcFS6/mpbFiIGEc/Tnag4Z8fY47hW5HUnaaquIHfbmQKW
JYrzAw+FIIxWs0KXs8fA4jYbvcpu4ui4AHHcIvtdIROC/cqCb/bgYGwcTgHeuc56
i6hfdTbVeJpSj+WHybUexIbPqUwfiCAvqOb3g2z5/gWIAzCdsezrG59f4BUg5Hp/
8qDhW2G0TBjH1REGIycwuK/6gih9G5f8blTS8X/RZFkkwnEBShjp3cLhiEw5LIQ+
K9ipP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DmbSIIXQWrgtCGp6bTgnyRXpsj
Y0XfU8DXe0XK+0evKW02iAixHKRy4EOGGoi1CzZYZwHbjiB9Bn/Bvokm3pxPCi9F
Sfy/An99QZuZ1Q0079po7z9B/LdHz31KpSoT1X8/KFzA5dHjzPRUG+9qYSTdaOIZ
KtcTQ5A+9weZ0495YA1w1RIli8Siy//MQAU+8t9RoizJ8omjFCGuOBp1BLTRcT1D
Rpkx1qk6n2Yt+sVDUHEgEPVpstwmzO+JXl+V0mcFnCiBJWq3
-----END RSA PRIVATE KEY-----

View File

@@ -1 +0,0 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPQFdwVLr+alsWIgYRz9OdqDhnx9jjuFbkdSdpqq4gd9uZApYlivMDD4UgjFazQpezx8DiNhu9ym7i6LgAcdwi+10hE4L9yoJv9uBgbBxOAd65znqLqF91NtV4mlKP5YfJtR7Ehs+pTB+IIC+o5veDbPn+BYgDMJ2x7Osbn1/gFSDken/yoOFbYbRMGMfVEQYjJzC4r/qCKH0bl/xuVNLxf9FkWSTCcQFKGOndwuGITDkshD4r2Kk8gUddXPxoahBv33/2QH0CY5zbKYjhgN6I6WtwO+O1uJwtNeV1AGhYjurdd60qggNwx+W7623uK3nIXvJd3hzDO8u5oa53/tIL fake-test-key

View File

@@ -1,60 +0,0 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ASSETS_DIR="${ASSETS_DIR:-$PWD/examples/assets}"
source "${DIR}/common"
main() {
rm -rf $ASSETS_DIR/tls
cleanup
trap cleanup EXIT
./scripts/dev/get-kubectl
./scripts/tls/k8s-certgen -d $ASSETS_DIR/tls
./scripts/devnet create k8s
./scripts/libvirt create
until kubelet "node1.example.com" \
&& kubelet "node2.example.com" \
&& kubelet "node3.example.com"
do
sleep 10
echo "Waiting for Kubelets to start..."
done
until curl --silent -k "https://node1.example.com:443" > /dev/null
do
sleep 10
echo "Waiting for the Kubernetes API..."
done
until [[ "$(readyNodes)" == "3" ]]; do
sleep 5
echo "$(readyNodes) of 3 nodes are Ready..."
done
echo "Getting nodes..."
k8s get nodes
sleep 10
echo "Getting pods..."
k8s get pods --all-namespaces
echo "k8s cluster came up!"
echo
rm -rf $ASSETS_DIR/tls
cleanup
}
k8s() {
./bin/kubectl --kubeconfig=$ASSETS_DIR/tls/kubeconfig "$@"
}
# ready nodes returns the number of Ready Kubernetes nodes
readyNodes() {
k8s get nodes -o template --template='{{range .items}}{{range .status.conditions}}{{if eq .type "Ready"}}{{.}}{{end}}{{end}}{{end}}' | grep -o -E True | wc -l
}
main $@