From 6160260b208aa89a98732795264b6e8e5d3eb362 Mon Sep 17 00:00:00 2001 From: Ekaterina Chernova Date: Mon, 17 Sep 2018 11:00:09 +0300 Subject: [PATCH] Improve openstack-kubespray engine * Flaoting IP is used for asscess by ssh * Ansible host is internal IP * Get rid of adding FIP to loopback function * Set extra variables for lbaass * Store redefined variables in k8s-cluster.yml, since it has more priority --- Dockerfile | 2 +- kqueen/config/demo_mirantis.py | 3 ++ kqueen/engines/openstack_kubespray.py | 52 +++++++++++---------------- 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c9864ed..bba63a69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN pip install ./kqueen # Avoid Ssh issues with docker overlayfs and sockets ENV ANSIBLE_SSH_CONTROL_PATH /dev/shm/cp%%h-%%p-%%r -ENV ANSIBLE_SSH_RETRIES 3 +ENV ANSIBLE_SSH_RETRIES 5 ENV ANSIBLE_TIMEOUT 25 ENV KQUEEN_KS_KUBESPRAY_PATH /code/kubespray ENV KQUEEN_KS_ANSIBLE_CMD /usr/local/bin/ansible diff --git a/kqueen/config/demo_mirantis.py b/kqueen/config/demo_mirantis.py index 94198ee8..c5be7967 100644 --- a/kqueen/config/demo_mirantis.py +++ b/kqueen/config/demo_mirantis.py @@ -48,3 +48,6 @@ class Config(BaseConfig): POD_INFRA_IMAGE_TAG = 'v1.10.4-4' KS_DEFAULT_NAMESERVERS = "172.18.176.6" + KS_NO_PROXY = "127.0.0.1,localhost,docker-prod-local.docker.mirantis.net,172.16.48.254," \ + "cloud-cz.bud.mirantis.net,172.17.45.80" + KS_OS_BLOCKSTORAGE_VERSION = "v2" diff --git a/kqueen/engines/openstack_kubespray.py b/kqueen/engines/openstack_kubespray.py index 3fe61f9d..614b70f7 100644 --- a/kqueen/engines/openstack_kubespray.py +++ b/kqueen/engines/openstack_kubespray.py @@ -436,33 +436,9 @@ def deploy(self, cluster_metadata): self._save_inventory(inventory, "hosts.json") self._create_group_vars(cluster_metadata) self._wait_for_ping() - self._add_fip_to_lo(resources) self._run_ansible() return self._get_kubeconfig(resources["masters"][0]["fip"]) - def _add_fip_to_lo(self, resources): - """Add floating ip to loopback interface. - - This is workaround for buggy deployments where node can't reach - itself by floating ip. - """ - cmd_fmt = ( - "sudo /bin/sh -c 'cat > /etc/rc.local <