Skip to content
Draft
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
2 changes: 1 addition & 1 deletion charts/kminion/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ spec:
livenessProbe:
failureThreshold: 3
httpGet:
path: /ready
path: /live
port: metrics
scheme: HTTP
initialDelaySeconds: 10
Expand Down
10 changes: 10 additions & 0 deletions charts/kminion/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ spec:
{{- end}}
resources:
{{- toYaml .Values.resources | nindent 12}}
{{- if .Values.deployment.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /live
port: {{.Values.service.port}}
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
timeoutSeconds: 1
{{- end }}
{{- if .Values.deployment.readinessProbe.enabled }}
readinessProbe:
httpGet:
Expand Down
2 changes: 2 additions & 0 deletions charts/kminion/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ daemonset:
enabled: false

deployment:
livenessProbe:
enabled: true
readinessProbe:
enabled: true

Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func main() {
),
)
http.Handle("/ready", minionSvc.HandleIsReady())
http.Handle("/live", minionSvc.HandleIsLive())

// Start HTTP server
address := net.JoinHostPort(cfg.Exporter.Host, strconv.Itoa(cfg.Exporter.Port))
Expand Down
12 changes: 12 additions & 0 deletions minion/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ func (s *Service) HandleIsReady() http.HandlerFunc {
}
}

func (s *Service) HandleIsLive() http.HandlerFunc {
type response struct {
StatusCode int `json:"statusCode"`
}
return func(w http.ResponseWriter, r *http.Request) {
res := response{StatusCode: http.StatusOK}
resJson, _ := json.Marshal(res)
w.WriteHeader(http.StatusOK)
w.Write(resJson)
}
}

// ensureCompatibility checks whether the options as configured are available in the connected cluster. For example
// we will check if the target Kafka's API version support the LogDirs request. If that's not the case we will
// disable the option and print a warning message.
Expand Down