Skip to content

Commit

Permalink
Merge pull request #1890 from my-git9/livs
Browse files Browse the repository at this point in the history
Add livenes for karmada-scheduler
  • Loading branch information
karmada-bot authored May 28, 2022
2 parents cc74a42 + 068f64e commit 4eba0e5
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions artifacts/deploy/karmada-scheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions charts/templates/karmada_scheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions pkg/karmadactl/cmdinit/kubernetes/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4eba0e5

Please sign in to comment.