kubeadm: use new etcd /livez and /readyz endpoints

etcd >= 3.5.11 includes new endpoints for liveness, startup
and readyness probes. Use them in 1.31.
This commit is contained in:
Lubomir I. Ivanov 2024-04-23 10:50:14 +03:00
parent a04cc020f1
commit eeac2dda70
2 changed files with 17 additions and 5 deletions

View File

@ -224,9 +224,12 @@ func GetEtcdPodSpec(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.A
v1.ResourceMemory: resource.MustParse("100Mi"),
},
},
LivenessProbe: staticpodutil.LivenessProbe(probeHostname, "/health?exclude=NOSPACE&serializable=true", probePort, probeScheme),
StartupProbe: staticpodutil.StartupProbe(probeHostname, "/health?serializable=false", probePort, probeScheme, componentHealthCheckTimeout),
Env: kubeadmutil.MergeKubeadmEnvVars(cfg.Etcd.Local.ExtraEnvs),
// The etcd probe endpoints are explained here:
// https://github.com/kubernetes/kubeadm/issues/3039
LivenessProbe: staticpodutil.LivenessProbe(probeHostname, "/livez", probePort, probeScheme),
ReadinessProbe: staticpodutil.ReadinessProbe(probeHostname, "/readyz", probePort, probeScheme),
StartupProbe: staticpodutil.StartupProbe(probeHostname, "/readyz", probePort, probeScheme, componentHealthCheckTimeout),
Env: kubeadmutil.MergeKubeadmEnvVars(cfg.Etcd.Local.ExtraEnvs),
},
etcdMounts,
// etcd will listen on the advertise address of the API server, in a different port (2379)

View File

@ -129,13 +129,22 @@ spec:
failureThreshold: 8
httpGet:
host: 127.0.0.1
path: /health?exclude=NOSPACE&serializable=true
path: /livez
port: 2381
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 15
name: etcd
readinessProbe:
failureThreshold: 3
httpGet:
host: 127.0.0.1
path: /readyz
port: 2381
scheme: HTTP
periodSeconds: 1
timeoutSeconds: 15
resources:
requests:
cpu: 100m
@ -144,7 +153,7 @@ spec:
failureThreshold: 24
httpGet:
host: 127.0.0.1
path: /health?serializable=false
path: /readyz
port: 2381
scheme: HTTP
initialDelaySeconds: 10