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

Clean up job for old resources #15312

Merged
merged 6 commits into from
Jun 19, 2024
Merged

Clean up job for old resources #15312

merged 6 commits into from
Jun 19, 2024

Conversation

skonto
Copy link
Contributor

@skonto skonto commented Jun 7, 2024

Fixes #15247

Proposed Changes

  • See discussion here
  • Needed for net-certmanager and domain mapping controller migrations
  • This is only needed for upgrades via kubectl, operator removes resources related to a previous manifest

Release Note

A new job is added that will run after upgrades via kubectl to clean up old resources if any. Also can be run in previous versions.

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 7, 2024
@knative-prow knative-prow bot requested review from izabelacg and ReToCode June 7, 2024 09:36
@skonto
Copy link
Contributor Author

skonto commented Jun 7, 2024

/assign @dprotaso

Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.

Project coverage is 84.51%. Comparing base (10b9152) to head (e735580).
Report is 19 commits behind head on main.

Files Patch % Lines
pkg/cleanup/cmd/cleanup/cleanup.go 0.00% 40 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15312      +/-   ##
==========================================
- Coverage   84.78%   84.51%   -0.27%     
==========================================
  Files         218      219       +1     
  Lines       13482    13544      +62     
==========================================
+ Hits        11431    11447      +16     
- Misses       1685     1730      +45     
- Partials      366      367       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skonto
Copy link
Contributor Author

skonto commented Jun 7, 2024

AutoscaleSustainingWithTBCTest again.

@skonto skonto changed the title [wip] Clean up job for old resources Clean up job for old resources Jun 7, 2024
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 7, 2024
@dprotaso
Copy link
Member

dprotaso commented Jun 7, 2024

/retest

ControllerHA flake

app.kubernetes.io/version: devel
app.kubernetes.io/name: knative-serving
rules:
- apiGroups: ["rbac.authorization.k8s.io"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably limit this to just the single role we need to delete

resourceNames: ["..."]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oddly this role becomes a lingering resources after this job runs.

I wonder if we should just move this to serving-core role?

Copy link
Contributor Author

@skonto skonto Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that if we move it there, people who want to run this they will need to update the serving-core manually as well if they are targeting an old version (instead of just running a job). Anyway I think release notes could help.

logger.Fatal("failed to list deployments: ", err)
}
for _, dep := range deps.Items {
if hasPrefix(dep.Name) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we know the exact names of the deployments we want to delete?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a relic need to update.

@skonto
Copy link
Contributor Author

skonto commented Jun 7, 2024

@dprotaso ready.

@skonto
Copy link
Contributor Author

skonto commented Jun 11, 2024

@dprotaso gentle ping

@skonto
Copy link
Contributor Author

skonto commented Jun 19, 2024

@dprotaso gentle ping.

@dprotaso
Copy link
Member

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 19, 2024
Copy link

knative-prow bot commented Jun 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, skonto

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

@knative-prow knative-prow bot merged commit 5a92452 into knative:main Jun 19, 2024
67 checks passed
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. lgtm 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.

Need a post-install job to clean up domain mapping webhook resources
2 participants