Merge pull request #1890 from my-git9/livs

Add livenes for karmada-scheduler
This commit is contained in:
karmada-bot 2022-05-29 00:11:46 +08:00 committed by GitHub
commit 4eba0e506b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 0 deletions

View File

@ -23,6 +23,15 @@ spec:
- name: karmada-scheduler
image: swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-scheduler:latest
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /healthz
port: 10351
scheme: HTTP
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
command:
- /bin/karmada-scheduler
- --kubeconfig=/etc/kubeconfig

View File

@ -60,6 +60,15 @@ spec:
- --bind-address=0.0.0.0
- --secure-port=10351
- --feature-gates=Failover=true
livenessProbe:
httpGet:
path: /healthz
port: 10351
scheme: HTTP
failureThreshold: 3
initialDelaySeconds: 15
periodSeconds: 15
timeoutSeconds: 5
volumeMounts:
{{- include "karmada.kubeconfig.volumeMount" . | nindent 12 }}
resources:

View File

@ -360,6 +360,23 @@ func (i *CommandInitOption) makeKarmadaSchedulerDeployment() *appsv1.Deployment
},
}
// Probes
livenesProbe := &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/healthz",
Port: intstr.IntOrString{
IntVal: 10351,
},
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: 15,
FailureThreshold: 3,
PeriodSeconds: 15,
TimeoutSeconds: 5,
}
podSpec := corev1.PodSpec{
Affinity: &corev1.Affinity{
PodAntiAffinity: &corev1.PodAntiAffinity{
@ -394,6 +411,7 @@ func (i *CommandInitOption) makeKarmadaSchedulerDeployment() *appsv1.Deployment
fmt.Sprintf("--leader-elect-resource-namespace=%s", i.Namespace),
"--v=4",
},
LivenessProbe: livenesProbe,
VolumeMounts: []corev1.VolumeMount{
{
Name: kubeConfigSecretAndMountName,