From ed5b34a1a938f0b71a55dd7e9f1b41bbfc3310f2 Mon Sep 17 00:00:00 2001 From: Madhuri Kumari Date: Thu, 14 May 2015 10:53:44 +0900 Subject: [PATCH] Update docs and some files to remove kubectl. Now that kubectl is not used in magnum, we need to update the docs. This patch does the necessary changes. Change-Id: I99067af163b51ef4ee279498d85c6bd223210e7a Implements: blueprint python-k8sclient --- doc/source/dev/dev-manual-devstack.rst | 11 -------- doc/source/dev/dev-quickstart.rst | 38 ++++++++++++++------------ magnum/conductor/api.py | 2 -- magnum/conductor/handlers/kube.py | 3 -- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/doc/source/dev/dev-manual-devstack.rst b/doc/source/dev/dev-manual-devstack.rst index 203b49964f..bdeee5973e 100644 --- a/doc/source/dev/dev-manual-devstack.rst +++ b/doc/source/dev/dev-manual-devstack.rst @@ -14,17 +14,6 @@ introduce support for Ironic deployment of baremetal nodes. This session has only been tested on Ubuntu 14.04 (Trusty) and Fedora 20/21. We recommend users to select one of them if it is possible. -NB: Magnum depends on a command line tool in Kubernetes called kubectl -to execute its operations with Kubernetes. We are addressing this in milestone -#2 by implementing a native ReST client for Kubernetes. In the meantime, the -required action is to install kubectl manually. - -Install binary distribution of kubectl distributed by Google:: - - wget https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v0.15.0/kubernetes.tar.gz - tar -xzvf kubernetes.tar.gz - sudo cp -a kubernetes/platforms/linux/amd64/kubectl /usr/bin/kubectl - Clone DevStack:: cd ~ diff --git a/doc/source/dev/dev-quickstart.rst b/doc/source/dev/dev-quickstart.rst index c8e094949a..f95ca38530 100644 --- a/doc/source/dev/dev-quickstart.rst +++ b/doc/source/dev/dev-quickstart.rst @@ -105,17 +105,6 @@ deployment of baremetal nodes. This session has only been tested on Ubuntu 14.04 (Trusty) and Fedora 20/21. We recommend users to select one of them if it is possible. -NB: Magnum depends on a command line tool in kubernetes called kubectl -to execute its operations with Kubernetes. We are addressing this in milestone -#2 by implementing a native ReST client for Kubernetes. In the meantime, the -required action is to install kubectl manually. - -Install binary distribution of kubectl distributed by Google:: - - wget https://github.com/GoogleCloudPlatform/kubernetes/releases/download/v0.15.0/kubernetes.tar.gz - tar -xzvf kubernetes.tar.gz - sudo cp -a kubernetes/platforms/linux/amd64/kubectl /usr/bin/kubectl - Clone DevStack:: # Create dir to run devstack from, if not done so already @@ -238,16 +227,29 @@ slaves and sentinels:: Full lifecycle and introspection operations for each object are supported. For example, magnum bay-create, magnum baymodel-delete, magnum rc-show, magnum service-list. -In this milestone you have to use the kubernetes kubectl tool to explore the -redis cluster in detail:: +Now run bay-show command to get the IP of the bay host on which the redis-master is +running on:: - export KUBERNETES_MASTER=http://$(nova list | grep kube_master | awk '{print $13}'):8080 - kubectl get pod + $ magnum bay-show testbay + +----------------+--------------------------------------+ + | Property | Value | + +----------------+--------------------------------------+ + | status | CREATE_COMPLETE | + | uuid | 7d59afb0-1c24-4cae-93fc-4692f5438d34 | + | created_at | 2015-05-11T05:13:42+00:00 | + | updated_at | 2015-05-11T05:15:32+00:00 | + | api_address | 192.168.19.85 | + | baymodel_id | 0a79f347-54e5-406c-bc20-4cd4ee1fcea0 | + | node_count | 1 | + | node_addresses | [u'192.168.19.86'] | + | discovery_url | None | + | name | testbay | + +----------------+--------------------------------------+ -The output of `kubectl get pod` indicates the redis-master is running on the -bay host with IP address 10.0.0.5. To access the redis master:: +The output indicates the redis-master is running on the +bay host with IP address 192.168.19.86. To access the redis master:: - ssh minion@$(nova list | grep 10.0.0.5 | awk '{print $13}') + ssh minion@192.168.19.86 REDIS_ID=$(docker ps | grep redis:v1 | grep k8s_master | awk '{print $1}') docker exec -i -t $REDIS_ID redis-cli diff --git a/magnum/conductor/api.py b/magnum/conductor/api.py index e02a2a8f93..c0b8d438e5 100644 --- a/magnum/conductor/api.py +++ b/magnum/conductor/api.py @@ -72,8 +72,6 @@ class API(rpc_service.API): return self._call('service_update', service=service) def service_list(self, context, limit, marker, sort_key, sort_dir): - # TODO(pkilambi): return kubectl results once we parse appropriately - # or figure out a clean way to interact with k8s. return objects.Service.list(context, limit, marker, sort_key, sort_dir) def service_delete(self, uuid): diff --git a/magnum/conductor/handlers/kube.py b/magnum/conductor/handlers/kube.py index e2162d6ceb..675111f8ee 100644 --- a/magnum/conductor/handlers/kube.py +++ b/magnum/conductor/handlers/kube.py @@ -86,8 +86,6 @@ class Handler(object): service. API calls via AMQP (within the ReST API) trigger the handlers to be called. - This handler acts as an interface to executes kubectl command line - services. """ def __init__(self): @@ -206,7 +204,6 @@ class Handler(object): def pod_delete(self, context, uuid): LOG.debug("pod_delete %s", uuid) - # trigger a kubectl command pod = objects.Pod.get_by_uuid(context, uuid) k8s_master_url = _retrieve_k8s_master_url(context, pod) self.k8s_api = k8s_master_url