Skip to content

Conversation

@dudizimber
Copy link

fix #9818

@apecloud-bot
Copy link
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.0

@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines. label Oct 20, 2025
@apecloud-bot apecloud-bot added the pre-approve Fork PR Pre Approve Test label Oct 20, 2025
@CLAassistant
Copy link

CLAassistant commented Oct 20, 2025

CLA assistant check
All committers have signed the CLA.

@dudizimber
Copy link
Author

@shanshanying @leon-inf

It took me some fiddling to get the project running, but I was able to confirm that this change does behave properly.
To set the HostPort, the Cluster manifest should be changed like so:

...
  annotations:
    kubeblocks.io/host-network: "falkordb"
... 
  componentSpecs:
  - name: falkordb
     network:
       hostPorts:
       - name: falkordb
          port: 6379
...

@leon-inf
Copy link
Contributor

falkordb

👍🏻

You can set the network.hostNetwork to true instead of adding the annotation.

@dudizimber dudizimber marked this pull request as ready for review October 23, 2025 13:46
@dudizimber dudizimber requested a review from a team as a code owner October 23, 2025 13:46
@dudizimber
Copy link
Author

falkordb

👍🏻

You can set the network.hostNetwork to true instead of adding the annotation.

Thanks. Let me know if anything else is required before merging.

// This will override the container ports defined in component definition.
//
// +optional
HostPorts []HostPortPort `json:"hostPorts,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

The API should clarify whether all host-network ports need to be specified. Also, if not, what is the default behavior of other ports.

Copy link
Contributor

Choose a reason for hiding this comment

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

In addition, how should the ports built into the KB be specified? For example, the HTTP port of kbagent.

Discrete []int32 `json:"discrete,omitempty"`
}

type HostPortPort struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

HostPort or HostPortPort?

Copy link
Contributor

@leon-inf leon-inf left a comment

Choose a reason for hiding this comment

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

The resolving to host-network ports in Vars also needs to be modified.

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

Labels

pre-approve Fork PR Pre Approve Test size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specify HostPort when creating cluster

4 participants