Upgrade
This page describes the in-place upgrade from operator 2.8.0 to Alauda Data Services Search Engine E1 3.0.
TOC
What changesHow the migration worksWhy every node pool restarts onceBefore the upgradeUpgrade the operatorAfter the upgradeOld resources after the migrationRollbackTroubleshootingWhat changes
Operator 2.8.0 managed resources in the opensearch.opster.io/v1 API group. E1 3.0 manages resources in the opensearch.org/v1 API group. The kinds and their fields are the same in both groups.
The E1 3.0 bundle installs the CRDs of both groups. After the upgrade:
- Automatic migration. For every resource in
opensearch.opster.io/v1, the operator creates a resource with the same name and namespace inopensearch.org/v1, with the same spec, labels and annotations, and copies the status. - The old group becomes read-only. A validating webhook rejects the creation of new
opensearch.opster.io/v1resources and any change to thespecof existing ones. Status updates and deletion are still allowed. - One rolling restart per node pool. Each node pool of each existing cluster is restarted once, one pod at a time.
From then on, the opensearch.org/v1 resource is the one you edit. The operator copies its status back to the old resource, but never copies spec changes in either direction after the migration.
How the migration works
The migration covers these kinds: OpenSearchCluster, OpensearchUser, OpensearchRole, OpensearchUserRoleBinding, OpensearchTenant, OpensearchActionGroup, OpenSearchISMPolicy, OpensearchSnapshotPolicy, OpensearchIndexTemplate and OpensearchComponentTemplate.
A resource is migrated only when it is in a ready state:
A resource that is not ready is skipped and checked again every 30 seconds. It is migrated as soon as it becomes ready.
Each migrated resource carries annotations that record its origin:
For clusters, the operator also makes the new resource the owner of the TLS certificate Secrets (<cluster>-ca, <cluster>-transport-cert, <cluster>-http-cert, <cluster>-admin-cert), so the certificates are kept even if the old resource is deleted later.
Why every node pool restarts once
A StatefulSet's pod selector cannot be changed, and E1 3.0 selects pods by the new opensearch.org/... labels. For each node pool, the operator therefore:
- relabels the running pods with the new labels;
- deletes the StatefulSet without deleting its pods;
- recreates the StatefulSet with the 3.0 specification, which adopts the running pods;
- restarts the adopted pods one at a time, because the 3.0 pod template differs from the 2.8.0 one.
The restart uses the regular rolling-restart procedure: one pod at a time, waiting for the cluster to recover before moving on. Data on persistent volumes is kept.
For every recreated StatefulSet the operator records a Warning event with the reason StatefulSetRecreated on the cluster, followed by RollingRestart events. If an OpenSearch version upgrade is in progress at the same time, the version upgrade restarts the pods instead.
Before the upgrade
Check each item on every Kubernetes cluster you are going to upgrade.
The upgrade starts when you switch the Subscription's channel to stable (see Upgrade the operator). If the Subscription uses automatic approval, the upgrade starts at once. Complete this checklist first, and switch the Subscription to manual approval so that you decide when the upgrade starts:
-
Set
vm.max_map_counton the nodes. E1 does not run the privileged init container that setvm.max_map_countin 2.8.0, whatever the value ofspec.general.setVMMaxMapCount. Every node that runs OpenSearch must havevm.max_map_countof 262144 or higher before the upgrade; otherwise the pods fail to start after their restart. See Set vm.max_map_count on nodes. -
All clusters are healthy and
RUNNING. Clusters that are notRUNNINGare not migrated until they are.Also check that the OpenSearch cluster health is
green. -
Other resources are
CREATED. For example:Repeat for the other kinds listed above that you use.
-
Every index has at least one replica. During the rolling restart, an index without replicas is unavailable while the node that holds it restarts. The cluster health is expected to be
yellowwhile each node restarts. -
Take a snapshot. There is no automated rollback (see Rollback). Take a snapshot of your data before you upgrade.
-
Check the engine version. The migration keeps
spec.general.versionunchanged; the operator upgrade does not upgrade OpenSearch. Because every pod is restarted, the image of the version each cluster runs must still be available to the nodes. -
Check clusters without TLS. In E1 3.0, a cluster whose spec has no TLS configuration (no
spec.security.tls.transportorspec.security.tls.http) runs with the OpenSearch security plugin disabled and serves plain HTTP without authentication. If such a cluster relied on the security plugin, resolve this before you upgrade. -
Check your Pod Security settings. After the restart, the OpenSearch and Dashboards pods run with the restricted defaults described in Installation, including
fsGroup: 1000for OpenSearch pods. If you set your ownpodSecurityContextorsecurityContext, your values still take precedence. -
Plan a maintenance window. The rolling restart can take a long time for node pools with many nodes or much data.
-
Update your automation. Scripts, GitOps repositories and Helm charts that create or modify
opensearch.opster.io/v1resources fail after the upgrade. Switch them toopensearch.org/v1, and switch label selectors fromopster.io/...toopensearch.org/....
Upgrade the operator
E1 3.0 is published in the same OLM package (opensearch-operator) on the stable channel only, and it is marked as able to replace any 2.8.x version. Operator 2.8.0 is on the alpha channel, which stays at 2.8.0, so a 2.8.0 Subscription is not upgraded until you switch its channel to stable:
The platform log storage (OpenSearch log storage of the platform logging feature) uses operator 2.8.0 on the alpha channel and creates opensearch.opster.io/v1 clusters, which E1 makes read-only. Do not switch the Subscription that the platform log storage uses to stable.
-
With automatic approval, OLM upgrades the operator as soon as the channel is switched.
-
With manual approval, approve the pending InstallPlan in the web console, or with kubectl:
If no upgrade is offered, check that the subscription's channel is stable and that its catalog source provides the E1 3.0 bundle. OLM only offers upgrades from the catalog source and channel that the subscription refers to.
If your 2.8.0 subscription points to a different catalog source than the one that publishes E1, OLM never offers the upgrade, because it does not move a subscription between catalog sources. Edit the subscription so that spec.source and spec.sourceNamespace name the catalog source that publishes E1, and set spec.channel to stable:
Wait until the new ClusterServiceVersion is Succeeded:
After the upgrade
-
New resources exist. Every old resource has a counterpart in the new group:
Repeat for the other kinds you use, for example
opensearchusers.opensearch.org. -
Watch the rolling restart.
Expect one
StatefulSetRecreatedevent per node pool, thenRollingRestartevents. -
The cluster is
RUNNINGand healthy once all pods have restarted:Check that the OpenSearch cluster health is back to
green. -
Make changes on the new group only. Use
kubectl edit opensearchclusters.opensearch.org <cluster-name>(and theopensearch.orggroup for every other kind). An attempt to change the spec of an old resource is rejected with a message that theopensearch.opster.io/v1API group is deprecated.
Old resources after the migration
You do not need to delete the old opensearch.opster.io/v1 resources. If you delete them:
- Deleting an old resource is held back until its
opensearch.org/v1counterpart exists, so it cannot be removed before it has been migrated. - Deleting an
opensearch.org/v1resource that was migrated also deletes the corresponding old resource.
Rollback
There is no automated rollback to operator 2.8.0:
- OLM does not downgrade an installed operator.
- After the migration, the old resources keep the spec they had at the time of the migration. Changes you make to
opensearch.org/v1resources are not copied back. - The node pool StatefulSets have been recreated with the
opensearch.org/...selector labels.
If the upgrade fails, collect the operator logs and the cluster events, keep the data volumes, and restore from the snapshot you took before the upgrade if needed.
Troubleshooting
OpenSearch® is a registered trademark of LF Projects, LLC.