mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #124465 from neolit123/1.31-add-etcd-livez-readyz
kubeadm: use etcd 3.5.11's /livez and /readyz endpoints for probes
This commit is contained in:
commit
44c45484e0
@ -319,7 +319,7 @@ const (
|
||||
KubeletHealthzPort = 10248
|
||||
|
||||
// MinExternalEtcdVersion indicates minimum external etcd version which kubeadm supports
|
||||
MinExternalEtcdVersion = "3.4.13-4"
|
||||
MinExternalEtcdVersion = "3.5.11-0"
|
||||
|
||||
// DefaultEtcdVersion indicates the default etcd version that kubeadm uses
|
||||
DefaultEtcdVersion = "3.5.13-0"
|
||||
@ -481,13 +481,6 @@ var (
|
||||
|
||||
// SupportedEtcdVersion lists officially supported etcd versions with corresponding Kubernetes releases
|
||||
SupportedEtcdVersion = map[uint8]string{
|
||||
22: "3.5.13-0",
|
||||
23: "3.5.13-0",
|
||||
24: "3.5.13-0",
|
||||
25: "3.5.13-0",
|
||||
26: "3.5.13-0",
|
||||
27: "3.5.13-0",
|
||||
28: "3.5.13-0",
|
||||
29: "3.5.13-0",
|
||||
30: "3.5.13-0",
|
||||
31: "3.5.13-0",
|
||||
|
@ -124,11 +124,15 @@ func TestGetStaticPodFilepath(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEtcdSupportedVersionLength(t *testing.T) {
|
||||
const max = 3
|
||||
if len(SupportedEtcdVersion) > max {
|
||||
t.Fatalf("SupportedEtcdVersion must not include more than %d versions", max)
|
||||
}
|
||||
}
|
||||
|
||||
func TestEtcdSupportedVersion(t *testing.T) {
|
||||
var supportedEtcdVersion = map[uint8]string{
|
||||
13: "3.2.24",
|
||||
14: "3.3.10",
|
||||
15: "3.3.10",
|
||||
16: "3.3.17-0",
|
||||
17: "3.4.3-0",
|
||||
18: "3.4.3-0",
|
||||
@ -147,7 +151,7 @@ func TestEtcdSupportedVersion(t *testing.T) {
|
||||
},
|
||||
{
|
||||
kubernetesVersion: "1.10.1",
|
||||
expectedVersion: version.MustParseSemantic("3.2.24"),
|
||||
expectedVersion: version.MustParseSemantic("3.3.17-0"),
|
||||
expectedWarning: true,
|
||||
expectedError: false,
|
||||
},
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user