Score:1

How can we modify the heartbeat synchronization time of the etcd cluster on Kubernetes

fr flag

I want to modify heartbeat-interval of embedded etcd cluster running on kubernetes, I know while installation we can do with kubeadm extraargs but how to do in running cluster?

Before modifying I want to know current values too.

EDIT1: To get existing value use following

kubectl -n kube-system  logs  etcd-<NodeHostName> |grep heart
2021-06-25 11:08:31.612468 I | embed: heartbeat = 100ms

I also tried below but its not working for k8s.gcr.io/etcd:3.4.13-0

kubectl -n kube-system exec etcd-<NodeHostName> -- env|grep "ETCD_HEARTBEAT_INTERVAL"
Score:1
fr flag

I found following way to configure heartbeat

edit /etc/kubernetes/manifests/etcd.yaml on each etcd node and add heartbeat-interval and election-timeout like following, it will restart etcd so add one by one with delay so you should not lose quorm.

- command:
    - etcd
    - --advertise-client-urls=https://x.x.x.x:2379
    - --cert-file=/etc/kubernetes/pki/etcd/server.crt
    - --client-cert-auth=true
    - --data-dir=/var/lib/etcd
    - --initial-advertise-peer-urls=https://x.x.x.x:2380
    - --initial-cluster=x.x.com=https://x.x.x.x:2380
    - --key-file=/etc/kubernetes/pki/etcd/server.key
    - --listen-client-urls=https://127.0.0.1:2379,https://x.x.x.x:2379
    - --listen-metrics-urls=http://127.0.0.1:2381
    - --listen-peer-urls=https://x.x.x.x:2380
    - --name=x.x.x.x.com
    - --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt
    - --peer-client-cert-auth=true
    - --peer-key-file=/etc/kubernetes/pki/etcd/peer.key
    - --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt
    - --snapshot-count=10000
    - --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt
    - --heartbeat-interval=500
    - --election-timeout=5000
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.