mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Make tunneler hold tunnels open and healthcheck vs. reopening every 5 minutes.
Also add a test for the Update() logic. Reordered tunnels vs. storage initialization (prevent a nil ptr panic)
This commit is contained in:
@@ -161,20 +161,6 @@ func New(c *Config) *Master {
|
||||
func (m *Master) InstallAPIs(c *Config) {
|
||||
apiGroupsInfo := []genericapiserver.APIGroupInfo{}
|
||||
|
||||
// Run the tunnel.
|
||||
healthzChecks := []healthz.HealthzChecker{}
|
||||
if m.tunneler != nil {
|
||||
m.tunneler.Run(m.getNodeAddresses)
|
||||
healthzChecks = append(healthzChecks, healthz.NamedCheck("SSH Tunnel Check", m.IsTunnelSyncHealthy))
|
||||
prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
||||
Name: "apiserver_proxy_tunnel_sync_latency_secs",
|
||||
Help: "The time since the last successful synchronization of the SSH tunnels for proxy requests.",
|
||||
}, func() float64 { return float64(m.tunneler.SecondsSinceSync()) })
|
||||
}
|
||||
|
||||
// TODO(nikhiljindal): Refactor generic parts of support services (like /versions) to genericapiserver.
|
||||
apiserver.InstallSupport(m.MuxHelper, m.RootWebService, c.EnableProfiling, healthzChecks...)
|
||||
|
||||
// Install v1 unless disabled.
|
||||
if !m.ApiGroupVersionOverrides["api/v1"].Disable {
|
||||
// Install v1 API.
|
||||
@@ -192,6 +178,20 @@ func (m *Master) InstallAPIs(c *Config) {
|
||||
apiGroupsInfo = append(apiGroupsInfo, apiGroupInfo)
|
||||
}
|
||||
|
||||
// Run the tunneler.
|
||||
healthzChecks := []healthz.HealthzChecker{}
|
||||
if m.tunneler != nil {
|
||||
m.tunneler.Run(m.getNodeAddresses)
|
||||
healthzChecks = append(healthzChecks, healthz.NamedCheck("SSH Tunnel Check", m.IsTunnelSyncHealthy))
|
||||
prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
||||
Name: "apiserver_proxy_tunnel_sync_latency_secs",
|
||||
Help: "The time since the last successful synchronization of the SSH tunnels for proxy requests.",
|
||||
}, func() float64 { return float64(m.tunneler.SecondsSinceSync()) })
|
||||
}
|
||||
|
||||
// TODO(nikhiljindal): Refactor generic parts of support services (like /versions) to genericapiserver.
|
||||
apiserver.InstallSupport(m.MuxHelper, m.RootWebService, c.EnableProfiling, healthzChecks...)
|
||||
|
||||
// Install root web services
|
||||
m.HandlerContainer.Add(m.RootWebService)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user