I am trying to setup kubernetes in aws and following the guides at https://github.com/kubernetes/kubernetes/blob/master/docs/getting-started-guides/docker-multinode
I couldn't understand what is meant by hyperkube. Can someone please explain to me what it is and how does it work?
And another question I have is while running the command
sudo docker run \
--volume=/:/rootfs:ro \
--volume=/sys:/sys:ro \
--volume=/dev:/dev \
--volume=/var/lib/docker/:/var/lib/docker:rw \
--volume=/var/lib/kubelet/:/var/lib/kubelet:rw \
--volume=/var/run:/var/run:rw \
--net=host \
--privileged=true \
--pid=host \
-d \
gcr.io/google_containers/hyperkube:v${K8S_VERSION} \
/hyperkube kubelet \
--api-servers=http://localhost:8080 \
--v=2 --address=0.0.0.0 --enable-server \
--hostname-override=127.0.0.1 \
--config=/etc/kubernetes/manifests-multi \
--cluster-dns=10.0.0.10 \
--cluster-domain=cluster.local
it is starting the one pod by default. From the command documentation, it looks like it is getting the pod manifest from the --config=/etc/kubernetes/manifests-multi
attribute. But this directory is not present in my host. can somebody please tell me from where it is getting this pod manifest?
Kubernetes is a set of daemons/binaries:
kube-apiserver
(AKA the master),kubelet
(start/stop containers, sync conf.),kube-scheduler
(resources manager)kube-controller-manager
(monitor RC, and maintain the desired state)kube-proxy
(expose services on each node)kubectl
(CLI)The hyperkube binary is an all in one binary (in a way similar to
busybox
), combining all the previously separate binaries.The following command:
runs the daemon
kubelet
.Hyperkube is the wrapper of all the API server binaries, the way Kubernetes operates is use
hyperkube
to call the API server, scheduler, controller manager, kube-proxy and kubelet.Now all of these binaries which defines the master node uses the YAML manifest to define the services mentioned above. You can always choose the deployment type to be either inside container or on host based on your deployment scenario.
These pod manifests for the services actually define the desired state for your services which gets stored inside the etcd from where the api server gets prepared first.
Now once the pod manifests are defined you can use
hyperkube
to configure these services to run inside containers or on host.So
hyperkube
in a nutshell is the core for all services and the sole purpose of thishyperkube
is to manage all the services inside the Kubernetes cluster so kinda simplify the deployment.If you care more about having a cluster running in AWS than about going through the experience of bringing up each component by hand (which you shouldn't bother with unless you're doing it for the sake of learning), I'd strongly recommend using the turn-key scripts for creating an AWS cluster, as documented here.
For anyone else looking at this question/answer, there's a page in the docs on how to choose a cluster creation method that fits your needs.
As for your question about hyperkube, the config file is built into the hyperkube docker image, as you can see from its Dockerfile if you're curious.
Kubernetes is a set of binaries
hyperkube is a wrapper for all these binaries. So once you deploy hyperkube, it will install all the binaries. No need to install those binary individually.
I am beginning my kubernetes journey myself however if you take a look at the source on github you will see where the hyperkube is coming from. It is built into the core of kubernetes - https://github.com/kubernetes/kubernetes/blob/master/cmd/hyperkube/hyperkube.go
Kubernetes is designed for taking containers to a whole new level and wrapping them up in what google calls pods. The hyperkube - and please correct me if I'm wrong is the arch/krux/backbone of the scheduling, creation, and management of the containers that make up the pod and essentially runs the show hence the name "hyperkube." Furthermore the hyperkube responds to events quickly and is capable of making decisions on the fly regarding your service/stack/container/host health.
If you would like an easy way to get started with kubernetes, I recommend trying out rancher (not rancherOS) as rancherlabs has just implemented kubernetes deployment into their built in stacks - also rancher uses docker-compose as well as what it calls rancher-compose - when you create a stack/service you can take a look at the elements that make up that stack/service and the containers within that stack in yml format - that will help give you a better understanding of the elements that make up the services and stacks you are running and also help you troubleshoot issues on manual deployments - it is gui based however you can add your host to any rancher-server, throw in some logging stacks like kabana or sysdig and if your working from the cli - as long as the host is registered with rancher (no I don't work for them at all) - you can register any host with rancher by adding a host and specifying custom. Furthermore rancher can actually manage kubernetes / stacks / volumes across hosting platforms - which is awesome. It's a great way to visualize and see what is happening with your docker hosts.
I hope that this answers some questions and also leads you in the right direction.
It is the decision maker and giver of life to the kubernetes cluster.