Skip to content
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

Render managed files with Terraform #9621

Merged
merged 5 commits into from
Jun 30, 2021

Conversation

johngmyers
Copy link
Member

@johngmyers johngmyers commented Jul 24, 2020

This is an attempt to have the ManagedFile task render through Terraform instead of directly to the state store. This would make them be updated at terraform apply time, not during (dryrun) kops update cluster.

This is an attempt to move forward with #9229. A followup PR would make the completed cluster spec a ManagedFile.

Some issues (beyond the fact this is my first time dealing with Terraform):

  • I believe GCE also works with Terraform, so this would probably need to be implemented against GSPath as well.
  • The integration tests use Terraform with MemFSPath. I'm not quite sure what the code should do in this case.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 24, 2020
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 24, 2020
@johngmyers johngmyers force-pushed the tf-managed branch 2 times, most recently from 5ae41f0 to 2e320b2 Compare July 24, 2020 03:40
@rifelpet
Copy link
Member

Could we update the integration test manifests to use s3:// instead of memfs:// ? Some of them test cloudformation as well which doesn't have an s3 object resource, so we may need to create separate manifests or test cases for cloudformation vs terraform.

@johngmyers
Copy link
Member Author

It doesn't look like the integration tests have a way to mock the S3Context currently. So that would be an effort in itself.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 11, 2021
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/provider/alicloud Issues or PRs related to alicloud provider area/provider/aws Issues or PRs related to aws provider area/provider/spotinst Issues or PRs related to spotinst provider and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 3, 2021
@johngmyers johngmyers force-pushed the tf-managed branch 4 times, most recently from 51686bc to 2ad6fcd Compare June 20, 2021 20:30
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 28, 2021
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jun 28, 2021

@johngmyers: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-kops-verify-packages a888106 link /test pull-kops-verify-packages

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@johngmyers johngmyers changed the title WIP Render managed files with Terraform Render managed files with Terraform Jun 28, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 28, 2021
@johngmyers
Copy link
Member Author

It's time for this to go in. Currently node boot breaks between the time one does a kops update cluster --target terraform and when instances are created using the new spec. This closes the gap to between the time one does a terraform apply and when instances are created using the new spec.

To cut down on churn we might want to stop having golden files for the kops-version.txt files and many of the addon manifests. But that can be in a subsequent PR.

@rifelpet
Copy link
Member

rifelpet commented Jun 29, 2021

What is the status on the per-LaunchTemplateVersion files idea? I ask because managing per-LTV files in terraform will be non-trivial given terraform's inability to orphan s3 objects in its normal terraform plan; terraform apply workflow.

@johngmyers
Copy link
Member Author

johngmyers commented Jun 29, 2021

I believe per-LT files is dependent on this. Writing that code will be easier if both non-Terraform and Terraform have the per-LT files cleaned up through reconciliation.

Such code will have to find the existing ManagedFiles, determine which should be kept, and reconcile the others to deleted.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 30, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2021
@k8s-ci-robot k8s-ci-robot merged commit 52afacd into kubernetes:master Jun 30, 2021
@rifelpet
Copy link
Member

I was looking into adding support for GCS objects but given that the integration tests use memfs which use an s3 object definition, it will be difficult to add integration test coverage for GCS. Any suggestions on how to achieve that?

@johngmyers johngmyers deleted the tf-managed branch June 30, 2021 02:47
@johngmyers
Copy link
Member Author

Since the integration tests use memfs, there's no integration test coverage for S3 either. I don't think that's a problem. What is needed is unit tests for gsfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api area/documentation area/kops-controller area/nodeup area/provider/alicloud Issues or PRs related to alicloud provider area/provider/aws Issues or PRs related to aws provider area/provider/spotinst Issues or PRs related to spotinst provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants