1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

Merge pull request #685 from JaneLiuL/master

add  liveness probe
This commit is contained in:
Kubernetes Prow Robot
2022-01-10 04:29:12 -08:00
committed by GitHub
5 changed files with 41 additions and 6 deletions

View File

@@ -47,6 +47,14 @@ spec:
ports: ports:
- containerPort: 10258 - containerPort: 10258
protocol: TCP protocol: TCP
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10258
scheme: HTTPS
initialDelaySeconds: 3
periodSeconds: 3
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
securityContext: securityContext:

View File

@@ -20,6 +20,7 @@ package app
import ( import (
"context" "context"
"io" "io"
"k8s.io/apiserver/pkg/server/healthz"
"sigs.k8s.io/descheduler/cmd/descheduler/app/options" "sigs.k8s.io/descheduler/cmd/descheduler/app/options"
"sigs.k8s.io/descheduler/pkg/descheduler" "sigs.k8s.io/descheduler/pkg/descheduler"
@@ -68,15 +69,17 @@ func NewDeschedulerCommand(out io.Writer) *cobra.Command {
klog.SetLogger(log) klog.SetLogger(log)
} }
ctx := context.TODO()
pathRecorderMux := mux.NewPathRecorderMux("descheduler")
if !s.DisableMetrics { if !s.DisableMetrics {
ctx := context.TODO()
pathRecorderMux := mux.NewPathRecorderMux("descheduler")
pathRecorderMux.Handle("/metrics", legacyregistry.HandlerWithReset()) pathRecorderMux.Handle("/metrics", legacyregistry.HandlerWithReset())
}
if _, err := SecureServing.Serve(pathRecorderMux, 0, ctx.Done()); err != nil { healthz.InstallHandler(pathRecorderMux, healthz.NamedCheck("Descheduler", healthz.PingHealthz.Check))
klog.Fatalf("failed to start secure server: %v", err)
return if _, err := SecureServing.Serve(pathRecorderMux, 0, ctx.Done()); err != nil {
} klog.Fatalf("failed to start secure server: %v", err)
return
} }
err := Run(s) err := Run(s)

View File

@@ -31,6 +31,14 @@ spec:
requests: requests:
cpu: "500m" cpu: "500m"
memory: "256Mi" memory: "256Mi"
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10258
scheme: HTTPS
initialDelaySeconds: 3
periodSeconds: 10
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
capabilities: capabilities:

View File

@@ -33,6 +33,14 @@ spec:
ports: ports:
- containerPort: 10258 - containerPort: 10258
protocol: TCP protocol: TCP
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10258
scheme: HTTPS
initialDelaySeconds: 3
periodSeconds: 3
resources: resources:
requests: requests:
cpu: 500m cpu: 500m

View File

@@ -29,6 +29,14 @@ spec:
requests: requests:
cpu: "500m" cpu: "500m"
memory: "256Mi" memory: "256Mi"
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 10258
scheme: HTTPS
initialDelaySeconds: 3
periodSeconds: 3
securityContext: securityContext:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
capabilities: capabilities: