From 424cbb028fffe31a23cac942a454b58e6a2331e4 Mon Sep 17 00:00:00 2001 From: goltermann Date: Fri, 8 May 2015 17:44:36 -0700 Subject: [PATCH 1/4] Fix for kubectl output message (issue 8013) --- pkg/kubectl/resource/builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubectl/resource/builder.go b/pkg/kubectl/resource/builder.go index c30eb8e1b79..fdab78e1ddb 100644 --- a/pkg/kubectl/resource/builder.go +++ b/pkg/kubectl/resource/builder.go @@ -597,7 +597,7 @@ func (b *Builder) visitorResult() *Result { return &Result{singular: singular, visitor: visitors, sources: b.paths} } - return &Result{err: fmt.Errorf("you must provide one or more resources by argument or filename")} + return &Result{err: fmt.Errorf(`you must provide one or more resources by argument or filename, try "kubectl help [command]" for help`)} } // Do returns a Result object with a Visitor for the resources identified by the Builder. From acb07811b303301822d26d586148c1e1c006b268 Mon Sep 17 00:00:00 2001 From: goltermann Date: Tue, 26 May 2015 15:07:16 -0700 Subject: [PATCH 2/4] Revert "Fix for kubectl output message (issue 8013)" This reverts commit 4ed46e8fc6876db0d6e12b60f8bedc49d16b34ab. --- pkg/kubectl/resource/builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubectl/resource/builder.go b/pkg/kubectl/resource/builder.go index fdab78e1ddb..c30eb8e1b79 100644 --- a/pkg/kubectl/resource/builder.go +++ b/pkg/kubectl/resource/builder.go @@ -597,7 +597,7 @@ func (b *Builder) visitorResult() *Result { return &Result{singular: singular, visitor: visitors, sources: b.paths} } - return &Result{err: fmt.Errorf(`you must provide one or more resources by argument or filename, try "kubectl help [command]" for help`)} + return &Result{err: fmt.Errorf("you must provide one or more resources by argument or filename")} } // Do returns a Result object with a Visitor for the resources identified by the Builder. From 723ab9cf116abde302d9e8e55340cfbb33599f23 Mon Sep 17 00:00:00 2001 From: goltermann Date: Tue, 26 May 2015 16:50:36 -0700 Subject: [PATCH 3/4] Changes for 8690, 8689, 8350, 8346 --- docs/getting-started-guides/gce.md | 32 ++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/getting-started-guides/gce.md b/docs/getting-started-guides/gce.md index 2aa8be0608a..0c0946dcb37 100644 --- a/docs/getting-started-guides/gce.md +++ b/docs/getting-started-guides/gce.md @@ -4,15 +4,20 @@ The example below creates a Kubernetes cluster with 4 worker node Virtual Machin ### Before you start -If you want a simplified getting started experience and GUI for managing clusters, please consider trying [Google Container Engine](https://cloud.google.com/container-engine/) for hosted cluster installation and management. +If you want a simplified getting started experience and GUI for managing clusters, please consider trying [Google Container Engine](https://cloud.google.com/container-engine/) for hosted cluster installation and management. If you want to use custom binaries or pure open source Kubernetes, please continue with the instructions below. ### Prerequisites 1. You need a Google Cloud Platform account with billing enabled. Visit the [Google Developers Console](http://cloud.google.com/console) for more details. +1. Make sure you have the `gcloud preview` command line component installed. Simply run `gcloud preview` at the command line - if it asks to install any components, go ahead and install them. If it simply shows help text, you're good to go. This is required as the cluster setup script uses GCE [Instance Groups](https://cloud.google.com/compute/docs/instance-groups/), which are the gcloud preview namespace. +1. Make sure that gcloud is set to use the Google Cloud Platform project you want. You can check the current project using `gcloud config list project` and change it via `gcloud config set project `. +1. Make sure you have credentials for GCloud by running +```bash +gcloud auth login +``` 1. Make sure you can start up a GCE VM from the command line. At least make sure you can do the [Create an instance](https://cloud.google.com/compute/docs/quickstart#create_an_instance) part of the GCE Quickstart. -1. Make sure you have the `gcloud preview` command line component installed. Simply run `gcloud preview` at the command line - if it asks to install any components, go ahead and install them. If it simply shows help text, you're good to go. 1. Make sure you can ssh into the VM without interactive prompts. See the [Log in to the instance](https://cloud.google.com/compute/docs/quickstart#ssh) part of the GCE Quickstart. ### Starting a Cluster @@ -29,6 +34,16 @@ or wget -q -O - https://get.k8s.io | bash ``` +Once this command completes, you will have a master VM and four worker VMs, running as a Kubernetes cluster. By default, some containers will already be running on your cluster. These are used to run and monitor Kubernetes. + +If you run into trouble please see the section on [troubleshooting](https://github.com/brendandburns/kubernetes/blob/docs/docs/getting-started-guides/gce.md#troubleshooting), or come ask questions on IRC at #google-containers on freenode. + +The next few steps will show you: +1. how to setup the command line client on your workstation to manage the cluster +1. examples of how to use the cluster +1. how to delete the cluster +1. how to start clusters of different with non-default options (like larger clusters) + ### Installing the kubernetes client on your workstation This will leave you with a ```kubernetes``` directory on your workstation, and a running cluster. @@ -48,22 +63,21 @@ However the gcloud bundled kubectl version may be older than the one downloaded get.k8s.io install script. We recommend you use the downloaded binary to avoid potential issues with client/server version skew. -If you run into trouble please see the section on [troubleshooting](https://github.com/brendandburns/kubernetes/blob/docs/docs/getting-started-guides/gce.md#troubleshooting), or come ask questions on IRC at #google-containers on freenode. - - ### Getting started with your cluster See [a simple nginx example](../../examples/simple-nginx.md) to try out your new cluster. For more complete applications, please look in the [examples directory](../../examples) - ### Tearing down the cluster +To remove/delete/teardown the cluster, use the `kube-down.sh` script. ```bash cd kubernetes cluster/kube-down.sh ``` +Likewise, the `kube-up.sh` in the same directory will bring it back up. You do not need to rerun the `curl` or `wget` command: everything needed to setup the Kubernetes cluster is now on your workstation. + ### Customizing The script above relies on Google Storage to stage the Kubernetes release. It @@ -82,6 +96,12 @@ can be done in the Google Cloud Console. See the [Google Cloud Storage JSON API Overview](https://cloud.google.com/storage/docs/json_api/) for more details. +#### Cluster initialization hang + +If the Kubernetes startup script hangs waiting for the API to be reachable, you can troubleshoot by SSHing into the master and minion VMs and looking at logs such as `/var/log/startupscript.log`. + +Once you fix the issue, you should run `kube-down.sh` to cleanup after the partial cluster creation, before running `kube-up.sh` to try again. + #### SSH If you're having trouble SSHing into your instances, ensure the GCE firewall From 5b228bd09ad71f45f71ee9ae6c92299547e4ecd2 Mon Sep 17 00:00:00 2001 From: goltermann Date: Tue, 26 May 2015 18:22:48 -0700 Subject: [PATCH 4/4] Updates after review. --- docs/getting-started-guides/gce.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/getting-started-guides/gce.md b/docs/getting-started-guides/gce.md index 0c0946dcb37..7b7522520cd 100644 --- a/docs/getting-started-guides/gce.md +++ b/docs/getting-started-guides/gce.md @@ -11,7 +11,7 @@ If you want to use custom binaries or pure open source Kubernetes, please contin ### Prerequisites 1. You need a Google Cloud Platform account with billing enabled. Visit the [Google Developers Console](http://cloud.google.com/console) for more details. -1. Make sure you have the `gcloud preview` command line component installed. Simply run `gcloud preview` at the command line - if it asks to install any components, go ahead and install them. If it simply shows help text, you're good to go. This is required as the cluster setup script uses GCE [Instance Groups](https://cloud.google.com/compute/docs/instance-groups/), which are the gcloud preview namespace. +1. Make sure you have the `gcloud preview` command line component installed. Simply run `gcloud preview` at the command line - if it asks to install any components, go ahead and install them. If it simply shows help text, you're good to go. This is required as the cluster setup script uses GCE [Instance Groups](https://cloud.google.com/compute/docs/instance-groups/), which are in the gcloud preview namespace. 1. Make sure that gcloud is set to use the Google Cloud Platform project you want. You can check the current project using `gcloud config list project` and change it via `gcloud config set project `. 1. Make sure you have credentials for GCloud by running ```bash @@ -36,13 +36,14 @@ wget -q -O - https://get.k8s.io | bash Once this command completes, you will have a master VM and four worker VMs, running as a Kubernetes cluster. By default, some containers will already be running on your cluster. These are used to run and monitor Kubernetes. -If you run into trouble please see the section on [troubleshooting](https://github.com/brendandburns/kubernetes/blob/docs/docs/getting-started-guides/gce.md#troubleshooting), or come ask questions on IRC at #google-containers on freenode. +If you run into trouble please see the section on [troubleshooting](gce.md#troubleshooting), or come ask questions on IRC at #google-containers on freenode. The next few steps will show you: -1. how to setup the command line client on your workstation to manage the cluster + +1. how to set up the command line client on your workstation to manage the cluster 1. examples of how to use the cluster 1. how to delete the cluster -1. how to start clusters of different with non-default options (like larger clusters) +1. how to start clusters with non-default options (like larger clusters) ### Installing the kubernetes client on your workstation