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
This commit is contained in:
Lukasz Szaszkiewicz 2022-07-25 08:50:17 +02:00
parent 9ec582da8b
commit 81dec8bc6a
2 changed files with 5 additions and 0 deletions

View File

@ -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 {

View File

@ -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),