Skip to content

Introduce the gRPC-based UpgradeLog#67

Draft
starbops wants to merge 6 commits into
harvester:mainfrom
starbops:feat/upgrade-log
Draft

Introduce the gRPC-based UpgradeLog#67
starbops wants to merge 6 commits into
harvester:mainfrom
starbops:feat/upgrade-log

Conversation

@starbops

@starbops starbops commented Apr 27, 2026

Copy link
Copy Markdown
Member

Problem:

Solution:

Related Issue(s):

harvester/harvester#10464

Test plan:

Additional documentation or context

Add a log collector/shipper architecture using gRPC and Protocol Buffers.
Introduce the UpgradeLog CRD with a phase state machine and per-pod log
tracking, a new pkg/upgradelog controller pipeline, CLI subcommands for
the collector and shipper, and LogPreparing/LogPrepared phases in UpgradePlan.

Signed-off-by: Zespre Chang <[email protected]>
Replace the inline shell script in the log-viewer sidecar with a proper
Go subcommand that recursively scans directories for .log files, tails
each file, and prints lines to stdout prefixed with the relative path.

Signed-off-by: Zespre Chang <[email protected]>
@starbops starbops changed the title Feat/upgrade log Introduce the gRPC-based UpgradeLog Apr 27, 2026

@brandboat brandboat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks promising, the goal is to replace the rancher-logging in the upgrade flow, right?

Comment on lines +34 to +35
// Finalizer for UpgradeLog cleanup on deletion
UpgradeLogFinalizer = AnnotationPrefix + "/" + "upgradelog-cleanup"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: unused code

Comment on lines +187 to +188
upgradePlanLabel = "management.harvesterhci.io/upgrade-plan"
upgradeComponentLabel = "management.harvesterhci.io/upgrade-component"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: can be replaced with const in upgradelog/constants.go

}

// Only mutate pods with the upgrade-plan label
upgradePlanName, hasLabel := pod.Labels[upgradePlanLabel]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It appears we are now only collecting logs from pods with the label management.harvesterhci.io/upgrade-plan. Is that correct?
In the v1 implementation, we collected logs from all pods within specific namespaces (as seen in common.go). This raises a deeper question: do we actually need to collect all logs from kube-system, cattle-system, and harvester-system during an upgrade? How useful is that data in practice?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the question. I remember that @bk201 raised the same concern. I am totally aware of that and figuring out some way to collect logs from those components. But it seems there is no easy way.

Note: This is still a draft PR. I opened this only for collecting early feedback. There will be an HEP for the whole plan.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, I know this is still a draft, but I couldn’t stop myself from getting curious and digging into the proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants