After running the commands Vault and your environment have been configured.

Step 2 - API Server

Kubernetes a combination of components, each run on the Master node. The Master is a single node which manages the cluster and the containers running it in. The master will launch new containers, configure networking and provide health information.

The library hyperkube allows you to launch the different components. The first component is the API server. The API processes requests from the master and store information in the etcd cluster.
docker run -d --name=api \
--net=host --pid=host --privileged=true \
gcr.io/google_containers/hyperkube:v1.1.2 \
/hyperkube apiserver \
--insecure-bind-address=0.0.0.0 \
--service-cluster-ip-range=10.0.0.1/24 \
--etcd_servers=http://127.0.0.1:4001 \
--cluster_name=kubernetes --v=2

Options

insecure-bind-address binds the API to all IP addresses and makes it available via HTTP. This is useful for development purposes as it removes the need for certifications but should not be used in production.

service-cluster-ip-range provides an IP range all containers will use.

_etcdservers indicates where the API can find the etcd servers. This is a comma separated list of HTTP endpoints

_clustername provides a friendly name to the cluster.

Step 3 - Master

The Master is the controlling unit for the cluster. The Master will manage scheduling of new containers and understand which node they run on.

The Master will communicate with the API and nodes to complete the required tasks. Launching the Master will launch more services it requires to run the cluster. The Controller Manager handles replication. The Scheduler Server handles tracking resource use. It ensure containers can run on it's assigned node without overloading capacity.

hostname-override and address is used to bind the master to all IP addresses.

_clusterdns and _clusterdomain defines the DNS server (started in a future step) that allows containers to communicate via well-known names.

api-servers defines the URL the Master should use to communicate with the api.

config defines the manifest to use. manifests-multi is used with DNS. It defines the configuration for the cluster.

Step 4 - Proxy

Each node in the cluster requires a running proxy server. The proxy is responsibility for managing communications by modifying the IPTables of the host machine. It also handles load balancing of traffic between containers on a host.

The client uses the environment variable _KUBERNETESMASTER to define the default Master to communicate with.

export KUBERNETES_MASTER=http://docker:8080

Step 6 - KubeDNS / SkyDNS

Kubectl allows you to launch containers on the cluster. When we launched the Master we defined a DNS IP which we'll now launch. Because Kubernetes uses etcd, it uses the related DNS service called SkyDNS.

The DNS allows containers to communicate based on well-known names instead of IP addresses.

To start a container you define a replicate controller and a service in yaml files. The the "Launching Guestbook" scenario covers the format and differences between rc and services (svc).

Debugging Scenarios

Help

Katacoda offerings an Interactive Learning Environment for Developers. This course uses a command line and a pre-configured sandboxed environment for you to use. Below are useful commands when working with the environment.

cd <directory>

Change directory

ls

List directory

echo 'contents' > <file>

Write contents to a file

cat <file>

Output contents of file

Vim

In the case of certain exercises you will be required to edit files or text. The best approach is with Vim. Vim has two different modes, one for entering commands (Command Mode) and the other for entering text (Insert Mode). You need to switch between these two modes based on what you want to do. The basic commands are: