1
0
mirror of https://github.com/jcwimer/kubernetes-ansible synced 2026-03-24 16:44:44 +00:00

Changed from Kubeadm to RKE for deployment

This commit is contained in:
2019-05-03 15:10:23 -04:00
parent 0537239d74
commit fc94d74b32
16 changed files with 477 additions and 83 deletions

View File

@@ -1,3 +1,9 @@
docker_ce_version_to_install: 18.03.1
kube_init_network_interface: enp0s8
kube_network: weavenet
# rke
rke_directory: /home/vagrant/rke
rke_node_directory: /rke
rke_version: 0.2.1
rke_cluster_name: rke-k8s
vip_address: localhost
domain: test.local
standard_user: vagrant

View File

@@ -40,19 +40,12 @@ function run-tests {
echo Giving containers time to start up.
sleep 90s
local kubectl_config="export KUBECONFIG=/home/vagrant/admin.conf"
local kubectl_config="export KUBECONFIG=/rke/kube_config_rke-k8s.yaml"
local curl_params="--silent --fail --max-time 10"
number_of_ready_nodes=$(run-ssh-command master "${kubectl_config}; kubectl get nodes | grep -v STATUS | grep Ready | wc -l")
number_of_ready_nodes=$(run-ssh-command master "sudo bash -c '${kubectl_config}; kubectl get nodes | grep -v STATUS | grep Ready | wc -l'")
testbash "There should be 4 nodes in Ready state." \
"test ${number_of_ready_nodes} -eq 4"
traefik_port=$(run-ssh-command master "${kubectl_config}; kubectl get service -n kube-system | grep traefik | awk {'print $5'} | cut -d , -f 2 | cut -d : -f 2 | cut -d / -f 1")
testbash "Traefik should be reachable from worker1 node." \
"run-ssh-command client 'curl ${curl_params} http://192.168.254.3:${traefik_port}/dashboard/ > /dev/null'"
testbash "Traefik should be reachable from worker2 node." \
"run-ssh-command client 'curl ${curl_params} http://192.168.254.3:${traefik_port}/dashboard/ > /dev/null'"
trap - ERR
}