@@ -24,6 +24,7 @@ import (
24
24
25
25
"github.com/openshift/microshift/pkg/config"
26
26
"github.com/openshift/microshift/pkg/util"
27
+ "github.com/openshift/microshift/pkg/util/cryptomaterial"
27
28
28
29
klog "k8s.io/klog/v2"
29
30
kubescheduler "k8s.io/kubernetes/cmd/kube-scheduler/app"
@@ -55,6 +56,10 @@ func (s *KubeScheduler) configure(cfg *config.Config) {
55
56
s .options .Authorization .RemoteKubeConfigFile = cfg .KubeConfigPath (config .KubeScheduler )
56
57
s .options .SecureServing .MinTLSVersion = cfg .ApiServer .TLS .MinVersion
57
58
s .options .SecureServing .CipherSuites = cfg .ApiServer .TLS .CipherSuites
59
+ // Use the same certificates as the apiserver for localhost communication
60
+ // to avoid creating new certificates just for this component having the same CN/SAN.
61
+ s .options .SecureServing .ServerCert .CertKey .CertFile = cryptomaterial .ServingCertPath (cryptomaterial .KubeAPIServerLocalhostServingCertDir (cryptomaterial .CertsDirectory (config .DataDir )))
62
+ s .options .SecureServing .ServerCert .CertKey .KeyFile = cryptomaterial .ServingKeyPath (cryptomaterial .KubeAPIServerLocalhostServingCertDir (cryptomaterial .CertsDirectory (config .DataDir )))
58
63
s .kubeconfig = cfg .KubeConfigPath (config .KubeScheduler )
59
64
}
60
65
@@ -80,7 +85,7 @@ func (s *KubeScheduler) Run(ctx context.Context, ready chan<- struct{}, stopped
80
85
// run readiness check
81
86
go func () {
82
87
// This endpoint uses a self-signed certificate on purpose, we need to skip verification.
83
- healthcheckStatus := util .RetryInsecureGet (ctx , "https://localhost:10259/healthz" )
88
+ healthcheckStatus := util .RetryGet (ctx , "https://localhost:10259/healthz" , cryptomaterial . CACertPath ( cryptomaterial . KubeAPIServerLocalhostSigner ( cryptomaterial . CertsDirectory ( config . DataDir ))) )
84
89
if healthcheckStatus != 200 {
85
90
klog .Errorf ("%s healthcheck failed due to kube-scheduler failure to start" , s .Name ())
86
91
errorChannel <- errors .New ("kube-scheduler healthcheck failed" )
0 commit comments