Skip to content
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

Merged
merged 4 commits into from
May 13, 2019
Merged

Conversation

thrucker
Copy link
Contributor

@thrucker thrucker commented May 8, 2019

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 and tiller-tls-cert-path.

@sstarcher
Copy link
Owner

Sorry, I just now saw this I need to enable email notifications again. I'll review it later this weekend.

Copy link
Owner

@sstarcher sstarcher left a 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")
Copy link
Owner

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")
Copy link
Owner

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,
Copy link
Owner

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))
Copy link
Owner

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

@thrucker
Copy link
Contributor Author

Thanks for the review. I changed the code according to your feedback.

@sstarcher sstarcher merged commit a240b73 into sstarcher:master May 13, 2019
@sstarcher
Copy link
Owner

Thanks for the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants