kubeadm: remove constants for mirror pod timeout

StaticPodMirroringTimeout and StaticPodMirroringRetryInterval
are use for just an API call to get Pods(). The already existing
constants.KubernetesAPICallRetryInterval
and kubeadmapi.GetActiveTimeouts().KubernetesAPICall.Duration
can be used for that instead.
This commit is contained in:
Lubomir I. Ivanov 2024-02-29 19:52:18 +02:00
parent ded6354a8f
commit 99313bea88
3 changed files with 2 additions and 9 deletions

View File

@ -223,13 +223,6 @@ const (
// TLSBootstrapRetryInterval specifies how long kubeadm should wait before retrying the TLS Bootstrap check // TLSBootstrapRetryInterval specifies how long kubeadm should wait before retrying the TLS Bootstrap check
TLSBootstrapRetryInterval = 1 * time.Second TLSBootstrapRetryInterval = 1 * time.Second
// StaticPodMirroringTimeout specifies how much time kubeadm should wait for the static pods
// to be mirrored on the API server.
StaticPodMirroringTimeout = 30 * time.Second
// StaticPodMirroringRetryInterval specifies how often to check if static pods are mirrored at the
// API server.
StaticPodMirroringRetryInterval = 500 * time.Millisecond
// EtcdAPICallTimeout specifies how much time to wait for completion of requests against the etcd API. // EtcdAPICallTimeout specifies how much time to wait for completion of requests against the etcd API.
EtcdAPICallTimeout = 2 * time.Minute EtcdAPICallTimeout = 2 * time.Minute
// EtcdAPICallRetryInterval specifies how frequently to retry requests against the etcd API. // EtcdAPICallRetryInterval specifies how frequently to retry requests against the etcd API.

View File

@ -197,7 +197,7 @@ func getNodeNameFromKubeletConfig(fileName string) (string, error) {
func getAPIEndpoint(client clientset.Interface, nodeName string, apiEndpoint *kubeadmapi.APIEndpoint) error { func getAPIEndpoint(client clientset.Interface, nodeName string, apiEndpoint *kubeadmapi.APIEndpoint) error {
return getAPIEndpointWithRetry(client, nodeName, apiEndpoint, return getAPIEndpointWithRetry(client, nodeName, apiEndpoint,
constants.StaticPodMirroringRetryInterval, constants.StaticPodMirroringTimeout) constants.KubernetesAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().KubernetesAPICall.Duration)
} }
func getAPIEndpointWithRetry(client clientset.Interface, nodeName string, apiEndpoint *kubeadmapi.APIEndpoint, func getAPIEndpointWithRetry(client clientset.Interface, nodeName string, apiEndpoint *kubeadmapi.APIEndpoint,

View File

@ -172,7 +172,7 @@ func NewFromCluster(client clientset.Interface, certificatesDir string) (*Client
// getEtcdEndpoints returns the list of etcd endpoints. // getEtcdEndpoints returns the list of etcd endpoints.
func getEtcdEndpoints(client clientset.Interface) ([]string, error) { func getEtcdEndpoints(client clientset.Interface) ([]string, error) {
return getEtcdEndpointsWithRetry(client, return getEtcdEndpointsWithRetry(client,
constants.StaticPodMirroringRetryInterval, constants.StaticPodMirroringTimeout) constants.KubernetesAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().KubernetesAPICall.Duration)
} }
func getEtcdEndpointsWithRetry(client clientset.Interface, interval, timeout time.Duration) ([]string, error) { func getEtcdEndpointsWithRetry(client clientset.Interface, interval, timeout time.Duration) ([]string, error) {