From 81dec8bc6a3b0a772843d23c14cc6e3b2e734fcd Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 25 Jul 2022 08:50:17 +0200 Subject: [PATCH] kubeadm: pass etcd progress notification flag to etcd The experimental-watch-progress-notify-interval flag specifies an interval at which etcd sends data to the kube-api server. It is used by the WatchBookmark feature which is GA since 1.17. It will be used by a new WatchList feature which is Alpha since 1.25 In addition to that the feature was graduated to GA (non-experiment) in etcd 3.5 without any code changes --- cmd/kubeadm/app/phases/etcd/local.go | 1 + cmd/kubeadm/app/phases/etcd/local_test.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cmd/kubeadm/app/phases/etcd/local.go b/cmd/kubeadm/app/phases/etcd/local.go index 7baa0677347..a0dff2060ec 100644 --- a/cmd/kubeadm/app/phases/etcd/local.go +++ b/cmd/kubeadm/app/phases/etcd/local.go @@ -239,6 +239,7 @@ func getEtcdCommand(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.A "peer-client-cert-auth": "true", "snapshot-count": "10000", "listen-metrics-urls": fmt.Sprintf("http://%s", net.JoinHostPort(etcdLocalhostAddress, strconv.Itoa(kubeadmconstants.EtcdMetricsPort))), + "experimental-watch-progress-notify-interval": "5s", } if len(initialCluster) == 0 { diff --git a/cmd/kubeadm/app/phases/etcd/local_test.go b/cmd/kubeadm/app/phases/etcd/local_test.go index 8f834b6dbab..06978b6ef2c 100644 --- a/cmd/kubeadm/app/phases/etcd/local_test.go +++ b/cmd/kubeadm/app/phases/etcd/local_test.go @@ -177,6 +177,7 @@ func TestGetEtcdCommand(t *testing.T) { "etcd", "--name=foo", "--experimental-initial-corrupt-check=true", + "--experimental-watch-progress-notify-interval=5s", fmt.Sprintf("--listen-client-urls=https://127.0.0.1:%d,https://1.2.3.4:%d", kubeadmconstants.EtcdListenClientPort, kubeadmconstants.EtcdListenClientPort), fmt.Sprintf("--listen-metrics-urls=http://127.0.0.1:%d", kubeadmconstants.EtcdMetricsPort), fmt.Sprintf("--advertise-client-urls=https://1.2.3.4:%d", kubeadmconstants.EtcdListenClientPort), @@ -207,6 +208,7 @@ func TestGetEtcdCommand(t *testing.T) { "etcd", "--name=foo", "--experimental-initial-corrupt-check=true", + "--experimental-watch-progress-notify-interval=5s", fmt.Sprintf("--listen-client-urls=https://127.0.0.1:%d,https://1.2.3.4:%d", kubeadmconstants.EtcdListenClientPort, kubeadmconstants.EtcdListenClientPort), fmt.Sprintf("--listen-metrics-urls=http://127.0.0.1:%d", kubeadmconstants.EtcdMetricsPort), fmt.Sprintf("--advertise-client-urls=https://1.2.3.4:%d", kubeadmconstants.EtcdListenClientPort), @@ -238,6 +240,7 @@ func TestGetEtcdCommand(t *testing.T) { "etcd", "--name=bar", "--experimental-initial-corrupt-check=true", + "--experimental-watch-progress-notify-interval=5s", "--listen-client-urls=https://10.0.1.10:2379", fmt.Sprintf("--listen-metrics-urls=http://127.0.0.1:%d", kubeadmconstants.EtcdMetricsPort), "--advertise-client-urls=https://10.0.1.10:2379", @@ -264,6 +267,7 @@ func TestGetEtcdCommand(t *testing.T) { "etcd", "--name=foo", "--experimental-initial-corrupt-check=true", + "--experimental-watch-progress-notify-interval=5s", fmt.Sprintf("--listen-client-urls=https://[::1]:%d,https://[2001:db8::3]:%d", kubeadmconstants.EtcdListenClientPort, kubeadmconstants.EtcdListenClientPort), fmt.Sprintf("--listen-metrics-urls=http://[::1]:%d", kubeadmconstants.EtcdMetricsPort), fmt.Sprintf("--advertise-client-urls=https://[2001:db8::3]:%d", kubeadmconstants.EtcdListenClientPort),