Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] add note about upgrading to 1.8.0 in openshift #1392

Merged
merged 10 commits into from
Sep 6, 2024
Binary file added docs/assets/openshift_1.8.0_crd_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/openshift_1.8.0_upgrade.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 28 additions & 2 deletions docs/install-openshift.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,33 @@ This issue is resolved in Datadog Operator bundle 1.4.2+. Use the OperatorHub UI
For further help, contact [Datadog Support][7].


### Datadog Operator 1.8.0 on OpenShift

![Error after upgrading to 1.8.0 without removing the deprecated v1alpha1 from CRD](assets/openshift_1.8.0_crd_error.png)

When upgrading from versions `<1.8.0` to Datadog Operator `1.8.0` of the Datadog Operator bundle provided to OperatorHub in OpenShift, one may encounter an error in the `InstallPlan` and/or `ClusterServiceVersion` due to the removal of the deprecated v1alpha1 CRD version:
```
Message: Risk of data loss updating "datadogagents.datadoghq.com": new CRD removes version v1alpha1 that is listed as a stored version on the existing CRD
```

It is therefore recommended to run the command below and only upgrade afterwards:

```bash
oc patch customresourcedefinitions datadogagents.datadoghq.com --subresource='status' --type='merge' -p '{"status":{"storedVersions":["v2alpha1"]}}'
```

For more details, see [Removing an old version][8] from the Kubernetes Custom Resources documentation. If this command was not run before the upgrade and you encountered the error, please follow the **Resolution** steps below.

#### Resolution

1. Remove `v1alpha1` from DatadogAgent CRD: `oc patch customresourcedefinitions datadogagents.datadoghq.com --subresource='status' --type='merge' -p '{"status":{"storedVersions":["v2alpha1"]}}'`
2. Remove both `ClusterServiceVersion` (current and failed upgrade): `oc delete csv datadog-operator.v1.7.0 datadog-operator.v1.8.0`
3. Remove the status from the `Subscription` to force a new reconciliation: `oc patch sub datadog-operator-certified --subresource='status' --type='json' -p='[{"op": "remove", "path": "/status"}]'`
4. The reconciliation should lead to a new `ClusterServiceVersion` (identical to the one preceeding the upgrade). Depending on the `installPlanApproval`, you might have to approve the `InstallPlan`.
5. Proceed with the upgrade normally from the OperatorHub.
tbavelier marked this conversation as resolved.
Show resolved Hide resolved
![Error after upgrading to 1.8.0 without removing the deprecated v1alpha1 from CRD](assets/openshift_1.8.0_upgrade.png)

**Note**: During these steps, the Datadog Agents will keep running, ensuring your observability is not disrupted.

[1]: https://catalog.redhat.com/software/operators/detail/5e9874986c5dcb34dfbb1a12#deploy-instructions
[2]: https://olm.operatorframework.io/
Expand All @@ -128,5 +155,4 @@ For further help, contact [Datadog Support][7].
[5]: https://app.datadoghq.com/organization-settings/api-keys
[6]: https://app.datadoghq.com/organization-settings/application-keys
[7]: https://www.datadoghq.com/support/


[8]: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/
Loading