diff --git a/cmd/migrator/app/migrator.go b/cmd/migrator/app/migrator.go index fcbb53490..419d3dd24 100644 --- a/cmd/migrator/app/migrator.go +++ b/cmd/migrator/app/migrator.go @@ -43,6 +43,10 @@ func NewMigratorCommand() *cobra.Command { func Run(ctx context.Context) error { http.Handle("/metrics", promhttp.Handler()) + livenessHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "ok") + }) + http.HandleFunc("/healthz", livenessHandler) go func() { http.ListenAndServe(":2112", nil) }() var err error diff --git a/cmd/trigger/app/trigger.go b/cmd/trigger/app/trigger.go index 4972ee0a5..18970c140 100644 --- a/cmd/trigger/app/trigger.go +++ b/cmd/trigger/app/trigger.go @@ -5,6 +5,7 @@ import ( "flag" "fmt" "log" + "net/http" "os" "github.com/spf13/cobra" @@ -41,6 +42,12 @@ func NewTriggerCommand() *cobra.Command { } func Run(ctx context.Context) error { + livenessHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "ok") + }) + http.HandleFunc("/healthz", livenessHandler) + go func() { http.ListenAndServe(":2113", nil) }() + var err error var config *rest.Config if *kubeconfigPath != "" { diff --git a/manifests/migrator.yaml b/manifests/migrator.yaml index 9e92711ff..84247020a 100644 --- a/manifests/migrator.yaml +++ b/manifests/migrator.yaml @@ -24,3 +24,10 @@ spec: - --alsologtostderr - --kube-api-qps=40 - --kube-api-burst=1000 + livenessProbe: + httpGet: + scheme: HTTP + port: 2112 + path: /healthz + initialDelaySeconds: 10 + timeoutSeconds: 60 diff --git a/manifests/trigger.yaml b/manifests/trigger.yaml index 5f704293e..7497d16f6 100644 --- a/manifests/trigger.yaml +++ b/manifests/trigger.yaml @@ -18,3 +18,10 @@ spec: containers: - name: trigger image: REGISTRY/storage-version-migration-trigger:VERSION + livenessProbe: + httpGet: + scheme: HTTP + port: 2113 + path: /healthz + initialDelaySeconds: 10 + timeoutSeconds: 60