Temporarily stop reconciliation

Stop resource reconciliation to change values for debugging.

Sometimes it may be necessary to stop the Kf controller or Kf operator from changing settings on a Kubernetes resource if you need to change values on it for debugging.

Operator managed resources

Resources managed by the Kf operator, usually found in the kf namespace, can have reconciliation disabled using the operator.knative.dev/mode annotation:

ValueBehavior
EnsureExistsThe resource will be created if it doesn’t exist, but values won’t be overwritten.
Reconcile or blankThe resource will be created if it doesn’t exist, and values will be overwritten.

To change values on operator managed resources for testing:

  1. Make a local copy of the resource so you can revert it later.

  2. Disable reconciliation by setting the annotation to EnsureExists.

    Example disabling reconciliation on the Kf controller

    kubectl annotate --overwrite -n kf deployment controller operator.knative.dev/mode=EnsureExists
    
  3. Update the resource as needed for testing.

  4. When done, restore the annotation to the original value and optionally restore the changed values.

Kf managed resources

Kf managed resources are child resources created in response to configuration set on Spaces, Apps, Builds, etc. These usually have the label app.kubernetes.io/managed-by: kf.

You can disable reconciliation by removing the metadata.ownerReference that references the parent Kf resource. Save a copy of the field so you can add it back when you’re done.

  1. Make a local copy of the resource so you can revert it later.

  2. Disable reconciliation by removing the metadata.ownerReference field.

    Example editing a Namespaced owned by a Kf Space:

    $ kubectl edit namespace test
    

    Empty the metadata.ownerReference field:

    apiVersion: v1
    kind: Namespace
    metadata:
        creationTimestamp: "2023-04-19T20:34:50Z"
        name: test
        ownerReferences: []
    
  3. Update the resource as needed for testing.

  4. When done, restore the resource to the original value.