how i can run kubectl get pods in controller?

asked 2019-01-30 04:38:09 -0600

yasin lachiny gravatar image

i install magnum in rocky ( after that i run

$ mkdir -p ~/clusters/kubernetes-cluster
$ $(openstack coe cluster config kubernetes-cluster --dir ~/clusters/kubernetes-cluster)
export KUBECONFIG=/home/user/clusters/kubernetes-cluster/config

that is every thing ok until now but when i run

kubectl -n kube-system get po
**controller does not understand kebectl
Command 'kubectl' not found, but can be installed with:

snap install kubectl**

it is obvios that i do not install kuberneties in my controller because the container should run in vm like fedora

so should i install kubernetis on controller? if yes why it is neede if no why should i install kubernetis in a controller that does not create pod and how controller understand the pod of vm in compute

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2019-01-30 05:04:58 -0600

The purpose of Kubernetes is to run apps in containers. Magnum creates and provisions Nova instances with Kubernetes so that they can be used as container hosts. It does not manage the containers, only the container hosts.

You need kubectl to manage containers. You can install it on any computer, as long as this computer has network connectivity to the K8s cluster. You can install it on your OpenStack controller, but you don’t have to.

You don’t install K8s at all. Magnum takes care of the K8s installation on Nova instances.

edit flag offensive delete link more


but why the document said run

kubectl -n kube-system get po

and obviosly controller do not have kuberneties

yasin lachiny gravatar imageyasin lachiny ( 2019-01-30 05:19:26 -0600 )edit

Install kubectl, and you will be happy.

Note: kubectl is not Kubernetes. It is the Kubernetes client.

Bernd Bausch gravatar imageBernd Bausch ( 2019-01-30 05:49:51 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2019-01-30 04:38:09 -0600

Seen: 102 times

Last updated: Jan 30 '19