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

[3] Add applied apps version to cluster state #2315

Open
2 tasks
Xartos opened this issue Oct 16, 2024 · 4 comments · May be fixed by #2399
Open
2 tasks

[3] Add applied apps version to cluster state #2315

Xartos opened this issue Oct 16, 2024 · 4 comments · May be fixed by #2399
Assignees
Labels
kind/feature New feature or request

Comments

@Xartos
Copy link
Contributor

Xartos commented Oct 16, 2024

Proposed feature

To reduce the risk of forgetting or missing to run the apply migration step we should add some state to the cluster such that it knows what was last applied.

Then when you run the prepare command it could check and make sure that both the config and the cluster state has a valid version.

Proposed alternatives

Since we would like to be able to catch if any of the migration scrips were missed we should probably have this apply be done in the migration apply step and not directly in apps.

Additional context

Some thing to consider:

  • How to implement? ConfigMap, labels, etc.
  • How to handle when you are not on a tag?
  • Should this only be checked when preparing an upgrade or also e.g. when running bin/ck8s apply?

Definition of done

  • The current applied apps version is stored in the environment
  • Some prepare step should validate that the cluster is using a valid version before continuing
@Xartos Xartos added the kind/feature New feature or request label Oct 16, 2024
@simonklb
Copy link
Contributor

Isn't that exactly what global.ck8sVersion is?

@Xartos
Copy link
Contributor Author

Xartos commented Oct 16, 2024

Isn't that exactly what global.ck8sVersion is?

Nope, because that's changed when doing the prepare step. So until the apply step is ran there is a discrepancy between the "config version" and the "runtime version".
And if the cluster is upgraded using tekton, for example, and that pipelinerun fails this will be an issue until the apply step is ran again, or manually.
So this issue tries to catch that discrepancy the next time the prepare step is run. Such that you don't upgrade another minor version which we don't support

@simonklb
Copy link
Contributor

Ah, I understand the problem better now! I wish we didn't have to use the config to keep "runtime information/state" though. Ideally you would be able to query Kubernetes to know what is currently installed and diff that with what is currently in the config but I guess we don't store the ck8sVersion anywhere in Kubernetes. 😄

@Xartos
Copy link
Contributor Author

Xartos commented Oct 17, 2024

Exactly! so basically that's what I would like us to do. Add a CM into kube-system or something that has the current applied version. That's what I meant with "add some state to the cluster"

@Ajarmar Ajarmar changed the title Add applied apps version to cluster state [3] Add applied apps version to cluster state Nov 29, 2024
@Zash Zash self-assigned this Dec 9, 2024
@Zash Zash linked a pull request Jan 17, 2025 that will close this issue
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants