Skip to content

Commit

Permalink
added startup_probe
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGroentved committed Mar 12, 2024
1 parent a787c56 commit 5e858fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package api

import (
"fmt"
"net/http"
"os"
"time"

Expand Down Expand Up @@ -47,6 +48,10 @@ func SetupRouter(webhookEnabled bool, workerEnabled bool, controllerEnabled bool
server.Mux().Handle(pat.Post("/"), webhookHandler)
}

server.Mux().HandleFunc(pat.Get("/healthz"), func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
})

if workerEnabled {
server.Mux().HandleFunc(pat.Post("/start"), dependencyHandler)
}
Expand Down
7 changes: 7 additions & 0 deletions terraform/modules/cloud_run/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ resource "google_cloud_run_v2_service" "main" {
name = "cloudsql"
mount_path = "/cloudsql"
}
startup_probe {
http_get {
path = "/healthz"
port = 3000
}
initial_delay_seconds = 2
}
}
containers {
name = "secret-dumper"
Expand Down

0 comments on commit 5e858fd

Please sign in to comment.