Add RKE2 scaling test and refactoring#2501
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end scaling test for Rancher-provisioned RKE2 guest clusters and refactors LoadBalancer service creation into a reusable spec/model, with some added “Active/Ready” stabilization logic.
Changes:
- Add
TestRKE2Scalingsuite to scale an RKE2 guest cluster (1→2→3→2) and validate cluster/deployments/services after each step. - Refactor LoadBalancer Service creation by introducing
LBServiceSpecand updatingClusterServiceManager.create(...). - Adjust RKE2 cluster readiness checks to reduce false negatives by re-checking “Active/Ready”.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
harvester_e2e_tests/integrations/test_9_rancher_integration.py |
Adds the RKE2 scaling test suite; refactors LB service fixture/flows; adjusts cluster readiness logic. |
apiclient/rancher_api/models.py |
Introduces LBServiceSpec model to generate LB service payloads. |
apiclient/rancher_api/managers.py |
Updates service manager to build LB service payloads via LBServiceSpec; adds mgmt cluster update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c094234 to
c27160e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Albin Sun <albin.sun@suse.com>
| ], | ||
| "selector": self.selector | ||
| } | ||
| } |
There was a problem hiding this comment.
non-blocking, qq:
Do we want to possibly add more depth to the spec for the Rancher LB Service?
---
apiVersion: v1
kind: Service
metadata:
annotations:
cloudprovider.harvesterhci.io/ipam: dhcp
field.cattle.io/description: ipam lb ngx1
name: lb-ngx1-ipam
namespace: default
spec:
allocateLoadBalancerNodePorts: true
externalTrafficPolicy: Cluster
internalTrafficPolicy: Cluster
ipFamilies:
- IPv4
ipFamilyPolicy: SingleStack
ports:
- name: ngx1lb
nodePort: 30001
port: 8080
protocol: TCP
targetPort: 80
selector:
svc: ngx1
sessionAffinity: None
type: LoadBalancer
---I believe a majority of the above spec properties are "default" - but I'm unsure if "future" Rancher versions will change the underlying default ... At least too, from a UI perspective Rancher forces users to choose a nodePort number like 30001 ... not sure how explicit we want to be in our Service obj definition? 😄
There was a problem hiding this comment.
Exactly. About the nodePort, IIRC Rancher assign it dynamically if user not config it, so I think we can keep how it is and let Rancher handle it. (At least fo 2.13. We should enhance if the behavior change in newer version)
The current strategy is provide minimum/critical parameters (ns, name, ipam and selector) to fit our test scenario and let Rancher handle others with default value.
We can introduce more fields according the future requirement.
Which issue(s) this PR fixes:
What this PR does / why we need it:
TestRKE2Scalingfor RKE2 cluster.1->2->3->2set viaparametrizeand will check cluster size equals tofromsizebefore scaling totosize.LBServiceSpecActivejudgementipamparametrized on test case instead of whole moduleSpecial notes for your reviewer:
Verification
✔️ 1 node Baremetal
harvester-v1.7.1 + rancher-v2.13.1harvester-runtests/64✔️ 4 nodes Baremetal
harvester-v1.7.1 + rancher-v2.13.1harvester-runtests/62Additional documentation or context