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

tls for tikv metircs api #2137

Merged
merged 4 commits into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/monitor/monitor/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ func addAlertManagerUrl(pc *config.Config, cmodel *MonitorConfigModel) {
func addTlsConfig(pc *config.Config) {

for id, sconfig := range pc.ScrapeConfigs {
// TiKV doesn't support scheme https for now.
// And we should fix it after TiKV fix this issue: https://github.com/tikv/tikv/issues/5340
if sconfig.JobName == "pd" || sconfig.JobName == "tidb" {
if sconfig.JobName == "pd" || sconfig.JobName == "tidb" || sconfig.JobName == "tikv" {
sconfig.HTTPClientConfig.TLSConfig = config.TLSConfig{
CAFile: path.Join(util.ClusterClientTLSPath, corev1.ServiceAccountRootCAKey),
CertFile: path.Join(util.ClusterClientTLSPath, corev1.TLSCertKey),
Expand Down
7 changes: 5 additions & 2 deletions pkg/monitor/monitor/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ scrape_configs:
- job_name: tikv
honor_labels: true
scrape_interval: 15s
scheme: http
scheme: https
kubernetes_sd_configs:
- api_server: null
role: pod
Expand All @@ -315,7 +315,10 @@ scrape_configs:
- ns1
- ns2
tls_config:
insecure_skip_verify: true
ca_file: /var/lib/cluster-client-tls/ca.crt
cert_file: /var/lib/cluster-client-tls/tls.crt
key_file: /var/lib/cluster-client-tls/tls.key
insecure_skip_verify: false
relabel_configs:
- source_labels: [__meta_kubernetes_pod_label_app_kubernetes_io_instance]
regex: target
Expand Down