mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 02:41:25 +00:00
Update kubernetes service on start for port changes
This commit is contained in:
parent
b6fa40d42e
commit
e168f321f3
@ -89,6 +89,11 @@ func (c *Controller) Start(stopCh <-chan struct{}) {
|
|||||||
runtime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
|
runtime.HandleError(fmt.Errorf("timed out waiting for caches to sync"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Service definition is reconciled during first run to correct port and type per expectations.
|
||||||
|
if err := c.UpdateKubernetesService(true); err != nil {
|
||||||
|
klog.Errorf("Unable to perform initial Kubernetes service initialization: %v", err)
|
||||||
|
}
|
||||||
// Reconcile during first run removing itself until server is ready.
|
// Reconcile during first run removing itself until server is ready.
|
||||||
endpointPorts := createEndpointPortSpec(c.PublicServicePort, "https")
|
endpointPorts := createEndpointPortSpec(c.PublicServicePort, "https")
|
||||||
if err := c.EndpointReconciler.RemoveEndpoints(kubernetesServiceName, c.PublicIP, endpointPorts); err == nil {
|
if err := c.EndpointReconciler.RemoveEndpoints(kubernetesServiceName, c.PublicIP, endpointPorts); err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user