Skip to content

Remove Elasticsearch 6.x support#8979

Merged
pebrc merged 10 commits intoelastic:mainfrom
pebrc:remove-6x-orch
Jan 5, 2026
Merged

Remove Elasticsearch 6.x support#8979
pebrc merged 10 commits intoelastic:mainfrom
pebrc:remove-6x-orch

Conversation

@pebrc
Copy link
Collaborator

@pebrc pebrc commented Dec 30, 2025

Summary

Note: This PR was generated with AI assistance (Claude Opus 4.5)

This PR removes all code related to orchestrating Elasticsearch 6.x clusters from the ECK codebase. Since ECK stopped supporting Elasticsearch 6.x several releases ago, this cleanup removes obsolete code paths, simplifies the codebase, and reduces maintenance burden.

Changes

Zen1 Discovery Removal

  • Deleted the entire pkg/controller/elasticsearch/version/zen1 package
  • Removed discovery.zen.minimum_master_nodes configuration and API calls
  • Simplified the driver layer by removing zen1 orchestration hooks

Zen2 Simplification

  • Removed nonHAZen1MasterUpgrade() logic for v6→v7 upgrades
  • Simplified shouldSetInitialMasterNodes() - now only checks if cluster is bootstrapped
  • Removed unused imports and test cases

Client Refactoring

  • Deleted pkg/controller/elasticsearch/client/v6.go
  • Restructured clientV7 to embed baseClient directly instead of clientV6
  • Removed SetMinimumMasterNodes from the Client interface
  • Removed DiscoveryZen and DiscoveryZenSettings model types

Configuration Cleanup

  • Removed DiscoveryZenMinimumMasterNodes and DiscoveryZenHostsProvider constants
  • Removed 6.x security realm syntax constants
  • Simplified merged_config.go to always use 7.x+ conventions
  • Updated minimum supported version for 7.x from 6.8.0 to 7.0.0

Roles and Associations

  • Removed ApmUserRoleV6 and its role definition
  • Updated APM-ES association to use 7.x roles as the baseline

Test and Documentation Cleanup

  • Updated test fixtures to use 7.x versions
  • Removed 6.x test cases across unit and e2e tests
  • Removed unused ZenDiscoveryStatus struct from v1beta1 API
  • Cleaned up comments referencing 6.x behavior

Breaking Changes

None. Elasticsearch 6.x has not been supported for several releases.

Testing

  • All unit tests pass
  • All affected packages verified with go vet and staticcheck

- Delete entire pkg/controller/elasticsearch/version/zen1/ package
- Remove zen1 calls from driver layer (upscale, nodes, downscale)
- Simplify updateZenSettingsForDownscale to only handle zen2
- Update expectations.go comments to remove zen1 references
- Update tests to remove 6.x version fixtures

This is part of removing Elasticsearch 6.x support from ECK.
- Remove nonHAZen1MasterUpgrade() function from initial_master_nodes.go
- Simplify shouldSetInitialMasterNodes() to only check bootstrap state
- Remove unused imports (sset, es_sset, set)
- Update tests to remove v6-related test cases
- Update compatibility_test.go to use v7/v8 versions

This is part of removing Elasticsearch 6.x support from ECK.
- Delete pkg/controller/elasticsearch/client/v6.go entirely
- clientV7 now embeds baseClient directly instead of clientV6
- Remove SetMinimumMasterNodes from Client interface
- Remove DiscoveryZen and DiscoveryZenSettings from model.go
- Keep security methods in security.go, shard methods in shard.go
- Update versioned() in base.go to only create v7/v8 clients
- Update all tests to use v7+ versions
- Remove SetMinimumMasterNodes from fakeESClient in tests

This is part of removing Elasticsearch 6.x support from ECK.
- Remove DiscoveryZenMinimumMasterNodes and DiscoveryZenHostsProvider constants
- Remove 6.x realm syntax constants (XPackSecurityAuthcRealmsFile1*, etc.)
- Remove ver.Major < 7 conditionals in merged_config.go
- Update 7.x minimum supported version from 6.8.0 to 7.0.0
- Update test fixtures to use 7.x versions

