diff --git a/charts/opensearch-operator/Chart.yaml b/charts/opensearch-operator/Chart.yaml index 57366a96..9ef3bb0a 100644 --- a/charts/opensearch-operator/Chart.yaml +++ b/charts/opensearch-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the opensearch-operator chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 2.8.0-dev1 +version: 2.7.0 # This is the version number of the application being deployed (the operator). This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: 2.8.0-dev1 +appVersion: 2.7.0 diff --git a/docs/userguide/main.md b/docs/userguide/main.md index 981233fb..46c10986 100644 --- a/docs/userguide/main.md +++ b/docs/userguide/main.md @@ -1076,6 +1076,9 @@ To support such cases the operator provides a special sidecar added to all Opens Note that there can still be situations with more than one pod down if a pod crashes or is restarted for some other reason while a node restart is in progress. +> [!WARNING] +> The sidecar feature is still experimential and could have unintended interference with normal cluster operations. Please test it before using it on a production system. + To configure the sidecar you need to do the following: 1. Create a Kubernetes ServiceAccount and give it the permission to perform leader election (find an example manifest below) @@ -1136,6 +1139,9 @@ spec: Keep in mind that this setup could block cluster node restarts/replacements for a long time if Opensearch has a problem, so be sure to choose sensible timeouts / max wait times in your operations tooling (ClusterAPI or cloud provider configuration). +> [!WARNING] +> If you perform an upgrade of Opensearch itself, you should consider disabling the sidecar beforehand. Upgrades can lead to the cluster staying in yellow state during the entire upgrade which the sidecar cannot detect so the upgrade would block. To stay on the safe side it is recommended to disable the sidecar before an upgrade (requires a rolling restart of the opensearch pods) and enable it again afterwards. + ## User and role management An important part of any OpenSearch cluster is the user and role management to give users access to the cluster (via the opensearch-security plugin). By default the operator will use the included demo securityconfig with default users (see [internal_users.yml](https://github.com/opensearch-project/security/blob/main/config/internal_users.yml) for a list of users). For any production installation you should swap that out with your own configuration. diff --git a/opensearch-operator/functionaltests/execute_tests.sh b/opensearch-operator/functionaltests/execute_tests.sh index bf0b1286..00f379c4 100755 --- a/opensearch-operator/functionaltests/execute_tests.sh +++ b/opensearch-operator/functionaltests/execute_tests.sh @@ -36,4 +36,4 @@ cd functionaltests go test ./operatortests -timeout 30m go test ./helmtests -timeout 20m ## Delete k3d cluster -#k3d cluster delete $CLUSTER_NAME +k3d cluster delete $CLUSTER_NAME diff --git a/opensearch-operator/functionaltests/operatortests/deploy-and-upgrade.yaml b/opensearch-operator/functionaltests/operatortests/deploy-and-upgrade.yaml index 1da8ca80..c93fa1d1 100644 --- a/opensearch-operator/functionaltests/operatortests/deploy-and-upgrade.yaml +++ b/opensearch-operator/functionaltests/operatortests/deploy-and-upgrade.yaml @@ -5,7 +5,7 @@ metadata: namespace: default spec: general: - version: 2.18.0 + version: 2.10.0 httpPort: 9200 vendor: opensearch serviceName: deploy-and-upgrade @@ -17,7 +17,7 @@ spec: confMgmt: smartScaler: true dashboards: - version: 2.18.0 + version: 2.10.0 enable: true replicas: 1 resources: diff --git a/opensearch-operator/functionaltests/operatortests/deploy_and_upgrade_test.go b/opensearch-operator/functionaltests/operatortests/deploy_and_upgrade_test.go index 59eadd43..04afd41c 100644 --- a/opensearch-operator/functionaltests/operatortests/deploy_and_upgrade_test.go +++ b/opensearch-operator/functionaltests/operatortests/deploy_and_upgrade_test.go @@ -52,8 +52,8 @@ var _ = Describe("DeployAndUpgrade", Ordered, func() { cluster.SetGroupVersionKind(schema.GroupVersionKind{Group: "opensearch.opster.io", Version: "v1", Kind: "OpenSearchCluster"}) Get(&cluster, client.ObjectKey{Name: name, Namespace: namespace}, time.Second*5) - SetNestedKey(cluster.Object, "2.3.0", "spec", "general", "version") - SetNestedKey(cluster.Object, "2.3.0", "spec", "dashboards", "version") + SetNestedKey(cluster.Object, "2.11.0", "spec", "general", "version") + SetNestedKey(cluster.Object, "2.11.0", "spec", "dashboards", "version") Expect(k8sClient.Update(context.Background(), &cluster)).ToNot(HaveOccurred()) }) @@ -66,7 +66,7 @@ var _ = Describe("DeployAndUpgrade", Ordered, func() { return sts.Spec.Template.Spec.Containers[0].Image } return "" - }, time.Minute*1, time.Second*5).Should(Equal("docker.io/opensearchproject/opensearch:2.3.0")) + }, time.Minute*1, time.Second*5).Should(Equal("docker.io/opensearchproject/opensearch:2.11.0")) Eventually(func() int32 { err := k8sClient.Get(context.Background(), client.ObjectKey{Name: name + "-masters", Namespace: namespace}, &sts) @@ -105,7 +105,7 @@ var _ = Describe("DeployAndUpgrade", Ordered, func() { return deployment.Spec.Template.Spec.Containers[0].Image } return "" - }, time.Minute*1, time.Second*5).Should(Equal("docker.io/opensearchproject/opensearch-dashboards:2.3.0")) + }, time.Minute*1, time.Second*5).Should(Equal("docker.io/opensearchproject/opensearch-dashboards:2.11.0")) Eventually(func() int32 { err := k8sClient.Get(context.Background(), client.ObjectKey{Name: name + "-dashboards", Namespace: namespace}, &deployment) diff --git a/opensearch-operator/pkg/reconcilers/rollingRestart.go b/opensearch-operator/pkg/reconcilers/rollingRestart.go index e0f367a8..767ef6d7 100644 --- a/opensearch-operator/pkg/reconcilers/rollingRestart.go +++ b/opensearch-operator/pkg/reconcilers/rollingRestart.go @@ -234,7 +234,9 @@ func (r *RollingRestartReconciler) restartStatefulSetPod(sts *appsv1.StatefulSet return ctrl.Result{}, err } - return ctrl.Result{}, nil + err = services.ReactivateShardAllocation(r.osClient) + + return ctrl.Result{}, err } func (r *RollingRestartReconciler) updateStatus(status string) error { diff --git a/opensearch-operator/pkg/reconcilers/upgrade.go b/opensearch-operator/pkg/reconcilers/upgrade.go index 73a3acfc..b0b6b827 100644 --- a/opensearch-operator/pkg/reconcilers/upgrade.go +++ b/opensearch-operator/pkg/reconcilers/upgrade.go @@ -382,7 +382,7 @@ func (r *UpgradeReconciler) doNodePoolUpgrade(pool opsterv1.NodePool) error { return err } - return nil + return services.ReactivateShardAllocation(r.osClient) } func (r *UpgradeReconciler) setComponentConditions(conditions []string, component string) {