-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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:
- Update the
kubectlcommands to use server-side apply instead (kubectl apply -f <file> --server-side=true). This will track applied configuration through themanagedFieldsmetadata field, avoiding the annotation length issue. However, this also attaches ownership for the updated fields, and will potentially cause conflicts later if--force-conflictsis not also used - When creating DWO resources, use
kubectl create, avoiding managed state in general. However,createfails if the resource already exists, sokubectl replacemust be used in that case. - 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.yamlto 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)