Skip to content

Commit

Permalink
Adds probes in core-interceptors deployment
Browse files Browse the repository at this point in the history
This adds readiness probe and liveness probe in the core interceptors
deployment.

Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
  • Loading branch information
SM43 committed May 21, 2021
1 parent 7c165fc commit 82cfb79
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/interceptors/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func main() {
}
mux := http.NewServeMux()
mux.Handle("/", service)
mux.HandleFunc("/health", handler)
mux.HandleFunc("/readiness", handler)

srv := &http.Server{
Addr: fmt.Sprintf(":%d", Port),
Expand All @@ -90,3 +92,7 @@ func main() {
logger.Fatalf("failed to start interceptors service: %v", err)
}
}

func handler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
}
16 changes: 16 additions & 0 deletions config/interceptors/core-interceptors-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ spec:
value: config-observability-triggers
- name: METRICS_DOMAIN
value: tekton.dev/triggers
livenessProbe:
httpGet:
path: /health
port: 8082
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /readiness
port: 8082
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
securityContext:
allowPrivilegeEscalation: false
# User 65532 is the distroless nonroot user ID
Expand Down

0 comments on commit 82cfb79

Please sign in to comment.