diff --git a/cmd/helm/init.go b/cmd/helm/init.go index 56fc9941d..f08dc1ed5 100644 --- a/cmd/helm/init.go +++ b/cmd/helm/init.go @@ -115,6 +115,8 @@ func newInitCmd(out io.Writer) *cobra.Command { f.StringVar(&stableRepositoryURL, "stable-repo-url", stableRepositoryURL, "URL for stable repository") f.StringVar(&localRepositoryURL, "local-repo-url", localRepositoryURL, "URL for local repository") + f.BoolVar(&i.opts.EnableHostNetwork, "net-host", false, "install tiller with net=host") + return cmd } diff --git a/cmd/helm/installer/install.go b/cmd/helm/installer/install.go index 12f9b903a..90e832b07 100644 --- a/cmd/helm/installer/install.go +++ b/cmd/helm/installer/install.go @@ -164,6 +164,9 @@ func generateDeployment(opts *Options) *extensions.Deployment { }, }, }, + SecurityContext: &api.PodSecurityContext{ + HostNetwork: opts.EnableHostNetwork, + }, }, }, }, diff --git a/cmd/helm/installer/options.go b/cmd/helm/installer/options.go index 003bb1d70..eb9519f5d 100644 --- a/cmd/helm/installer/options.go +++ b/cmd/helm/installer/options.go @@ -65,6 +65,9 @@ type Options struct { // // Required and valid if and only if VerifyTLS is set. TLSCaCertFile string + + // EnableHostNetwork installs Tiller with net=host + EnableHostNetwork bool } func (opts *Options) selectImage() string { diff --git a/docs/helm/helm_init.md b/docs/helm/helm_init.md index 950acf679..3fe94b79c 100644 --- a/docs/helm/helm_init.md +++ b/docs/helm/helm_init.md @@ -37,6 +37,7 @@ helm init -c, --client-only if set does not install tiller --dry-run do not install local or remote --local-repo-url string URL for local repository (default "http://127.0.0.1:8879/charts") + --net-host install tiller with net=host --skip-refresh do not refresh (download) the local repository cache --stable-repo-url string URL for stable repository (default "https://kubernetes-charts.storage.googleapis.com") -i, --tiller-image string override tiller image @@ -61,4 +62,4 @@ helm init ### SEE ALSO * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 16-Apr-2017 +###### Auto generated by spf13/cobra on 18-Apr-2017 diff --git a/docs/man/man1/helm_init.1 b/docs/man/man1/helm_init.1 index dfd801ef8..9fea8ba40 100644 --- a/docs/man/man1/helm_init.1 +++ b/docs/man/man1/helm_init.1 @@ -57,6 +57,10 @@ To dump a manifest containing the Tiller deployment YAML, combine the \[la]http://127.0.0.1:8879/charts"\[ra] URL for local repository +.PP +\fB\-\-net\-host\fP[=false] + install tiller with net=host + .PP \fB\-\-skip\-refresh\fP[=false] do not refresh (download) the local repository cache @@ -124,4 +128,4 @@ To dump a manifest containing the Tiller deployment YAML, combine the .SH HISTORY .PP -16\-Apr\-2017 Auto generated by spf13/cobra +18\-Apr\-2017 Auto generated by spf13/cobra diff --git a/scripts/completions.bash b/scripts/completions.bash index b1cd9fe43..f928ae502 100644 --- a/scripts/completions.bash +++ b/scripts/completions.bash @@ -636,6 +636,8 @@ _helm_init() local_nonpersistent_flags+=("--dry-run") flags+=("--local-repo-url=") local_nonpersistent_flags+=("--local-repo-url=") + flags+=("--net-host") + local_nonpersistent_flags+=("--net-host") flags+=("--skip-refresh") local_nonpersistent_flags+=("--skip-refresh") flags+=("--stable-repo-url=")