Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ spec:
- name: webhook
image: jasonrichardsmith/sentry:0.1
imagePullPolicy: IfNotPresent
resources:
limits:
memory: 500Mi
cpu: 300m
requests:
memory: 500Mi
cpu: 300m
volumeMounts:
- name: webhook-certs
mountPath: /etc/webhook/certs
Expand All @@ -40,6 +47,20 @@ spec:
mountPath: /config.yaml
subPath: config.yaml
readOnly: true
readinessProbe:
httpGet:
path: /healthz
port: 443
scheme: HTTPS
initialDelaySeconds: 1
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: 443
scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 10
volumes:
- name: webhook-certs
secret:
Expand Down
6 changes: 6 additions & 0 deletions sentry/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ func (sh SentryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}
log.Info("Received request")
if r.URL.Path == "/healthz" {
log.Info("Received health check")
w.WriteHeader(http.StatusOK)
w.Write([]byte("200 - Healthy"))
return
}
contentType := r.Header.Get("Content-Type")
if contentType != "application/json" {
log.Errorf("contentType=%s, expect application/json", contentType)
Expand Down