This is part of removing Elasticsearch 6.x support from ECK.
- Remove ApmUserRoleV6 constant and role definition from roles.go
- Update getAPMElasticsearchRoles() to use v7 role as fallback
- Remove 6.8.x test cases from apm_es_test.go
- Update expected role count from 58 to 57 in reconcile_test.go
- Update validation test to use 7.0.0 instead of 6.8.0

This is part of removing Elasticsearch 6.x support from ECK.
- Remove ES 6.x reference from bootstrap.go comment
- Update sset/list_test.go to use 7.x/8.x instead of 6.x/7.x
- Remove 6.x test case from kibana/config_reconcile_test.go
- Update 'no topology' test to use 7.0.0 in validations_test.go
- Update test fixtures (info.go, nodes.go) to use 7.17.0
- Update client_test.go assertion for new fixture version

This is the final commit for removing Elasticsearch 6.x support from ECK.
E2E test cleanup:
- Remove 6.x upgrade path test cases from version_test.go
- Update TLS handshake comment in checks_transport.go
- Use 7.x as default in APM index naming instead of 6.x
- Simplify comments in reversal_test.go and remote_cluster_test.go

Dead code removal:
- Remove unused ZenDiscoveryStatus struct from v1beta1 API
- Remove unused statefulSets parameter from downscale functions
- Remove unused toPodPtr() helper from fixtures.go

This completes the removal of Elasticsearch 6.x support from ECK.
@prodsecmachine
Copy link
Collaborator

prodsecmachine commented Dec 30, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@botelastic botelastic bot added the triage label Dec 30, 2025
@github-actions
Copy link

github-actions bot commented Dec 30, 2025

🔍 Preview links for changed docs

@botelastic botelastic bot removed the triage label Dec 30, 2025
@pebrc
Copy link
Collaborator Author

pebrc commented Dec 30, 2025

buildkite test this -f p=gke,E2E_TAGS=es

@pebrc pebrc marked this pull request as ready for review December 31, 2025 07:57
Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may want to keep that e2e test but the comment should be updated:

// Covers the special case of going from 2 to 1 master node with zen1.

Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also this:

# ready if status code 200, 503 is tolerable if ES version is 6.x
if [[ ${status} == "200" ]] || [[ ${status} == "503" && ${version:0:2} == "6." ]]; then
(not sure if we want to trigger a cluster restart for this though...)

LGTM otherwise 👍

pebrc added 3 commits January 5, 2026 11:42
* update e2e test comment
* inline call to zen2.AddToVotingConfigExclusions
With Elasticsearch 6.x support removed, all supported versions are now
7.0+ and use zen2 for cluster coordination. This removes the obsolete
compatibility checks that were only needed during 6.x to 7.x upgrades.

Changes:
- Remove AllMastersCompatibleWithZen2, IsCompatibleWithZen2, and
  versionCompatibleWithZen2 functions
- Delete compatibility.go and compatibility_test.go
- Simplify AddToVotingConfigExclusions by removing k8s.Client parameter
  (was only needed for compatibility check)
- Remove compatibility checks from ClearVotingConfigExclusions
- Simplify shouldSetInitialMasterNodes and RemoveZen2BootstrapAnnotation
  by removing version checks
