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

Put versioned API of cluster into state store #9229

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

johngmyers
Copy link
Member

@johngmyers johngmyers commented May 31, 2020

This addresses two problems:

  1. The "completed" cluster spec, stored in the file cluster.spec in the state store, is stored using the unversioned API. This is contrary to apimachinery rules, which state that APIs should be persisted in a versioned form of the API, and limits our ability to change the unversioned API.

  2. The cluster.spec file is written at kops edit (etc.) time, causing some aspects of the cluster's operation to change prior to running kops update cluster --yes.

This PR starts writing the versioned API to a new cluster-completed.spec. This new file is only written at kops update cluster --yes time.

This PR fixes readers of the completed cluster spec to deserialize as the versioned API.

It also does not address storage of cluster-completed.spec through a k8s state store.

I am considering a future PR that would write the cluster-completed.spec file as a ManagedFile, replacing the VFS API method added here.

@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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 31, 2020
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 4, 2020
@johngmyers johngmyers force-pushed the version-fullcluster branch 5 times, most recently from ce94c0d to 83c5e4c Compare June 5, 2020 06:19
@johngmyers johngmyers changed the title WIP Put versioned API of cluster into state store Put versioned API of cluster into state store Jun 5, 2020
@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 5, 2020
@johngmyers
Copy link
Member Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 5, 2020
@johngmyers
Copy link
Member Author

This will have some effect on Terraform users, who currently expect to run kops update cluster without --yes. Unless we can get Terraform to update the state store we'll need to update the instructions.

@johngmyers
Copy link
Member Author

My plan to address the issue of the instancegroup specs being written prior to kops update cluster --yes, at least as far as nodeup, is to remove the InstanceGroup field from NodeupModelContext, moving all necessary information to the NodeupConfig.

@johngmyers johngmyers changed the title Put versioned API of cluster into state store WIP Put versioned API of cluster into state store Jun 7, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 7, 2020
@johngmyers
Copy link
Member Author

I'm putting a hold on this due to the Terraform issue. For now I'll pursue moving state into the NodeupConfig.

@rifelpet
Copy link
Member

rifelpet commented Jun 7, 2020

Unless we can get Terraform to update the state store we'll need to update the instructions.

Would managing the cluster and instance group manifests via terraform fix the issue? TF does have the aws_s3_bucket_object resource type. Rather than kops uploading the object to s3 directly it could write the object to the .tf files and have terraform manage them. Would that be sufficient? We wouldn't use it for any of the PKI secrets, just the manifests

@johngmyers
Copy link
Member Author

@rifelpet that would probably address the issue, modulo race conditions during the update itself.

@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 11, 2020
@k8s-ci-robot k8s-ci-robot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 12, 2021
@johngmyers johngmyers force-pushed the version-fullcluster branch 2 times, most recently from 9a434e1 to 30faa3a Compare June 12, 2021 22:46
@johngmyers
Copy link
Member Author

/test pull-kops-e2e-kubernetes-do-kubetest2

@johngmyers johngmyers changed the title WIP Put versioned API of cluster into state store Put versioned API of cluster into state store Jun 12, 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 12, 2021
@johngmyers
Copy link
Member Author

/cc @justinsb

@johngmyers
Copy link
Member Author

/test pull-kops-e2e-k8s-gce

@olemarkus
Copy link
Member

Still looks good to me

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 13, 2021
@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 16, 2021
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 17, 2021
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jun 17, 2021

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

Test name Commit Details Rerun command
pull-kops-verify-cloudformation 917a16e link /test pull-kops-verify-cloudformation
pull-kops-verify-hashes 917a16e link /test pull-kops-verify-hashes
pull-kops-e2e-k8s-containerd 917a16e link /test pull-kops-e2e-k8s-containerd
pull-kops-e2e-kubernetes-do-kubetest2 30faa3a link /test pull-kops-e2e-kubernetes-do-kubetest2
pull-kops-e2e-k8s-gce 30faa3a link /test pull-kops-e2e-k8s-gce

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
Copy link
Member Author

/retest

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olemarkus

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 21, 2021
@k8s-ci-robot k8s-ci-robot merged commit eb7ba5e into kubernetes:master Jun 21, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.22 milestone Jun 21, 2021
@johngmyers johngmyers deleted the version-fullcluster branch June 21, 2021 14:31
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/kops-controller area/nodeup area/provider/alicloud Issues or PRs related to alicloud provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants