-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for TLS connections to tiller #13
Conversation
Sorry, I just now saw this I need to enable email notifications again. I'll review it later this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebase on master for the conflicts
main.go
Outdated
tillerNamespace = flag.String("tiller-namespace", "kube-system", "namespace of Tiller (default \"kube-system\")") | ||
tillerTLSEnable = flag.Bool("tiller-tls-enable", false, "enable TLS communication with tiller (default false)") | ||
tillerTLSKey = flag.String("tiller-tls-key-path", "/etc/helm-exporter/tls.key", "path to private key file used to communicate with tiller") | ||
tillerTLSCert = flag.String("tiller-tls-cert-path", "/etc/helm-exporter/tls.crt", "path to certificate key file used to communicate with tiller") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets use the same flags as tiller --tiller-tls-cert
main.go
Outdated
tillerNamespace = flag.String("tiller-namespace", "kube-system", "namespace of Tiller (default \"kube-system\")") | ||
tillerTLSEnable = flag.Bool("tiller-tls-enable", false, "enable TLS communication with tiller (default false)") | ||
tillerTLSKey = flag.String("tiller-tls-key-path", "/etc/helm-exporter/tls.key", "path to private key file used to communicate with tiller") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--tiller-tls-key
main.go
Outdated
tlsopts := tlsutil.Options{ | ||
KeyFile: *tillerTLSKey, | ||
CertFile: *tillerTLSCert, | ||
InsecureSkipVerify: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a flag for this --tiller-tls-verify
main.go
Outdated
} | ||
tlscfg, err := tlsutil.ClientConfig(tlsopts) | ||
if err != nil { | ||
panic(fmt.Sprintf("unable to create TLS config: %s", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return a err instead of panicing
Thanks for the review. I changed the code according to your feedback. |
Thanks for the PR |
Tiller may be configured to only accept TLS connections from clients with a valid known certificate. This PR adds the possibility to specify and use a TLS client cert in helm-exporter to successfully connect to such tiller instances.
The helm-exporter can be configured with the newly added command line flags
tiller-tls-enable
,tiller-tls-key-path
andtiller-tls-cert-path
.