Difficulty: Intermediate
Estimated Time: 10-15 minutes

In this scenario you'll learn how Kubernetes scheduling policy works and how Pods are scheduled across a cluster. You'll also learn how to customise the scheduler and provide hints about where certain Pods should be deployed.

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Deploying Containers Across Cluster

Step 1 of 3

Step 1 - Start Kubernetes

As described in your (Adding Additional Nodes)[/courses/kubernetes/add-additional-nodes-to-cluster] scenario, to begin you need to launch the main Kubernetes cluster and then add the additional Kubelet and Proxy on each node.

Task

Run the following command first to deploy the Kubernetes cluster.

launch.sh

Once the cluster has started, attach the second node.

docker run -d --name=kubs \ --net=host --pid=host --privileged=true \ --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 \ gcr.io/google_containers/hyperkube:v1.2.2 \ /hyperkube kubelet \ --allow-privileged=true --containerized --enable-server \ --cluster_dns=10.0.0.10 --cluster_domain=cluster.local \ --config=/etc/kubernetes/manifests-multi \ --hostname-override="[[HOST2_IP]]" \ --address=0.0.0.0 --api-servers=http://[[HOST_IP]]:8080 docker run -d --name=proxy \ --net=host --privileged \ gcr.io/google_containers/hyperkube:v1.2.2 \ /hyperkube proxy \ --master=http://[[HOST_IP]]:8080 --v=2

You can view the nodes using kubectl get nodes

Terminal Host 2