KubeBuilder Controller (Reconciler)

go
CopyEdit
func (r *MyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
    pod := &corev1.Pod{}
    if err := r.Get(ctx, req.NamespacedName, pod); err != nil {
        return ctrl.Result{}, client.IgnoreNotFound(err)
    }

    fmt.Println("Reconciling Pod:", pod.Name)
    return ctrl.Result{}, nil
}

πŸ‘‰ This is more like a background job, not an HTTP endpoint.

Flow