Skip to content

Commit

Permalink
tls for tikv metircs api (#2137) (#2149)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored Apr 13, 2020
1 parent 95581ef commit 734c835
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit 734c835

Please sign in to comment.