Skip to content

Conversation

@Liang-gong-ci-fang
Copy link
Contributor

@Liang-gong-ci-fang Liang-gong-ci-fang commented Sep 14, 2025

This commit refactors the Hubble peer service to use a cell-based architecture, addressing the technical debt and improving modularity. The changes include:

  1. Created a new peer service cell (pkg/hubble/peer/cell/cell.go):

    • Implemented a cell-based architecture for the peer service
  2. Refactored hubble integration (pkg/hubble/cell/hubbleintegration.go):

    • Removed inline peer service creation
    • Removed duplicate getPort function (now handled in peer cell)
    • Renamed function to avoid collision with builtin function
  3. Updated main hubble cell (pkg/hubble/cell/cell.go)

  4. Added comprehensive tests (pkg/hubble/peer/cell/cell_test.go:

    • Unit tests for getPort function

Fixes: #40068

Release note

misc: Refactored Hubble peer service to use a Hive cell.

@Liang-gong-ci-fang Liang-gong-ci-fang requested a review from a team as a code owner September 14, 2025 08:22
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 14, 2025
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Sep 14, 2025
@maintainer-s-little-helper
Copy link

Commit 1b0c57d does not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Sep 14, 2025
@maintainer-s-little-helper
Copy link

Commit 1b0c57d does not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

1 similar comment
@maintainer-s-little-helper
Copy link

Commit 1b0c57d does not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper
Copy link

Commit 12bb337 does not match "(?m)^Signed-off-by:".

Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin

@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-sign-off The author needs to add signoff to their commits before merge. label Sep 15, 2025
@Liang-gong-ci-fang
Copy link
Contributor Author

/test

@kaworu kaworu requested review from devodev and kaworu and removed request for rolinh September 15, 2025 07:21
@Liang-gong-ci-fang
Copy link
Contributor Author

Hi @kaworu , could you please help me with this issue?🙏

I've been consistently facing two test failures with the same root cause. The cilium status output shows:

    /¯¯\
 /¯¯\__/¯¯\    Cilium:             OK
 \__/¯¯\__/    Operator:           OK
 /¯¯\__/¯¯\    Envoy DaemonSet:    disabled (using embedded mode)
 \__/¯¯\__/    Hubble Relay:       1 errors
    \__/       ClusterMesh:        disabled

DaemonSet              cilium                   Desired: 2, Ready: 2/2, Available: 2/2
Deployment             cilium-operator          Desired: 1, Ready: 1/1, Available: 1/1
Deployment             hubble-relay             Desired: 1, Unavailable: 1/1
Containers:            cilium                   Running: 2
                       cilium-operator          Running: 1
                       clustermesh-apiserver    
                       hubble-relay             Running: 1
Cluster Pods:          4/4 managed by Cilium
Helm chart version:    1.19.0-dev
Image versions         cilium             quay.io/cilium/cilium-ci:b46e740d70578ef40b9f1839078d618223232a28: 2
                       cilium-operator    quay.io/cilium/operator-generic-ci:b46e740d70578ef40b9f1839078d618223232a28: 1
                       hubble-relay       quay.io/cilium/hubble-relay-ci:b46e740d70578ef40b9f1839078d618223232a28: 1
Errors:                hubble-relay       hubble-relay    1 pods of Deployment hubble-relay are not ready

Error: Unable to determine status:  timeout while waiting for status to become successful: context deadline exceeded

I don't believe this is caused by my changes, so I started investigating further. I noticed a potential configuration mismatch:

In values.yaml, the listenPort is set to 4245, but in the hubble-relay deployment template, the port is configured as 4222.

Could this port mismatch be causing the timeout while waiting for status to become successful error? Any guidance would be greatly appreciated!

Thank you! 😊

@kaworu kaworu added kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact. area/hubble Impacts hubble server or relay labels Sep 15, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Sep 15, 2025
@kaworu kaworu added this to the 1.19 milestone Sep 15, 2025
Copy link
Contributor

@devodev devodev left a comment

Choose a reason for hiding this comment

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

Overall this LGTM, thank you for the initiative and great work @Liang-gong-ci-fang !

I left some suggestions, otherwise I appreciate you taking the time to add tests for getPort and for providing the HubbleConfig from the Hubble cell.

Also could you rebase and remove the merge commit?

@Liang-gong-ci-fang
Copy link
Contributor Author

@devodev I'm so grateful for your incredibly valuable advice. I'll definitely take some time to sincerely take it all in.

Copy link
Contributor

@devodev devodev left a comment

Choose a reason for hiding this comment

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

This looks great, thank you!
Left some nits but we could merge as-is :)

Copy link
Contributor

@devodev devodev left a comment

Choose a reason for hiding this comment

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

I think we can rebase the 3 commits into one for this change before merging, but thanks for splitting changes, it made it easy to review :)

@Liang-gong-ci-fang Liang-gong-ci-fang force-pushed the main branch 3 times, most recently from d63a6d0 to efc7728 Compare September 18, 2025 01:45
@devodev
Copy link
Contributor

devodev commented Sep 18, 2025

/test

Copy link
Member

@kaworu kaworu left a comment

Choose a reason for hiding this comment

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

Hi @Liang-gong-ci-fang and thank you for the PR!

Overall LGTM, only some nitpicking / cosmetic comments.

@Liang-gong-ci-fang
Copy link
Contributor Author

@kaworu Thanks for the review and the helpful suggestions!

@Liang-gong-ci-fang
Copy link
Contributor Author

/test

Copy link
Member

@kaworu kaworu left a comment

Choose a reason for hiding this comment

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

Thanks for the update @Liang-gong-ci-fang, please tidy up the comment message (you can do it with git commit --amend).

@kaworu kaworu added the dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. label Sep 23, 2025
@kaworu
Copy link
Member

kaworu commented Sep 23, 2025

@Liang-gong-ci-fang sorry I merged #41679 without foreseeing that it would create a conflict in this PR. Can you please rebase the patch and resolve the conflict? Thank you.

This commit refactors the Hubble peer service to use a cell-based architecture,
addressing the technical debt and improving modularity.

Fixes: cilium#40068

Signed-off-by: Li Tangke <544720830@qq.com>
@Liang-gong-ci-fang
Copy link
Contributor Author

Hi @kaworu , Thank you for the heads up! I have successfully rebased my branch and resolved the conflicts with #41679. The PR should now be ready for review again.

Copy link
Member

@kaworu kaworu left a comment

Choose a reason for hiding this comment

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

Thanks for the quick update @Liang-gong-ci-fang 🚀

@devodev
Copy link
Contributor

devodev commented Sep 23, 2025

/test

1 similar comment
@kaworu
Copy link
Member

kaworu commented Sep 24, 2025

/test

@kaworu kaworu removed the dont-merge/needs-rebase This PR needs to be rebased because it has merge conflicts. label Sep 24, 2025
@rolinh rolinh added this pull request to the merge queue Sep 26, 2025
Merged via the queue into cilium:main with commit 66e9c0a Sep 26, 2025
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/hubble Impacts hubble server or relay kind/cleanup This includes no functional changes. kind/community-contribution This was a contribution made by a community member. release-note/misc This PR makes changes that have no direct user impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hubble: refactor the peer service as a cell

4 participants