-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ Fleet ] Fleet UI should allow upgrades to agents where the patch version is higher than Kibana #168502
Comments
Pinging @elastic/fleet (Team:Fleet) |
Following the discussion on this on https://discuss.elastic.co/t/elastic-agent-upgrade-option-is-grayed-out-on-fleet-server/344753 |
I think the reason we don't allow this is laying on the agent side, @cmacknz correct me if I'm wrong. I tried to find the recent gh comments about this, but couldn't. |
Just a comment about what we say in the docs. For Elastic Agents there's a constraint on Fleet Server (docs)
Here, we do not mention the patch version. Meaning the Fleet Server version >= Elastic Agents. Usually Fleet Server is aligned with the stack. On our doc we have also:
So we always mention minor version but not the patch. |
@juliaElastic In this post: https://discuss.elastic.co/t/elastic-agent-upgrade-option-is-grayed-out-on-fleet-server/344753/5?u=craig_rodrigues So this restriction/bug is in the Fleet UI. |
@lucabelluccini The support matrix page also does not mention anything about the patch version, normally the compatibility is mentioned up to the minor version, like 8.10.X So based on the documentation available, the user will assume that an agent on version 8.10.4 is compatible with the stack running on version 8.10.2, but currently the patch version is pinned on Kibana version. The use case for having an Agent on a patch version higher than the rest of the stack would be to fix some bugs, like a recent one that broke some networking monitoring on Linux systems and was fixed on 8.10.3. It is pretty common for on-premises deployments to have maintenance windows to upgrade the stack, and this cannot be done for every patch version, for example 8.10.3 was released on October 10th and 8.10.4 was released on October 17th, just one week late, but upgrading agents is easier than upgrading the entire stack, so it would be nice to be able to upgrade the agents through Fleet UI. Upgrading the agent using the command line works without any issue, but this is not practical when you have hundreds or thousands of agents. So based on this I think that the Kibana Fleet UI should allow the upgrade to agents on a higher patch version, if this is not possible then the documentation should reflect it and at least provide some orientation to the user on how to proceed with manual upgrades. |
I'm not against your assessment. I was just collecting/gathering what we report in the documentation. |
There is a version constraint in Fleet Server that will not accept agents with a higher minor or major version. It is explicitly allowing agents in the same minor release to connect regardless of the patch version. So the intent is to allow what is described here at the Fleet Server level. func BuildVersionConstraint(verStr string) (version.Constraints, error) {
ver, err := version.NewVersion(verStr)
if err != nil {
return nil, err
}
verStr = maximizePatch(ver)
return version.NewConstraint(fmt.Sprintf(">= %s, <= %s", MinVersion, verStr))
} The agent doesn't enforce any version restrictions itself, it simply reports its current version to Fleet Server and acts on the response it receives. |
What logic does the Kibana UI use for greying out the available upgrade? I tried looking at the code in: but didn't have time to follow it all |
Maybe this line in Kibana is kicking out availalbe versions where MAJOR and MINOR are the same, but PATCH is different:
agentVersionToUse =
availableVersions.find((version) => {
return semverLt(version, kibanaVersion);
}) || availableVersions[0]; |
I see your point, I think we can then easily change this logic in Fleet UI to allow upgrading agents to the latest patch on the same major.minor as kibana. |
@kpollich @jen-huang Could we add this to next sprint? It's a quick fix. |
Added to sprint 20 |
While we're fixing this, it would be nice to just go ahead and add support for the upcoming "build releases" to Fleet UI / API at the same time. They will have the version suffix that will match this regex |
…173167) ## Summary Closes #168502 Changed the version check to allow agent upgrade if the agent version has a newer patch than kibana. To verify: - change kibana locally to return a mock version `8.11.0` [here](https://github.com/elastic/kibana/blob/05bfe53cb3a2fe33ecb9eec4a6fcb19a492aaadf/x-pack/plugins/fleet/public/hooks/use_kibana_version.ts#L17) - enroll an agent version 8.11.0 - verify that the upgrade is allowed to 8.11.1 and 8.11.2 - verify that the upgrade works <img width="1282" alt="image" src="https://github.com/elastic/kibana/assets/90178898/0bb0c8ca-ac0f-49c1-b67c-b02d085e7045"> <img width="799" alt="image" src="https://github.com/elastic/kibana/assets/90178898/7be3b64b-43e5-451a-a630-65cfc2607dab"> <img width="1256" alt="image" src="https://github.com/elastic/kibana/assets/90178898/4841bc2a-5238-4854-a63e-27761a02f1e3"> Tested the new agent build version by adding a dummy version to the available_versions API response. It is showing up for an agent 8.11.1 (same as the mock kibana version): <img width="775" alt="image" src="https://github.com/elastic/kibana/assets/90178898/fa02c62d-9399-4c2c-8311-412e5fe03a96"> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…lastic#173167) ## Summary Closes elastic#168502 Changed the version check to allow agent upgrade if the agent version has a newer patch than kibana. To verify: - change kibana locally to return a mock version `8.11.0` [here](https://github.com/elastic/kibana/blob/05bfe53cb3a2fe33ecb9eec4a6fcb19a492aaadf/x-pack/plugins/fleet/public/hooks/use_kibana_version.ts#L17) - enroll an agent version 8.11.0 - verify that the upgrade is allowed to 8.11.1 and 8.11.2 - verify that the upgrade works <img width="1282" alt="image" src="https://github.com/elastic/kibana/assets/90178898/0bb0c8ca-ac0f-49c1-b67c-b02d085e7045"> <img width="799" alt="image" src="https://github.com/elastic/kibana/assets/90178898/7be3b64b-43e5-451a-a630-65cfc2607dab"> <img width="1256" alt="image" src="https://github.com/elastic/kibana/assets/90178898/4841bc2a-5238-4854-a63e-27761a02f1e3"> Tested the new agent build version by adding a dummy version to the available_versions API response. It is showing up for an agent 8.11.1 (same as the mock kibana version): <img width="775" alt="image" src="https://github.com/elastic/kibana/assets/90178898/fa02c62d-9399-4c2c-8311-412e5fe03a96"> ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit a26eec4)
…ibana (#173167) (#173296) # Backport This will backport the following commits from `main` to `8.12`: - [[Fleet] allow agent upgrades if patch version is higher than kibana (#173167)](#173167) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-13T16:00:20Z","message":"[Fleet] allow agent upgrades if patch version is higher than kibana (#173167)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/168502\r\n\r\nChanged the version check to allow agent upgrade if the agent version\r\nhas a newer patch than kibana.\r\n\r\nTo verify:\r\n- change kibana locally to return a mock version `8.11.0`\r\n[here](https://github.com/elastic/kibana/blob/05bfe53cb3a2fe33ecb9eec4a6fcb19a492aaadf/x-pack/plugins/fleet/public/hooks/use_kibana_version.ts#L17)\r\n- enroll an agent version 8.11.0\r\n- verify that the upgrade is allowed to 8.11.1 and 8.11.2\r\n- verify that the upgrade works\r\n\r\n<img width=\"1282\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/0bb0c8ca-ac0f-49c1-b67c-b02d085e7045\">\r\n<img width=\"799\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/7be3b64b-43e5-451a-a630-65cfc2607dab\">\r\n<img width=\"1256\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/4841bc2a-5238-4854-a63e-27761a02f1e3\">\r\n\r\nTested the new agent build version by adding a dummy version to the\r\navailable_versions API response.\r\nIt is showing up for an agent 8.11.1 (same as the mock kibana version):\r\n<img width=\"775\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/fa02c62d-9399-4c2c-8311-412e5fe03a96\">\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"a26eec451fb54317a2b08d1f49b3f2b30fcbddca","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","v8.12.0","v8.13.0"],"number":173167,"url":"https://github.com/elastic/kibana/pull/173167","mergeCommit":{"message":"[Fleet] allow agent upgrades if patch version is higher than kibana (#173167)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/168502\r\n\r\nChanged the version check to allow agent upgrade if the agent version\r\nhas a newer patch than kibana.\r\n\r\nTo verify:\r\n- change kibana locally to return a mock version `8.11.0`\r\n[here](https://github.com/elastic/kibana/blob/05bfe53cb3a2fe33ecb9eec4a6fcb19a492aaadf/x-pack/plugins/fleet/public/hooks/use_kibana_version.ts#L17)\r\n- enroll an agent version 8.11.0\r\n- verify that the upgrade is allowed to 8.11.1 and 8.11.2\r\n- verify that the upgrade works\r\n\r\n<img width=\"1282\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/0bb0c8ca-ac0f-49c1-b67c-b02d085e7045\">\r\n<img width=\"799\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/7be3b64b-43e5-451a-a630-65cfc2607dab\">\r\n<img width=\"1256\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/4841bc2a-5238-4854-a63e-27761a02f1e3\">\r\n\r\nTested the new agent build version by adding a dummy version to the\r\navailable_versions API response.\r\nIt is showing up for an agent 8.11.1 (same as the mock kibana version):\r\n<img width=\"775\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/fa02c62d-9399-4c2c-8311-412e5fe03a96\">\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"a26eec451fb54317a2b08d1f49b3f2b30fcbddca"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173167","number":173167,"mergeCommit":{"message":"[Fleet] allow agent upgrades if patch version is higher than kibana (#173167)\n\n## Summary\r\n\r\nCloses https://github.com/elastic/kibana/issues/168502\r\n\r\nChanged the version check to allow agent upgrade if the agent version\r\nhas a newer patch than kibana.\r\n\r\nTo verify:\r\n- change kibana locally to return a mock version `8.11.0`\r\n[here](https://github.com/elastic/kibana/blob/05bfe53cb3a2fe33ecb9eec4a6fcb19a492aaadf/x-pack/plugins/fleet/public/hooks/use_kibana_version.ts#L17)\r\n- enroll an agent version 8.11.0\r\n- verify that the upgrade is allowed to 8.11.1 and 8.11.2\r\n- verify that the upgrade works\r\n\r\n<img width=\"1282\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/0bb0c8ca-ac0f-49c1-b67c-b02d085e7045\">\r\n<img width=\"799\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/7be3b64b-43e5-451a-a630-65cfc2607dab\">\r\n<img width=\"1256\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/4841bc2a-5238-4854-a63e-27761a02f1e3\">\r\n\r\nTested the new agent build version by adding a dummy version to the\r\navailable_versions API response.\r\nIt is showing up for an agent 8.11.1 (same as the mock kibana version):\r\n<img width=\"775\" alt=\"image\"\r\nsrc=\"https://github.com/elastic/kibana/assets/90178898/fa02c62d-9399-4c2c-8311-412e5fe03a96\">\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios","sha":"a26eec451fb54317a2b08d1f49b3f2b30fcbddca"}}]}] BACKPORT--> Co-authored-by: Julia Bardi <[email protected]>
…175775) ## Summary Adding the fix in #175765 to main too. To verify: - add a fleet-server version 8.12.0 - enroll an agent version 8.12.0-SNAPSHOT - take the agent id and in console run this API request ``` POST kbn:/api/fleet/agents/6a56f865-a611-4921-9f24-87757259223e/upgrade { "version": "8.12.1-SNAPSHOT" } ``` - verify that the API returns 200 Relates #168502
… version differs only in patch (#175765) Fixes #175766 [8.12][Fleet] Partial backport of #175198 To verify: - add a fleet-server version 8.12.0 - enroll an agent version 8.12.0-SNAPSHOT - take the agent id and in console run this API request ``` POST kbn:/api/fleet/agents/6a56f865-a611-4921-9f24-87757259223e/upgrade { "version": "8.12.1-SNAPSHOT" } ``` - verify that the API returns 200 Relates #168502
Hi Team, We have created 03 testcases under testrail for this feature under Fleet test suite at links:
Please let us know if any other scenario needs to be added from our end. Thanks! |
…lastic#175775) ## Summary Adding the fix in elastic#175765 to main too. To verify: - add a fleet-server version 8.12.0 - enroll an agent version 8.12.0-SNAPSHOT - take the agent id and in console run this API request ``` POST kbn:/api/fleet/agents/6a56f865-a611-4921-9f24-87757259223e/upgrade { "version": "8.12.1-SNAPSHOT" } ``` - verify that the API returns 200 Relates elastic#168502
Hi Team, We have executed 03 testcases under the Feature test run for the 8.12.1 release at the link: Status:
Build details: As the testing is completed on this feature, we are marking this as QA:Validated. Thanks |
…lastic#175775) ## Summary Adding the fix in elastic#175765 to main too. To verify: - add a fleet-server version 8.12.0 - enroll an agent version 8.12.0-SNAPSHOT - take the agent id and in console run this API request ``` POST kbn:/api/fleet/agents/6a56f865-a611-4921-9f24-87757259223e/upgrade { "version": "8.12.1-SNAPSHOT" } ``` - verify that the API returns 200 Relates elastic#168502
Describe the feature:
Currently if you are on version X.Y.0 and want to upgrade an Elastic Agent to version X.Y.1, you can't do this through Fleet UI because the upgrade option will be grayed out, this means that the Elastic Agent version you can upgrade through Fleet UI is pinned to the patch version of Kibana.
The product compatibility does not mention this, it says for example that Elasticsearch 8.10.X is compatible with Elastic Agent 7.17.X - 8.10.X, so an User would expect to be able to run an Elastic Agent 8.10.3 even if the rest of the stack is on a lower patch version.
Kibana documentation mentions that generally Kibana is compatible with Elasticsearch on different patch versions, but does not mention if Kibana patch can be higher than Elastisearch patch, it also recommends to run the exact same version.
So if an user wants to follow this recommendation and needs to upgrade just a couple of agents to fix some issue, it would need to upgrade the entire stack, which is far from the ideal.
The solution in this case would be to manually upgrade an agent, which is also not ideal when you have many agents.
If the Elastic Agent needs to be so tight coupled with the Kibana version, then this needs to be reflected in the Support Matrix page.
Describe a specific use case for the feature:
Users should be able to upgrade the patch version of an Elastic Agent through the Fleet UI, this may happen when you need to upgrade for just fix a bug.
The text was updated successfully, but these errors were encountered: