diff --git a/tcp_tests/managers/k8smanager.py b/tcp_tests/managers/k8smanager.py
index d84fd73..87e3eaf 100644
--- a/tcp_tests/managers/k8smanager.py
+++ b/tcp_tests/managers/k8smanager.py
@@ -17,8 +17,11 @@
 import yaml
 
 from devops.helpers import helpers
+from devops.error import DevopsCalledProcessError
 
 from tcp_tests import logger
+from tcp_tests.helpers import ext
+from tcp_tests.helpers.utils import retry
 from tcp_tests.managers.execute_commands import ExecuteCommandsMixin
 from tcp_tests.managers.k8s import cluster
 from k8sclient.client.rest import ApiException
@@ -80,6 +83,12 @@
                 default_namespace='default')
         return self._api_client
 
+    @property
+    def ctl_host(self):
+        nodes = [node for node in self.__config.underlay.ssh if
+                 ext.UNDERLAY_NODE_ROLES.k8s_controller in node['roles']]
+        return nodes[0]['node_name']
+
     def get_pod_phase(self, pod_name, namespace=None):
         return self.api.pods.get(
             name=pod_name, namespace=namespace).phase
@@ -296,7 +305,7 @@
         params = ' '.join(["-f {}".format(p) for p in path])
         cmd = 'kubectl create {params}'.format(params=params)
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             LOG.info("Running command '{cmd}' on node {node}".format(
                 cmd=cmd,
                 node=remote.hostname)
@@ -315,7 +324,7 @@
 
     def get_running_pods_by_ssh(self, pod_name, namespace=None):
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             result = remote.check_call("kubectl get pods --namespace {} |"
                                        " grep {} | awk '{{print $1 \" \""
                                        " $3}}'".format(namespace,
@@ -331,7 +340,7 @@
 
     def run_conformance(self, timeout=60 * 60):
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             result = remote.check_call(
                 "docker run --rm --net=host -e API_SERVER="
                 "'http://127.0.0.1:8080' {}".format(
@@ -347,7 +356,7 @@
 
     def kubectl_run(self, name, image, port):
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             result = remote.check_call(
                 "kubectl run {0} --image={1} --port={2}".format(
                     name, image, port
@@ -357,7 +366,7 @@
 
     def kubectl_expose(self, resource, name, port, type):
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             result = remote.check_call(
                 "kubectl expose {0} {1} --port={2} --type={3}".format(
                     resource, name, port, type
@@ -365,27 +374,28 @@
             )
             return result
 
-    def kubectl_annotate(self, resource, name, annotaion):
+    def kubectl_annotate(self, resource, name, annotation):
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             result = remote.check_call(
-                "kubectl annotate {0} {1} {3}".format(
-                    resource, name, annotaion
+                "kubectl annotate {0} {1} {2}".format(
+                    resource, name, annotation
                 )
             )
             return result
 
-    def get_svc_ip(self, name):
+    def get_svc_ip(self, name, namespace='kube-system'):
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             result = remote.check_call(
-                "kubectl get svc --all-namespaces | grep {0} | "
-                "awk '{{print $2}}'".format(name)
+                "kubectl get svc {0} -n {1} | "
+                "awk '{{print $2}}' | tail -1".format(name, namespace)
             )
             return result['stdout'][0].strip()
 
+    @retry(300, exception=DevopsCalledProcessError)
     def nslookup(self, host, src):
         with self.__underlay.remote(
-                host=self.__config.k8s.kube_host) as remote:
+                node_name=self.ctl_host) as remote:
             remote.check_call("nslookup {0} {1}".format(host, src))
 
