fix(helm): Add --tiller-tls-hostname flag to 'helm init'

This will fix the bug where 'helm init --wait' fails when TLS is used.

Signed-off-by: aswinkarthik <aswinkarthik93@gmail.com>
pull/4461/head
aswinkarthik 6 years ago
parent 3f0c6c5404
commit 1b34a511d4
No known key found for this signature in database
GPG Key ID: 9B68445C36434960

@ -286,7 +286,7 @@ func newClient() helm.Interface {
if tlsKeyFile == "" { if tlsKeyFile == "" {
tlsKeyFile = settings.Home.TLSKey() tlsKeyFile = settings.Home.TLSKey()
} }
debug("Host=%q, Key=%q, Cert=%q, CA=%q\n", tlsKeyFile, tlsCertFile, tlsCaCertFile) debug("Host=%q, Key=%q, Cert=%q, CA=%q\n", tlsServerName, tlsKeyFile, tlsCertFile, tlsCaCertFile)
tlsopts := tlsutil.Options{ tlsopts := tlsutil.Options{
ServerName: tlsServerName, ServerName: tlsServerName,
KeyFile: tlsKeyFile, KeyFile: tlsKeyFile,

@ -126,6 +126,7 @@ func newInitCmd(out io.Writer) *cobra.Command {
f.StringVar(&tlsKeyFile, "tiller-tls-key", "", "path to TLS key file to install with Tiller") f.StringVar(&tlsKeyFile, "tiller-tls-key", "", "path to TLS key file to install with Tiller")
f.StringVar(&tlsCertFile, "tiller-tls-cert", "", "path to TLS certificate file to install with Tiller") f.StringVar(&tlsCertFile, "tiller-tls-cert", "", "path to TLS certificate file to install with Tiller")
f.StringVar(&tlsCaCertFile, "tls-ca-cert", "", "path to CA root certificate") f.StringVar(&tlsCaCertFile, "tls-ca-cert", "", "path to CA root certificate")
f.StringVar(&tlsServerName, "tiller-tls-hostname", settings.TillerHost, "the server name used to verify the hostname on the returned certificates from Tiller")
f.StringVar(&stableRepositoryURL, "stable-repo-url", stableRepositoryURL, "URL for stable repository") f.StringVar(&stableRepositoryURL, "stable-repo-url", stableRepositoryURL, "URL for stable repository")
f.StringVar(&localRepositoryURL, "local-repo-url", localRepositoryURL, "URL for local repository") f.StringVar(&localRepositoryURL, "local-repo-url", localRepositoryURL, "URL for local repository")

@ -32,29 +32,30 @@ helm init [flags]
### Options ### Options
``` ```
--canary-image use the canary Tiller image --canary-image use the canary Tiller image
-c, --client-only if set does not install Tiller -c, --client-only if set does not install Tiller
--dry-run do not install local or remote --dry-run do not install local or remote
--force-upgrade force upgrade of Tiller to the current helm version --force-upgrade force upgrade of Tiller to the current helm version
-h, --help help for init -h, --help help for init
--history-max int limit the maximum number of revisions saved per release. Use 0 for no limit. --history-max int limit the maximum number of revisions saved per release. Use 0 for no limit.
--local-repo-url string URL for local repository (default "http://127.0.0.1:8879/charts") --local-repo-url string URL for local repository (default "http://127.0.0.1:8879/charts")
--net-host install Tiller with net=host --net-host install Tiller with net=host
--node-selectors string labels to specify the node on which Tiller is installed (app=tiller,helm=rocks) --node-selectors string labels to specify the node on which Tiller is installed (app=tiller,helm=rocks)
-o, --output OutputFormat skip installation and output Tiller's manifest in specified format (json or yaml) -o, --output OutputFormat skip installation and output Tiller's manifest in specified format (json or yaml)
--override stringArray override values for the Tiller Deployment manifest (can specify multiple or separate values with commas: key1=val1,key2=val2) --override stringArray override values for the Tiller Deployment manifest (can specify multiple or separate values with commas: key1=val1,key2=val2)
--replicas int amount of tiller instances to run on the cluster (default 1) --replicas int amount of tiller instances to run on the cluster (default 1)
--service-account string name of service account --service-account string name of service account
--skip-refresh do not refresh (download) the local repository cache --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") --stable-repo-url string URL for stable repository (default "https://kubernetes-charts.storage.googleapis.com")
-i, --tiller-image string override Tiller image -i, --tiller-image string override Tiller image
--tiller-tls install Tiller with TLS enabled --tiller-tls install Tiller with TLS enabled
--tiller-tls-cert string path to TLS certificate file to install with Tiller --tiller-tls-cert string path to TLS certificate file to install with Tiller
--tiller-tls-key string path to TLS key file to install with Tiller --tiller-tls-hostname string the server name used to verify the hostname on the returned certificates from Tiller
--tiller-tls-verify install Tiller with TLS enabled and to verify remote certificates --tiller-tls-key string path to TLS key file to install with Tiller
--tls-ca-cert string path to CA root certificate --tiller-tls-verify install Tiller with TLS enabled and to verify remote certificates
--upgrade upgrade if Tiller is already installed --tls-ca-cert string path to CA root certificate
--wait block until Tiller is running and ready to receive requests --upgrade upgrade if Tiller is already installed
--wait block until Tiller is running and ready to receive requests
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
@ -73,4 +74,4 @@ helm init [flags]
* [helm](helm.md) - The Helm package manager for Kubernetes. * [helm](helm.md) - The Helm package manager for Kubernetes.
###### Auto generated by spf13/cobra on 1-Aug-2018 ###### Auto generated by spf13/cobra on 1-Sep-2018

Loading…
Cancel
Save