-
Notifications
You must be signed in to change notification settings - Fork 223
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
Terraform rancher2 agent customization #1137
Merged
a-blender
merged 4 commits into
rancher:master
from
a-blender:cluster-agent-customization
Jun 21, 2023
Merged
Terraform rancher2 agent customization #1137
a-blender
merged 4 commits into
rancher:master
from
a-blender:cluster-agent-customization
Jun 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a-blender
force-pushed
the
cluster-agent-customization
branch
2 times, most recently
from
June 5, 2023 16:31
2b744c3
to
f7dd78e
Compare
a-blender
force-pushed
the
cluster-agent-customization
branch
3 times, most recently
from
June 5, 2023 21:07
831c191
to
794be56
Compare
jakefhyde
reviewed
Jun 6, 2023
a-blender
force-pushed
the
cluster-agent-customization
branch
from
June 13, 2023 00:30
794be56
to
ea1bee1
Compare
jakefhyde
requested changes
Jun 13, 2023
a-blender
changed the title
Cluster agent customization
Terraform rancher2 cluster agent customization
Jun 13, 2023
a-blender
changed the title
Terraform rancher2 cluster agent customization
Terraform rancher2 agent customization
Jun 13, 2023
- Update error handling and go mod - Address comments
a-blender
force-pushed
the
cluster-agent-customization
branch
4 times, most recently
from
June 16, 2023 21:02
e7d43da
to
68198d5
Compare
a-blender
force-pushed
the
cluster-agent-customization
branch
from
June 20, 2023 22:36
68198d5
to
b214863
Compare
jakefhyde
reviewed
Jun 20, 2023
jakefhyde
requested changes
Jun 20, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nits
a-blender
force-pushed
the
cluster-agent-customization
branch
from
June 21, 2023 15:29
b214863
to
a653759
Compare
jakefhyde
approved these changes
Jun 21, 2023
HarrisonWAffel
approved these changes
Jun 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
#1097
Problem
Cluster/Fleet agent deployment customization is not supported by the TFP.
Solution
Add
cluster_agent_deployment_customization
andfleet_agent_deployment_customization
(and nested) fields tolerations, affinity, and resource requirements to the rancher2 provider so users will be able to define those values for RKE, RKE2/K3s, and EKS clusters.Error handling
For agent deployment customization, we have a unique scenario with error handling. Most tf resources do not add error handling in the expander, but for rke clusters I have to marshal v1 Tolerations and Affinity strings into objects that exist on the rancher backend. They are being passed as strings because 1) it's too complex to struct out all the nested fields, 2) this is how terraform harvester encodes node affinity. If the Toleration or Affinity string passed via the tf config is invalid, expanding the field will fail. I argue that this should cause a cluster create/update to also fail.
My solution to this is to add error handling to the expander. If expanding an agent deployment customization returns nil with no error, customization is not defined and a create/update will pass. If it returns nil with an error, a create/update will fail and the user needs to fix their config.
Testing
6/2 update: Not fully tested yet, but requesting preliminary review of backend logic for the rke case.
6/13 update: Finished testing rke with all new fields and fixing bugs. Working on adding EKS, testing v2 prov and EKS and updating tests.
6/16 update: Added
Toleration
v2 andResourceRequirement
resources, updated backend logic. Added/updated tests which turned out to be tricky. Need to re-testEngineering Testing
Manual Testing
Smoke testing
Note: you may not see cluster go into
Updating
state in the UI for added/updated agent customization or minor updates because the redeploy is fast.Automated Testing
QA Testing Considerations
Regressions Considerations