Difficulty: Beginner
Estimated Time: 10 minutes

This is a Kubernetes playground. From here you can play with a Kubernetes host and explore it's API.

What are playgrounds?

Playgrounds give you a configured environment to start playing and exploring using an unstructured learning approach.

Playgrounds are great for experimenting and trying samples. To learn more about the technology then start with one of our labs

Thank you for trying the playground. More courses and scenarios are available at on our homepage

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

Kubernetes 1.4 Playground

Helpful Commands

Here are some commands to help you get started and launch a cluster.

1) Start etcd

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

2) Start Kubernetes API Server

docker run -d --name=api \ --net=host --pid=host --privileged=true \ gcr.io/google_containers/hyperkube:v1.4.0 \ /hyperkube apiserver \ --insecure-bind-address= \ --service-cluster-ip-range= \ --etcd_servers= \ --v=2

3) Start Master

docker run -d --name=kubs \ --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 \ --pid=host \ --privileged=true \ gcr.io/google_containers/hyperkube:v1.4.0 \ /hyperkube kubelet \ --containerized \ --hostname-override="" \ --address="" \ --cluster_dns= --cluster_domain=cluster.local \ --api-servers=http://localhost:8080 \ --config=/etc/kubernetes/manifests-multi

4) Start Proxy

docker run -d --name=proxy\ --net=host \ --privileged \ gcr.io/google_containers/hyperkube:v1.4.0 \ /hyperkube proxy \ --master= --v=2

5) Download Kubectl

curl -o ~/.bin/kubectl http://storage.googleapis.com/kubernetes-release/release/v1.4.0/bin/linux/amd64/kubectl chmod u+x ~/.bin/kubectl

6) Start DNS

kubectl create -f ~/skydns-rc.yaml kubectl create -f ~/skydns-svc.yaml

Note: If you are unable to connect to port 8080, Kubernetes hasn't started yet.

7) Start Kube-Dashboard

kubectl create -f ~/dashboard.yaml

Health Check

curl http://host01:4001/version curl http://host01:8080/version export KUBERNETES_MASTER=http://host01:8080 kubectl cluster-info

Visit UI


Note: This can take a few seconds to finish loading...

Protip: Launch Script


Interested in writing your own Kubernetes scenarios and demos? Visit www.katacoda.com/teach