-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
My controller owns and is responsible for making a deployment. The one container in this deployment has a liveness and startup probe. When the probes reach their failure threshold kubelet restarts the container. On this event when kubelet restarts the container I'd like to receive a reconcile to retrieve the latest container status (which I am currently not).
My understanding was that because my controller Owns(&corev1.Pod{})
(and the pod has the correct owner refs), that the update event on the pod triggered by kubelet of Warning Unhealthy 4m17s (x45 over 39m) kubelet Liveness probe failed: HTTP probe failed with statuscode: 503
would cause a reconcile.
Apologies if I am missing something.
Manager setup:
func ignoreStatusUpdates() predicate.Predicate {
return predicate.Funcs{
UpdateFunc: func(e event.UpdateEvent) bool {
// Ignore updates to CR status in which case metadata.Generation does not change
return e.ObjectOld.GetGeneration() != e.ObjectNew.GetGeneration()
},
}
}
func (r *MyController) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&appv1alpha1.MyCR{}, builder.WithPredicates(ignoreStatusUpdates())).
Owns(&appsv1.Deployment{}).
Owns(&corev1.Pod{}).
Owns(&corev1.Secret{}).
Owns(&corev1.ConfigMap{}).
Owns(&corev1.Service{}).
Complete(r)
}
Metadata
Metadata
Assignees
Labels
No labels