mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Let the kubernetes service reconciler timeout on shutdown
This commit is contained in:
		@@ -152,7 +152,22 @@ func (c *Controller) Stop() {
 | 
				
			|||||||
		c.runner.Stop()
 | 
							c.runner.Stop()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	endpointPorts := createEndpointPortSpec(c.PublicServicePort, "https", c.ExtraEndpointPorts)
 | 
						endpointPorts := createEndpointPortSpec(c.PublicServicePort, "https", c.ExtraEndpointPorts)
 | 
				
			||||||
	c.EndpointReconciler.StopReconciling("kubernetes", c.PublicIP, endpointPorts)
 | 
						finishedReconciling := make(chan struct{})
 | 
				
			||||||
 | 
						go func() {
 | 
				
			||||||
 | 
							defer close(finishedReconciling)
 | 
				
			||||||
 | 
							glog.Infof("Shutting down kubernetes service endpoint reconciler")
 | 
				
			||||||
 | 
							if err := c.EndpointReconciler.StopReconciling("kubernetes", c.PublicIP, endpointPorts); err != nil {
 | 
				
			||||||
 | 
								glog.Error(err)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						select {
 | 
				
			||||||
 | 
						case <-finishedReconciling:
 | 
				
			||||||
 | 
							// done
 | 
				
			||||||
 | 
						case <-time.After(2 * c.EndpointInterval):
 | 
				
			||||||
 | 
							// don't block server shutdown forever if we can't reach etcd to remove ourselves
 | 
				
			||||||
 | 
							glog.Warning("StopReconciling() timed out")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// RunKubernetesNamespaces periodically makes sure that all internal namespaces exist
 | 
					// RunKubernetesNamespaces periodically makes sure that all internal namespaces exist
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user