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

Let everyone know about your success:

Don’t stop now! The next scenario will take about 20 minutes to complete. You can pause and come back at any time.

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=http://0.0.0.0:4001 \ --advertise-client-urls=http://0.0.0.0:4001 \ --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=0.0.0.0 \ --service-cluster-ip-range=10.0.0.1/24 \ --etcd_servers=http://127.0.0.1:4001 \ --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="0.0.0.0" \ --address="0.0.0.0" \ --cluster_dns=10.0.0.10 --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=http://0.0.0.0:8080 --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

https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/ui/

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

Protip: Launch Script

launch.sh

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