Upgrading ECK
editUpgrading ECK
editUpgrading to ECK 1.0.0-beta1 from previous versions
editECK 1.0.0-beta1 includes changes that are incompatible with previous versions of the operator. Notable changes include:
-
Custom resource version has changed from
v1alpha1
tov1beta1
. - Some CRD fields have been removed and some others have been renamed to clarify their purpose.
- Elasticsearch cluster orchestration is now managed through StatefulSet resources.
See the Elastic Cloud on Kubernetes version 1.0.0-beta1 for more information about all the features included in this release.
It is recommended to install ECK 1.0.0-beta1 in a fresh Kubernetes cluster and migrate data over from existing clusters if possible. If you wish to install ECK into an existing Kubernetes cluster that has a previous version of the operator installed, it is important to consider the following:
- The old operator will be replaced by the new operator during the installation process.
- Existing Elasticsearch, Kibana and APM Server resources created by an old version of the operator will continue to work but they will not be managed by the new operator. This means that the orchestration benefits provided by the operator such as rolling upgrades will no longer be available to those resources.
- If the old operator is replaced without removing old resources first, you will have to manually disable finalizers to delete them later.
- Existing Kubernetes manifests should be converted to the new format in order to work with the new operator.
If some downtime is acceptable, upgrading in place can be performed as follows:
These instructions are general guidelines only. You should have a thoroughly tested upgrade plan for your environment before attempting to modify any production deployments.
- Convert existing manifests to the new format.
- Create snapshots of your existing Elasticsearch clusters.
- Uninstall ECK.
- Install new version of ECK.
- Re-create the resources by applying the manifests converted in the first step.
- Restore data from the snapshots.
Convert Manifests
editElasticsearch
-
Replace
v1alpha1
in theapiVersion
field withv1beta1
-
Rename
nodes
tonodeSets
-
Ensure that every
nodeSets
entry has aname
and renamenodeCount
tocount
-
Remove
setVmMaxMapCount
. See: Virtual memory. -
Remove
groups
fromupdateStrategy
. See: Update strategy. -
Remove
featureFlags
-
If you specified
secureSettings
, convertsecretName
into an array item by prefixing it with-
-apiVersion: elasticsearch.k8s.elastic.co/v1alpha1 +apiVersion: elasticsearch.k8s.elastic.co/v1beta1 kind: Elasticsearch metadata: name: elasticsearch-sample spec: version: 8.16.0 - setVmMaxMapCount: true - featureFlags: {} updateStrategy: changeBudget: maxUnavailable: 1 - groups: [] secureSettings: - secretName: "gcs-credentials" + - secretName: "gcs-credentials" - nodes: - - nodeCount: 3 + nodeSets: + - count: 3 + name: master-nodes
Kibana
-
Replace
v1alpha
in theapiVersion
field withv1beta1
-
Rename
nodeCount
tocount
-
If you specified
secureSettings
, convertsecretName
into an array item by prefixing it with-
-apiVersion: kibana.k8s.elastic.co/v1alpha1 +apiVersion: kibana.k8s.elastic.co/v1beta1 kind: Kibana metadata: name: kibana-sample spec: version: 8.16.0 - nodeCount: 1 + count: 1 elasticsearchRef: name: "elasticsearch-sample" secureSettings: - secretName: "gcs-credentials" + - secretName: "gcs-credentials"
APM Server
-
Replace
v1alpha
in theapiVersion
field withv1beta1
-
Rename
nodeCount
tocount
-
If you specified
secureSettings
, convertsecretName
into an array item by prefixing it with-
-apiVersion: apm.k8s.elastic.co/v1alpha1 +apiVersion: apm.k8s.elastic.co/v1beta1 kind: ApmServer metadata: name: apm-server-sample spec: version: 8.16.0 - nodeCount: 1 + count: 1 elasticsearchRef: name: "elasticsearch-sample" secureSettings: - secretName: "gcs-credentials" + - secretName: "gcs-credentials"
Backwards compatibility
editThe 1.0.0-beta version of the operator does not delete resources created by older versions of the operator, but it also does not manage them. Attempting to delete resources created with a 0.9.0 version will hang if ECK 1.0.0-beta1 is running. To unblock the deletion, remove any registered finalizer from the resource (substituting the correct name for quickstart
):
kubectl patch elasticsearch quickstart --patch '{"metadata": {"finalizers": []}}' --type=merge kubectl patch kibana quickstart --patch '{"metadata": {"finalizers": []}}' --type=merge kubectl patch apmserver quickstart --patch '{"metadata": {"finalizers": []}}' --type=merge