- Remove version check from patchInitialMasterNodesConfig
- Fix test setup to properly initialize CanonicalConfig
@pebrc pebrc requested a review from barkbay January 5, 2026 11:30
Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@pebrc pebrc merged commit 3b62aa2 into elastic:main Jan 5, 2026
10 checks passed
@naemono naemono added the v3.3.0 label Jan 18, 2026
alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Feb 3, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [eck-operator](https://github.com/elastic/cloud-on-k8s) | minor | `3.2.0` → `3.3.0` |

---

### Release Notes

<details>
<summary>elastic/cloud-on-k8s (eck-operator)</summary>

### [`v3.3.0`](https://github.com/elastic/cloud-on-k8s/releases/tag/v3.3.0)

[Compare Source](elastic/cloud-on-k8s@v3.2.0...v3.3.0)

##### Elastic Cloud on Kubernetes 3.3.0

- [Quickstart guide](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s#eck-quickstart)

##### Release Highlights

##### AutoOps Integration (Enterprise feature)

ECK now supports integration with Elastic AutoOps through a new `AutoOpsAgentPolicy` custom resource. This allows you to instrument multiple Elasticsearch clusters at once for automated health monitoring and performance recommendations. The [AutoOps documentation](https://www.elastic.co/docs/deploy-manage/monitor/autoops) provides more details.

##### Elastic Package Registry Integration

ECK now supports deploying and managing Elastic Package Registry (EPR) through a new `PackageRegistry` custom resource. This is particularly useful for air-gapped environments, enabling Kibana to reference a self-hosted registry instead of the public one. The [package registry documentation](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s/package-registry) provides more details.

##### Multiple Stack Configuration Policies composition support (Enterprise feature)

ECK now includes support for multiple Stack Config Policies targeting the same Elasticsearch cluster or Kibana instance, using a weight-based priority system for deterministic policy composition. The [stack config policy documentation](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s/elastic-stack-configuration-policies) provides more details.

##### Features and enhancements

- AutoOpsAgentPolicy support [#&#8203;8941](elastic/cloud-on-k8s#8941) (issue: [#&#8203;8789](elastic/cloud-on-k8s#8789))
- ElasticPackageRegistry support [#&#8203;8800](elastic/cloud-on-k8s#8800) (issue: [#&#8203;8925](elastic/cloud-on-k8s#8925))
- Stack Config Policies composition support [#&#8203;8917](elastic/cloud-on-k8s#8917)
- Use standard Kibana labels and Helm labels on the ECK Operator pod [#&#8203;8840](elastic/cloud-on-k8s#8840) (issue: [#&#8203;8584](elastic/cloud-on-k8s#8584))
- Add service customization support for Elasticsearch remote cluster server [#&#8203;8892](elastic/cloud-on-k8s#8892)
- Removal of Elasticsearch 6.x support from codebase [#&#8203;8979](elastic/cloud-on-k8s#8979)

##### Fixes

- Upgrade master StatefulSets last when performing a version upgrade of Elasticsearch [#&#8203;8871](elastic/cloud-on-k8s#8871) (issue: [#&#8203;8429](elastic/cloud-on-k8s#8429))
- Fix race condition for pre-existing Stack Config Policy [#&#8203;8928](elastic/cloud-on-k8s#8928) (issue: [#&#8203;8912](elastic/cloud-on-k8s#8912))
- Do not set Kibana server.name [#&#8203;8930](elastic/cloud-on-k8s#8930) (issue: [#&#8203;8929](elastic/cloud-on-k8s#8929))
- Do not write `elasticsearch.k8s.elastic.co/managed-remote-clusters` when not necessary [#&#8203;8932](elastic/cloud-on-k8s#8932) (issue: [#&#8203;8781](elastic/cloud-on-k8s#8781))
- Cleanup orphaned secret mounts when removed from StackConfigPolicy [#&#8203;8937](elastic/cloud-on-k8s#8937) (issue: [#&#8203;8921](elastic/cloud-on-k8s#8921))
- Avoid duplicate error logging for generate GET operations on a GVK [#&#8203;8957](elastic/cloud-on-k8s#8957)
- Remove single master at a time upscale restriction [#&#8203;8940](elastic/cloud-on-k8s#8940) (issue: [#&#8203;8939](elastic/cloud-on-k8s#8939))
- AutoOps: Ignore deprecated ES clusters [#&#8203;9008](elastic/cloud-on-k8s#9008) (issue: [#&#8203;9000](elastic/cloud-on-k8s#9000))
- AutoOps: Require 9.2.1 for AutoOps agent [#&#8203;9007](elastic/cloud-on-k8s#9007) (issue: [#&#8203;9000](elastic/cloud-on-k8s#9000))
- Multi-SCP: Flip weight semantics - higher weight takes precedence [#&#8203;9046](elastic/cloud-on-k8s#9046)

##### Documentation improvements

- Update Google Cloud LoadBalancer recipe for new requirements [#&#8203;8843](elastic/cloud-on-k8s#8843)
- Fix minUnavailable typo in PDB documentation [#&#8203;8898](elastic/cloud-on-k8s#8898)
- Use GKE ComputeClass instead of DaemonSet for GKE AutoPilot [#&#8203;8982](elastic/cloud-on-k8s#8982)
- Adjust `vm.max_map_count` to [`1048576`](elastic/cloud-on-k8s@1048576) in GKE AutoPilot recipes [#&#8203;8986](elastic/cloud-on-k8s#8986)
- Remove support for Stack 7.17. [#&#8203;9038](elastic/cloud-on-k8s#9038)

##### Dependency updates

- Go 1.25.2 => 1.25.6
- github.com/KimMachineGun/automemlimit v0.7.4 => v0.7.5
- github.com/elastic/go-ucfg v0.8.9-0.20250307075119-2a22403faaea => v0.8.9-0.20251017163010-3520930bed4f
- github.com/gkampitakis/go-snaps v0.5.15 => v0.5.19
- github.com/google/go-containerregistry v0.20.6 => v0.20.7
- github.com/googlecloudplatform/compute-class-api => v0.0.0-20251208134148-ae2e7936c1f8
- github.com/prometheus/common v0.67.1 => v0.67.5
- github.com/spf13/cobra v1.10.1 => v1.10.2
- go.elastic.co/apm/v2 v2.7.1 => v2.7.2
- go.uber.org/zap v1.27.0 => v1.27.1
- golang.org/x/crypto v0.40.0 => v0.46.0
- k8s.io/api v0.34.1 => v0.35.0
- k8s.io/apimachinery v0.34.1 => v0.35.0
- k8s.io/client-go v0.34.1 => v0.35.0
- k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 => v0.0.0-20251002143259-bc988d571ff4
- sigs.k8s.io/controller-runtime v0.22.2 => v0.22.4
- sigs.k8s.io/controller-tools v0.19.0 => v0.20.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4wLjMiLCJ1cGRhdGVkSW5WZXIiOiI0My4wLjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImNoYXJ0Il19-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/3682
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
alexlebens pushed a commit to alexlebens/infrastructure that referenced this pull request Feb 3, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [elastic/cloud-on-k8s](https://github.com/elastic/cloud-on-k8s) | minor | `v3.2.0` → `v3.3.0` |

---

### Release Notes

<details>
<summary>elastic/cloud-on-k8s (elastic/cloud-on-k8s)</summary>

### [`v3.3.0`](https://github.com/elastic/cloud-on-k8s/releases/tag/v3.3.0)

[Compare Source](elastic/cloud-on-k8s@v3.2.0...v3.3.0)

### Elastic Cloud on Kubernetes 3.3.0

- [Quickstart guide](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s#eck-quickstart)

##### Release Highlights

##### AutoOps Integration (Enterprise feature)

ECK now supports integration with Elastic AutoOps through a new `AutoOpsAgentPolicy` custom resource. This allows you to instrument multiple Elasticsearch clusters at once for automated health monitoring and performance recommendations. The [AutoOps documentation](https://www.elastic.co/docs/deploy-manage/monitor/autoops) provides more details.

##### Elastic Package Registry Integration

ECK now supports deploying and managing Elastic Package Registry (EPR) through a new `PackageRegistry` custom resource. This is particularly useful for air-gapped environments, enabling Kibana to reference a self-hosted registry instead of the public one. The [package registry documentation](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s/package-registry) provides more details.

##### Multiple Stack Configuration Policies composition support (Enterprise feature)

ECK now includes support for multiple Stack Config Policies targeting the same Elasticsearch cluster or Kibana instance, using a weight-based priority system for deterministic policy composition. The [stack config policy documentation](https://www.elastic.co/docs/deploy-manage/deploy/cloud-on-k8s/elastic-stack-configuration-policies) provides more details.

##### Features and enhancements

- AutoOpsAgentPolicy support [#&#8203;8941](elastic/cloud-on-k8s#8941) (issue: [#&#8203;8789](elastic/cloud-on-k8s#8789))
- ElasticPackageRegistry support [#&#8203;8800](elastic/cloud-on-k8s#8800) (issue: [#&#8203;8925](elastic/cloud-on-k8s#8925))
- Stack Config Policies composition support [#&#8203;8917](elastic/cloud-on-k8s#8917)
- Use standard Kibana labels and Helm labels on the ECK Operator pod [#&#8203;8840](elastic/cloud-on-k8s#8840) (issue: [#&#8203;8584](elastic/cloud-on-k8s#8584))
- Add service customization support for Elasticsearch remote cluster server [#&#8203;8892](elastic/cloud-on-k8s#8892)
- Removal of Elasticsearch 6.x support from codebase [#&#8203;8979](elastic/cloud-on-k8s#8979)

##### Fixes

- Upgrade master StatefulSets last when performing a version upgrade of Elasticsearch [#&#8203;8871](elastic/cloud-on-k8s#8871) (issue: [#&#8203;8429](elastic/cloud-on-k8s#8429))
- Fix race condition for pre-existing Stack Config Policy [#&#8203;8928](elastic/cloud-on-k8s#8928) (issue: [#&#8203;8912](elastic/cloud-on-k8s#8912))
- Do not set Kibana server.name [#&#8203;8930](elastic/cloud-on-k8s#8930) (issue: [#&#8203;8929](elastic/cloud-on-k8s#8929))
- Do not write `elasticsearch.k8s.elastic.co/managed-remote-clusters` when not necessary [#&#8203;8932](elastic/cloud-on-k8s#8932) (issue: [#&#8203;8781](elastic/cloud-on-k8s#8781))
- Cleanup orphaned secret mounts when removed from StackConfigPolicy [#&#8203;8937](elastic/cloud-on-k8s#8937) (issue: [#&#8203;8921](elastic/cloud-on-k8s#8921))
- Avoid duplicate error logging for generate GET operations on a GVK [#&#8203;8957](elastic/cloud-on-k8s#8957)
- Remove single master at a time upscale restriction [#&#8203;8940](elastic/cloud-on-k8s#8940) (issue: [#&#8203;8939](elastic/cloud-on-k8s#8939))
- AutoOps: Ignore deprecated ES clusters [#&#8203;9008](elastic/cloud-on-k8s#9008) (issue: [#&#8203;9000](elastic/cloud-on-k8s#9000))
- AutoOps: Require 9.2.1 for AutoOps agent [#&#8203;9007](elastic/cloud-on-k8s#9007) (issue: [#&#8203;9000](elastic/cloud-on-k8s#9000))
- Multi-SCP: Flip weight semantics - higher weight takes precedence [#&#8203;9046](elastic/cloud-on-k8s#9046)

##### Documentation improvements

- Update Google Cloud LoadBalancer recipe for new requirements [#&#8203;8843](elastic/cloud-on-k8s#8843)
- Fix minUnavailable typo in PDB documentation [#&#8203;8898](elastic/cloud-on-k8s#8898)
- Use GKE ComputeClass instead of DaemonSet for GKE AutoPilot [#&#8203;8982](elastic/cloud-on-k8s#8982)
- Adjust `vm.max_map_count` to [`1048576`](elastic/cloud-on-k8s@1048576) in GKE AutoPilot recipes [#&#8203;8986](elastic/cloud-on-k8s#8986)
- Remove support for Stack 7.17. [#&#8203;9038](elastic/cloud-on-k8s#9038)

##### Dependency updates

- Go 1.25.2 => 1.25.6
- github.com/KimMachineGun/automemlimit v0.7.4 => v0.7.5
- github.com/elastic/go-ucfg v0.8.9-0.20250307075119-2a22403faaea => v0.8.9-0.20251017163010-3520930bed4f
- github.com/gkampitakis/go-snaps v0.5.15 => v0.5.19
- github.com/google/go-containerregistry v0.20.6 => v0.20.7
- github.com/googlecloudplatform/compute-class-api => v0.0.0-20251208134148-ae2e7936c1f8
- github.com/prometheus/common v0.67.1 => v0.67.5
- github.com/spf13/cobra v1.10.1 => v1.10.2
- go.elastic.co/apm/v2 v2.7.1 => v2.7.2
- go.uber.org/zap v1.27.0 => v1.27.1
- golang.org/x/crypto v0.40.0 => v0.46.0
- k8s.io/api v0.34.1 => v0.35.0
- k8s.io/apimachinery v0.34.1 => v0.35.0
- k8s.io/client-go v0.34.1 => v0.35.0
- k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 => v0.0.0-20251002143259-bc988d571ff4
- sigs.k8s.io/controller-runtime v0.22.2 => v0.22.4
- sigs.k8s.io/controller-tools v0.19.0 => v0.20.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4wLjMiLCJ1cGRhdGVkSW5WZXIiOiI0My4wLjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImltYWdlIl19-->

Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/3685
Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net>
Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants