Difficulty: Beginner
Estimated Time: 10 minutes

Skenari ini menjelaskan perbedaan aspek membuat kluster Kubernetes.

Lab ini menggunakan Docker yang sudah dikonfigurasi, berjalan diatas host yang disebut docker. Sisanya akan dijalankan sebagai container.

Informasi lebih jauh bisa ditemukan pada http://kubernetes.io/v1.1/docs/getting-started-guides/

Berikut ini diagram desain cluster nantinya:

k8s Single Node pada Docker

This scenario has explained how to launch a Kubernetes cluster. In future scenarios you'll learn more details about Kubernetes, starting with launching your first example application.

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

Membuat Cluster Kubernetes

Step 1 of 8

Langkah 1 - Etcd

Etcd merupakan "Key-value store yang reliable dan terdistribusi untuk data-data critical of a distributed system". Kubernetes uses Etcd to store state about the cluster and service discovery between nodes. This state includes what nodes exist in the cluster, which nodes they are running on and what containers should be running.

The command below will launch a single node etcd cluster listening on port 4001.

docker run -d --name=etcd \ --net=host \ gcr.io/google_containers/etcd:2.2.1 \ /usr/local/bin/etcd \ --listen-client-urls=http://0.0.0.0:4001 \ --advertise-client-urls=http://0.0.0.0:4001 \ --data-dir=/var/etcd/data

The net=host means the container will share the same network as the host, removing the need to map ports.

In production you would want to run etcd on three separate machines to ensure maximum availability.