Skip to content

[chectl] Update how DevWorkspace Operator resources are applied to clusters when installing #21731

@amisevsk

Description

@amisevsk

Is your task related to a problem? Please describe

When installing Che on a minikube cluster (and likely other non-OLM installs), chectl delegates to kubectl to install the DevWorkspace Operator on the cluster. However, once devfile/devworkspace-operator#868 is merged, this step will fail: the DevWorkspace CRD has grown to the size where it no longer fits within the default-applied annotation kubectl.kubernetes.io/last-applied-configuration, causing the apply to fail with

The CustomResourceDefinition "devworkspaces.workspace.devfile.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes

With the current next version of chectl, this annotation is present on CRDs when not using the operator install path.

Describe the solution you'd like

There are multiple approaches to fixing this:

  1. Update the kubectl commands to use server-side apply instead (kubectl apply -f <file> --server-side=true). This will track applied configuration through the managedFields metadata field, avoiding the annotation length issue. However, this also attaches ownership for the updated fields, and will potentially cause conflicts later if --force-conflicts is not also used
  2. When creating DWO resources, use kubectl create, avoiding managed state in general. However, create fails if the resource already exists, so kubectl replace must be used in that case.
  3. Update the install method in chectl to use the k8s API in the same way that's used for applying Che-specific resources. The issue with this approach is that it's not as straightforward to pass in combined.yaml to deploy DWO in one step.

On the DWO side, to avoid the issue in our development scripts, we've gone with option 1 for the time being.

Describe alternatives you've considered

See above

Additional context

Explanation in DWO PR: devfile/devworkspace-operator#868 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/chectlIssues related to chectl, the CLI of Chearea/installIssues related to installation, including offline/air gap and initial setupkind/taskInternal things, technical debt, and to-do tasks to be performed.severity/P1Has a major impact to usage or development of the system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions