From 99bca68c7d8928100e077f39339004439e0035da Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sun, 12 Oct 2014 20:09:20 -0700 Subject: [PATCH] Add local-up support --- docs/getting-started-guides/locally.md | 28 +++++++++++++++++--------- hack/local-up-cluster.sh | 1 + 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/docs/getting-started-guides/locally.md b/docs/getting-started-guides/locally.md index 397165cb855..09ba5cf2744 100644 --- a/docs/getting-started-guides/locally.md +++ b/docs/getting-started-guides/locally.md @@ -8,32 +8,30 @@ Not running Linux? Consider running Linux in a local virtual machine with [Vagra #### Docker -At least [Docker](https://docs.docker.com/installation/#installation) 1.0.0+. Ensure the Docker daemon is running and can be contacted by the user you plan to run as (try `docker ps`). +At least [Docker](https://docs.docker.com/installation/#installation) 1.0.0+. Ensure the Docker daemon is running and can be contacted (try `docker ps`). Some of the kubernetes components need to run as root, which normally works fine with docker. #### etcd You need an [etcd](https://github.com/coreos/etcd) somewhere in your path. Get the [latest release](https://github.com/coreos/etcd/releases/) and place it in `/usr/bin`. - ### Starting the cluster In a separate tab of your terminal, run: ``` cd kubernetes -hack/local-up-cluster.sh +sudo hack/local-up-cluster.sh ``` -This will build and start a lightweight local cluster, consisting of a master and a single minion. Type Control-C to shut it down. +This will build and start a lightweight local cluster, consisting of a master +and a single minion. Type Control-C to shut it down. You can use the cluster/kubecfg.sh script to interact with the local cluster. +You must set the KUBERNETES_MASTER environment variable to let other programs +know how to reach your master. ``` -cd kubernetes -modify cluster/kube-env.sh: - KUBERNETES_PROVIDER="local" - -cluster/kubecfg.sh => interact with the local cluster +export KUBERNETES_MASTER=http://localhost:8080 ``` ### Running a container @@ -41,6 +39,7 @@ cluster/kubecfg.sh => interact with the local cluster Your cluster is running, and you want to start running containers! You can now use any of the cluster/kubecfg.sh commands to interact with your local setup. + ``` cluster/kubecfg.sh list /pods cluster/kubecfg.sh list /services @@ -66,6 +65,17 @@ Congratulations! ### Troubleshooting +#### I can't reach service IPs on the network. + +Some firewall software that uses iptables may not interact well with +kubernetes. If you're having trouble around networking, try disabling any +firewall or other iptables-using systems, first. + +By default the IP range for service portals is 10.0.*.* - depending on your +docker installation, this may conflict with IPs for containers. If you find +containers running with IPs in this range, edit hack/local-cluster-up.sh and +change the portal_net flag to something else. + #### I cannot create a replication controller with replica size greater than 1! What gives? You are running a single minion setup. This has the limitation of only supporting a single replica of a given pod. If you are interested in running with larger replica sizes, we encourage you to try the local vagrant setup or one of the cloud providers. diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index c5f651a82de..53d114fc68b 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -53,6 +53,7 @@ APISERVER_LOG=/tmp/apiserver.log --port="${API_PORT}" \ --etcd_servers="http://127.0.0.1:4001" \ --machines="127.0.0.1" \ + --portal_net="10.0.0.0/24" \ --cors_allowed_origins="${API_CORS_ALLOWED_ORIGINS}" >"${APISERVER_LOG}" 2>&1 & APISERVER_PID=$!