Skip to content

Commit 5803780

Browse files
committed
Throw out certificate again.
This is because Prometheus seems to need a file name relative to its own config rather than the actual certificate in the ServiceMonitor. Switched to insecure, which is OK for metrics.
1 parent 0c6f203 commit 5803780

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

pkg/deployment/resources/servicemonitor.go

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,13 @@ func (r *Resources) EnsureMonitoringClient() (*clientv1.MonitoringV1Client, erro
6969

7070
func (r *Resources) makeEndpoint(isSecure bool) coreosv1.Endpoint {
7171
if isSecure {
72-
kubecli := r.context.GetKubeCli()
73-
ns := r.context.GetNamespace()
74-
secrets := k8sutil.NewSecretCache(kubecli.CoreV1().Secrets(ns))
75-
spec := r.context.GetSpec()
76-
secretName := spec.TLS.GetCASecretName()
77-
cert, _, _, err := k8sutil.GetCASecret(secrets, secretName, nil)
78-
79-
var tlsconfig *coreosv1.TLSConfig
80-
if err == nil {
81-
tlsconfig = &coreosv1.TLSConfig{
82-
CAFile: cert,
83-
InsecureSkipVerify: false,
84-
}
85-
} else {
86-
tlsconfig = &coreosv1.TLSConfig{
87-
InsecureSkipVerify: true,
88-
}
89-
}
9072
return coreosv1.Endpoint{
91-
Port: "exporter",
92-
Interval: "10s",
93-
Scheme: "https",
94-
TLSConfig: tlsconfig,
73+
Port: "exporter",
74+
Interval: "10s",
75+
Scheme: "https",
76+
TLSConfig: &coreosv1.TLSConfig{
77+
InsecureSkipVerify: true,
78+
},
9579
}
9680
} else {
9781
return coreosv1.Endpoint{

0 commit comments

Comments
 (0)