karmadactl: add liveness probe into kube-controller-manager

Signed-off-by: carlory <baofa.fan@daocloud.io>
This commit is contained in:
carlory 2022-11-16 17:46:24 +08:00
parent 84ec3c21ff
commit d8246db213
1 changed files with 18 additions and 0 deletions

View File

@ -233,6 +233,23 @@ func (i *CommandInitOption) makeKarmadaKubeControllerManagerDeployment() *appsv1
},
}
// Probes
livenessProbe := &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/healthz",
Port: intstr.IntOrString{
IntVal: 10257,
},
Scheme: corev1.URISchemeHTTPS,
},
},
InitialDelaySeconds: 10,
FailureThreshold: 8,
PeriodSeconds: 10,
TimeoutSeconds: 15,
}
podSpec := corev1.PodSpec{
Affinity: &corev1.Affinity{
PodAntiAffinity: &corev1.PodAntiAffinity{
@ -279,6 +296,7 @@ func (i *CommandInitOption) makeKarmadaKubeControllerManagerDeployment() *appsv1
"--use-service-account-credentials=true",
"--v=4",
},
LivenessProbe: livenessProbe,
Ports: []corev1.ContainerPort{
{
Name: portName,