diff --git a/cmd/helm/helm.go b/cmd/helm/helm.go index 3810cfb8e..7f3acea8c 100644 --- a/cmd/helm/helm.go +++ b/cmd/helm/helm.go @@ -173,7 +173,7 @@ func setupConnection(c *cobra.Command, args []string) error { return err } - tunnel, err := portforwarder.New(settings.TillerNamespace, client, config) + tunnel, err := portforwarder.New(settings.TillerNamespace, client, config, settings.TunnelLocalPort) if err != nil { return err } diff --git a/cmd/helm/plugin_test.go b/cmd/helm/plugin_test.go index 2a4a0e9aa..927152b75 100644 --- a/cmd/helm/plugin_test.go +++ b/cmd/helm/plugin_test.go @@ -20,6 +20,7 @@ import ( "os" "path/filepath" "runtime" + "strconv" "strings" "testing" @@ -179,6 +180,7 @@ func TestSetupEnv(t *testing.T) { {"HELM_PATH_STARTER", settings.Home.Starters()}, {"TILLER_HOST", settings.TillerHost}, {"TILLER_NAMESPACE", settings.TillerNamespace}, + {"TUNNEL_LOCAL_PORT", strconv.Itoa(settings.TunnelLocalPort)}, } { if got := os.Getenv(tt.name); got != tt.expect { t.Errorf("Expected $%s=%q, got %q", tt.name, tt.expect, got) diff --git a/docs/helm/helm.md b/docs/helm/helm.md index caa4301a0..d93bf4028 100644 --- a/docs/helm/helm.md +++ b/docs/helm/helm.md @@ -37,6 +37,7 @@ Environment: --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -68,4 +69,4 @@ Environment: * [helm verify](helm_verify.md) - verify that a chart at the given path has been signed and is valid * [helm version](helm_version.md) - print the client/server version information -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_completion.md b/docs/helm/helm_completion.md index 9fe91d52a..789dac99f 100644 --- a/docs/helm/helm_completion.md +++ b/docs/helm/helm_completion.md @@ -29,10 +29,11 @@ helm completion SHELL --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_create.md b/docs/helm/helm_create.md index fa047ee23..b6882261e 100644 --- a/docs/helm/helm_create.md +++ b/docs/helm/helm_create.md @@ -48,10 +48,11 @@ helm create NAME --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_delete.md b/docs/helm/helm_delete.md index bf3adb6b2..fea0ba582 100644 --- a/docs/helm/helm_delete.md +++ b/docs/helm/helm_delete.md @@ -39,10 +39,11 @@ helm delete [flags] RELEASE_NAME [...] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_dependency.md b/docs/helm/helm_dependency.md index 673c2c384..7498301f6 100644 --- a/docs/helm/helm_dependency.md +++ b/docs/helm/helm_dependency.md @@ -62,6 +62,7 @@ for this case. --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -71,4 +72,4 @@ for this case. * [helm dependency list](helm_dependency_list.md) - list the dependencies for the given chart * [helm dependency update](helm_dependency_update.md) - update charts/ based on the contents of requirements.yaml -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_dependency_build.md b/docs/helm/helm_dependency_build.md index 0c9d1f97b..1a4ad7200 100644 --- a/docs/helm/helm_dependency_build.md +++ b/docs/helm/helm_dependency_build.md @@ -35,10 +35,11 @@ helm dependency build [flags] CHART --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm dependency](helm_dependency.md) - manage a chart's dependencies -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_dependency_list.md b/docs/helm/helm_dependency_list.md index a558356be..10f653061 100644 --- a/docs/helm/helm_dependency_list.md +++ b/docs/helm/helm_dependency_list.md @@ -27,10 +27,11 @@ helm dependency list [flags] CHART --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm dependency](helm_dependency.md) - manage a chart's dependencies -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_dependency_update.md b/docs/helm/helm_dependency_update.md index 191a69644..4e6c33578 100644 --- a/docs/helm/helm_dependency_update.md +++ b/docs/helm/helm_dependency_update.md @@ -40,10 +40,11 @@ helm dependency update [flags] CHART --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm dependency](helm_dependency.md) - manage a chart's dependencies -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_fetch.md b/docs/helm/helm_fetch.md index 5b4127c0a..48d562ff0 100644 --- a/docs/helm/helm_fetch.md +++ b/docs/helm/helm_fetch.md @@ -49,10 +49,11 @@ helm fetch [flags] [chart URL | repo/chartname] [...] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_get.md b/docs/helm/helm_get.md index ce6718b28..278653ca1 100644 --- a/docs/helm/helm_get.md +++ b/docs/helm/helm_get.md @@ -41,6 +41,7 @@ helm get [flags] RELEASE_NAME --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -50,4 +51,4 @@ helm get [flags] RELEASE_NAME * [helm get manifest](helm_get_manifest.md) - download the manifest for a named release * [helm get values](helm_get_values.md) - download the values file for a named release -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_get_hooks.md b/docs/helm/helm_get_hooks.md index a2fb36acd..91ac098bb 100644 --- a/docs/helm/helm_get_hooks.md +++ b/docs/helm/helm_get_hooks.md @@ -34,10 +34,11 @@ helm get hooks [flags] RELEASE_NAME --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm get](helm_get.md) - download a named release -###### Auto generated by spf13/cobra on 15-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_get_manifest.md b/docs/helm/helm_get_manifest.md index 1cf712d9b..f74cf7a8e 100644 --- a/docs/helm/helm_get_manifest.md +++ b/docs/helm/helm_get_manifest.md @@ -36,10 +36,11 @@ helm get manifest [flags] RELEASE_NAME --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm get](helm_get.md) - download a named release -###### Auto generated by spf13/cobra on 15-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_get_values.md b/docs/helm/helm_get_values.md index 1e57a2303..c7be33340 100644 --- a/docs/helm/helm_get_values.md +++ b/docs/helm/helm_get_values.md @@ -33,10 +33,11 @@ helm get values [flags] RELEASE_NAME --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm get](helm_get.md) - download a named release -###### Auto generated by spf13/cobra on 15-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_history.md b/docs/helm/helm_history.md index 84792081a..835d16087 100644 --- a/docs/helm/helm_history.md +++ b/docs/helm/helm_history.md @@ -44,10 +44,11 @@ helm history [flags] RELEASE_NAME --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_home.md b/docs/helm/helm_home.md index 069f6a162..622025aa7 100644 --- a/docs/helm/helm_home.md +++ b/docs/helm/helm_home.md @@ -22,10 +22,11 @@ helm home --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_init.md b/docs/helm/helm_init.md index eeee9b013..eb93cbc6d 100644 --- a/docs/helm/helm_init.md +++ b/docs/helm/helm_init.md @@ -62,10 +62,11 @@ helm init --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_inspect.md b/docs/helm/helm_inspect.md index 7fc56cacc..4c4191216 100644 --- a/docs/helm/helm_inspect.md +++ b/docs/helm/helm_inspect.md @@ -36,6 +36,7 @@ helm inspect [CHART] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -44,4 +45,4 @@ helm inspect [CHART] * [helm inspect chart](helm_inspect_chart.md) - shows inspect chart * [helm inspect values](helm_inspect_values.md) - shows inspect values -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_inspect_chart.md b/docs/helm/helm_inspect_chart.md index e1e88fbbe..0db1fcfb8 100644 --- a/docs/helm/helm_inspect_chart.md +++ b/docs/helm/helm_inspect_chart.md @@ -34,10 +34,11 @@ helm inspect chart [CHART] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm inspect](helm_inspect.md) - inspect a chart -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_inspect_values.md b/docs/helm/helm_inspect_values.md index 348336b8f..50d498d74 100644 --- a/docs/helm/helm_inspect_values.md +++ b/docs/helm/helm_inspect_values.md @@ -34,10 +34,11 @@ helm inspect values [CHART] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm inspect](helm_inspect.md) - inspect a chart -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index f3a8ee06d..7d0dd43c5 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -103,10 +103,11 @@ helm install [CHART] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 23-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_lint.md b/docs/helm/helm_lint.md index a07a43627..0afc31005 100644 --- a/docs/helm/helm_lint.md +++ b/docs/helm/helm_lint.md @@ -32,10 +32,11 @@ helm lint [flags] PATH --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_list.md b/docs/helm/helm_list.md index b1dcb19de..f212cd536 100644 --- a/docs/helm/helm_list.md +++ b/docs/helm/helm_list.md @@ -66,10 +66,11 @@ helm list [flags] [FILTER] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_package.md b/docs/helm/helm_package.md index 71960f41e..86442a2ff 100644 --- a/docs/helm/helm_package.md +++ b/docs/helm/helm_package.md @@ -41,10 +41,11 @@ helm package [flags] [CHART_PATH] [...] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 24-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_plugin.md b/docs/helm/helm_plugin.md index 5a636724c..48774c1be 100644 --- a/docs/helm/helm_plugin.md +++ b/docs/helm/helm_plugin.md @@ -17,6 +17,7 @@ Manage client-side Helm plugins. --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -27,4 +28,4 @@ Manage client-side Helm plugins. * [helm plugin remove](helm_plugin_remove.md) - remove one or more Helm plugins * [helm plugin update](helm_plugin_update.md) - update one or more Helm plugins -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_plugin_install.md b/docs/helm/helm_plugin_install.md index f93378b7b..12f64ef8a 100644 --- a/docs/helm/helm_plugin_install.md +++ b/docs/helm/helm_plugin_install.md @@ -30,10 +30,11 @@ helm plugin install [options] ... --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 20-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_plugin_list.md b/docs/helm/helm_plugin_list.md index 403ef1a6f..eab04c8f4 100644 --- a/docs/helm/helm_plugin_list.md +++ b/docs/helm/helm_plugin_list.md @@ -19,10 +19,11 @@ helm plugin list --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_plugin_remove.md b/docs/helm/helm_plugin_remove.md index 6c4530ce1..8af48c4ac 100644 --- a/docs/helm/helm_plugin_remove.md +++ b/docs/helm/helm_plugin_remove.md @@ -19,10 +19,11 @@ helm plugin remove ... --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_plugin_update.md b/docs/helm/helm_plugin_update.md index cbfe9ad5e..59e4661d5 100644 --- a/docs/helm/helm_plugin_update.md +++ b/docs/helm/helm_plugin_update.md @@ -19,10 +19,11 @@ helm plugin update ... --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm plugin](helm_plugin.md) - add, list, or remove Helm plugins -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_repo.md b/docs/helm/helm_repo.md index 3f184e875..98db748cb 100644 --- a/docs/helm/helm_repo.md +++ b/docs/helm/helm_repo.md @@ -21,6 +21,7 @@ Example usage: --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` @@ -32,4 +33,4 @@ Example usage: * [helm repo remove](helm_repo_remove.md) - remove a chart repository * [helm repo update](helm_repo_update.md) - update information of available charts locally from chart repositories -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_repo_add.md b/docs/helm/helm_repo_add.md index c16797c63..500067aa8 100644 --- a/docs/helm/helm_repo_add.md +++ b/docs/helm/helm_repo_add.md @@ -28,10 +28,11 @@ helm repo add [flags] [NAME] [URL] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_repo_index.md b/docs/helm/helm_repo_index.md index aece31367..9e6a6f8af 100644 --- a/docs/helm/helm_repo_index.md +++ b/docs/helm/helm_repo_index.md @@ -35,10 +35,11 @@ helm repo index [flags] [DIR] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_repo_list.md b/docs/helm/helm_repo_list.md index 484ce3c68..985d41d75 100644 --- a/docs/helm/helm_repo_list.md +++ b/docs/helm/helm_repo_list.md @@ -19,10 +19,11 @@ helm repo list [flags] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_repo_remove.md b/docs/helm/helm_repo_remove.md index b34cee61c..ede5b77be 100644 --- a/docs/helm/helm_repo_remove.md +++ b/docs/helm/helm_repo_remove.md @@ -19,10 +19,11 @@ helm repo remove [flags] [NAME] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_repo_update.md b/docs/helm/helm_repo_update.md index 0c9fb6efd..cf30eb702 100644 --- a/docs/helm/helm_repo_update.md +++ b/docs/helm/helm_repo_update.md @@ -25,10 +25,11 @@ helm repo update --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm repo](helm_repo.md) - add, list, remove, update, and index chart repositories -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_reset.md b/docs/helm/helm_reset.md index dfb78c376..9fb85a923 100644 --- a/docs/helm/helm_reset.md +++ b/docs/helm/helm_reset.md @@ -35,10 +35,11 @@ helm reset --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_rollback.md b/docs/helm/helm_rollback.md index a2fedc559..f51720254 100644 --- a/docs/helm/helm_rollback.md +++ b/docs/helm/helm_rollback.md @@ -41,10 +41,11 @@ helm rollback [flags] [RELEASE] [REVISION] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_search.md b/docs/helm/helm_search.md index 1dc7e38ba..37a560c2b 100644 --- a/docs/helm/helm_search.md +++ b/docs/helm/helm_search.md @@ -32,10 +32,11 @@ helm search [keyword] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_serve.md b/docs/helm/helm_serve.md index 4ce8a997a..0113cabb0 100644 --- a/docs/helm/helm_serve.md +++ b/docs/helm/helm_serve.md @@ -40,10 +40,11 @@ helm serve --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_status.md b/docs/helm/helm_status.md index 2331558c0..314f1f331 100644 --- a/docs/helm/helm_status.md +++ b/docs/helm/helm_status.md @@ -39,10 +39,11 @@ helm status [flags] RELEASE_NAME --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_template.md b/docs/helm/helm_template.md index 983652dba..8a682c4f1 100644 --- a/docs/helm/helm_template.md +++ b/docs/helm/helm_template.md @@ -44,10 +44,11 @@ helm template [flags] CHART --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 15-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_test.md b/docs/helm/helm_test.md index b46d43e64..67aadb188 100644 --- a/docs/helm/helm_test.md +++ b/docs/helm/helm_test.md @@ -36,10 +36,11 @@ helm test [RELEASE] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_upgrade.md b/docs/helm/helm_upgrade.md index 5f4fde96c..117bd5cd3 100644 --- a/docs/helm/helm_upgrade.md +++ b/docs/helm/helm_upgrade.md @@ -71,10 +71,11 @@ helm upgrade [RELEASE] [CHART] --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_verify.md b/docs/helm/helm_verify.md index 74c3ee488..451b2ad52 100644 --- a/docs/helm/helm_verify.md +++ b/docs/helm/helm_verify.md @@ -34,10 +34,11 @@ helm verify [flags] PATH --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/docs/helm/helm_version.md b/docs/helm/helm_version.md index 1e46ceb18..ee8abcdfb 100644 --- a/docs/helm/helm_version.md +++ b/docs/helm/helm_version.md @@ -48,10 +48,11 @@ helm version --host string address of Tiller. Overrides $HELM_HOST --kube-context string name of the kubeconfig context to use --kubeconfig string path to kubeconfig file. Overrides $KUBECONFIG + --port int local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT --tiller-namespace string namespace of Tiller (default "kube-system") ``` ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 7-Nov-2017 +###### Auto generated by spf13/cobra on 30-Nov-2017 diff --git a/pkg/helm/environment/environment.go b/pkg/helm/environment/environment.go index b8bcf0def..835aac9e7 100644 --- a/pkg/helm/environment/environment.go +++ b/pkg/helm/environment/environment.go @@ -39,6 +39,8 @@ var DefaultHelmHome = filepath.Join(homedir.HomeDir(), ".helm") type EnvSettings struct { // TillerHost is the host and port of Tiller. TillerHost string + // TunnelLocalPort is the local port for portforward tunnel. + TunnelLocalPort int // TillerNamespace is the namespace in which Tiller runs. TillerNamespace string // Home is the local path to the Helm home directory. @@ -59,6 +61,7 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&s.KubeConfig, "kubeconfig", "", "path to kubeconfig file. Overrides $KUBECONFIG") fs.BoolVar(&s.Debug, "debug", false, "enable verbose output") fs.StringVar(&s.TillerNamespace, "tiller-namespace", "kube-system", "namespace of Tiller") + fs.IntVar(&s.TunnelLocalPort, "port", 0, "local port for portforward tunnel. Overrides $TUNNEL_LOCAL_PORT") } // Init sets values from the environment. @@ -83,6 +86,7 @@ var envMap = map[string]string{ "host": "HELM_HOST", "kubeconfig": "KUBECONFIG", "tiller-namespace": "TILLER_NAMESPACE", + "port": "TUNNEL_LOCAL_PORT", } func setFlagFromEnv(name, envar string, fs *pflag.FlagSet) { diff --git a/pkg/helm/environment/environment_test.go b/pkg/helm/environment/environment_test.go index 8f0caa388..a555b42a2 100644 --- a/pkg/helm/environment/environment_test.go +++ b/pkg/helm/environment/environment_test.go @@ -37,6 +37,7 @@ func TestEnvSettings(t *testing.T) { // expected values home, host, ns, kcontext, plugins string debug bool + port int }{ { name: "defaults", @@ -47,30 +48,33 @@ func TestEnvSettings(t *testing.T) { }, { name: "with flags set", - args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns"}, + args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns", "--port=44443"}, home: "/foo", plugins: helmpath.Home("/foo").Plugins(), host: "here", ns: "myns", debug: true, + port: 44443, }, { name: "with envvars set", args: []string{}, - envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns"}, + envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns", "TUNNEL_LOCAL_PORT": "44444"}, home: "/bar", plugins: helmpath.Home("/bar").Plugins(), host: "there", ns: "yourns", debug: true, + port: 44444, }, { name: "with flags and envvars set", - args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns"}, - envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns", "HELM_PLUGIN": "glade"}, + args: []string{"--home", "/foo", "--host=here", "--debug", "--tiller-namespace=myns", "--port=44443"}, + envars: map[string]string{"HELM_HOME": "/bar", "HELM_HOST": "there", "HELM_DEBUG": "1", "TILLER_NAMESPACE": "yourns", "HELM_PLUGIN": "glade", "TUNNEL_LOCAL_PORT": "44444"}, home: "/foo", plugins: "glade", host: "here", + port: 44443, ns: "myns", debug: true, }, @@ -102,6 +106,9 @@ func TestEnvSettings(t *testing.T) { if settings.TillerHost != tt.host { t.Errorf("expected host %q, got %q", tt.host, settings.TillerHost) } + if settings.TunnelLocalPort != tt.port { + t.Errorf("expected port %d, got %d", tt.port, settings.TunnelLocalPort) + } if settings.Debug != tt.debug { t.Errorf("expected debug %t, got %t", tt.debug, settings.Debug) } diff --git a/pkg/helm/portforwarder/portforwarder.go b/pkg/helm/portforwarder/portforwarder.go index 87f697a74..d25a953dc 100644 --- a/pkg/helm/portforwarder/portforwarder.go +++ b/pkg/helm/portforwarder/portforwarder.go @@ -34,14 +34,14 @@ var ( ) // New creates a new and initialized tunnel. -func New(namespace string, client kubernetes.Interface, config *rest.Config) (*kube.Tunnel, error) { +func New(namespace string, client kubernetes.Interface, config *rest.Config, localPort int) (*kube.Tunnel, error) { podName, err := getTillerPodName(client.CoreV1(), namespace) if err != nil { return nil, err } const tillerPort = 44134 t := kube.NewTunnel(client.Core().RESTClient(), config, namespace, podName, tillerPort) - return t, t.ForwardPort() + return t, t.ForwardPort(localPort) } func getTillerPodName(client corev1.PodsGetter, namespace string) (string, error) { diff --git a/pkg/kube/tunnel.go b/pkg/kube/tunnel.go index 08280f25d..852e1dfa9 100644 --- a/pkg/kube/tunnel.go +++ b/pkg/kube/tunnel.go @@ -62,7 +62,7 @@ func (t *Tunnel) Close() { } // ForwardPort opens a tunnel to a kubernetes pod -func (t *Tunnel) ForwardPort() error { +func (t *Tunnel) ForwardPort(localPort int) error { // Build a url to the portforward endpoint // example: http://localhost:8080/api/v1/namespaces/helm/pods/tiller-deploy-9itlq/portforward u := t.client.Post(). @@ -77,11 +77,15 @@ func (t *Tunnel) ForwardPort() error { } dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, "POST", u) - local, err := getAvailablePort() - if err != nil { - return fmt.Errorf("could not find an available port: %s", err) + if localPort == 0 { + local, err := getAvailablePort() + if err != nil { + return fmt.Errorf("could not find an available port: %s", err) + } + t.Local = local + } else { + t.Local = localPort } - t.Local = local ports := []string{fmt.Sprintf("%d:%d", t.Local, t.Remote)} diff --git a/pkg/plugin/plugin.go b/pkg/plugin/plugin.go index b3458c2d8..2efa434b5 100644 --- a/pkg/plugin/plugin.go +++ b/pkg/plugin/plugin.go @@ -19,6 +19,7 @@ import ( "io/ioutil" "os" "path/filepath" + "strconv" "strings" helm_env "k8s.io/helm/pkg/helm/environment" @@ -190,6 +191,8 @@ func SetupPluginEnv(settings helm_env.EnvSettings, "TILLER_HOST": settings.TillerHost, "TILLER_NAMESPACE": settings.TillerNamespace, + + "TUNNEL_LOCAL_PORT": strconv.Itoa(settings.TunnelLocalPort), } { os.Setenv(key, val) }