-
Notifications
You must be signed in to change notification settings - Fork 199
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
Use node IP for advertised.listeners when node port is used #936
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation LGTM.
It's just that I would really like to see those nested if-else clauses to be wrapped with a util function rather having them to live directly in the createExternalListenerStatuses
func
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, though I'd like to see @panyuenlau 's suggestions before approving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking it over from the community.
Should we also update this banzaicloud_v1beta1_kafkacluster.yaml to reflect the new changes on the KafkaCluster changes? And perhaps the node port section in the koperator docs as well
api/v1beta1/kafkacluster_types.go
Outdated
// When "hostNameOverride" and brokerConfig.nodePortExternalIP are empty and NodePort access method is selected for an external listener | ||
// the NodePortNodeAdddressType defines the Kafka broker's Kubernetes node's address type that shall be used in the advertised.listeners property. | ||
// https://kubernetes.io/docs/concepts/architecture/nodes/#addresses | ||
// The NodePortNodeAddressType's values can be Hostname, ExternalIP, InternalIP, InternalDNS,ExternalDNS | ||
// +kubebuilder:validation:Enum=Hostname;ExternalIP;InternalIP;InternalDNS;ExternalDNS | ||
// +optional | ||
NodePortNodeAddressType corev1.NodeAddressType `json:"nodePortNodeAddressType,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed from here after merging #942 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API changes will be gone from this PR after #942 is merged and this PR is rebased with master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair
go.mod
Outdated
@@ -1,6 +1,6 @@ | |||
module github.com/banzaicloud/koperator | |||
|
|||
go 1.19 | |||
go 1.18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM at a glance
What's in this PR?
Using node ip based on configuration (NodePortNodeAddressType) for brokers in advertised.listeners when hostnameOverride and nodePortExternalIP are not set
Why?
Users dont have to specify the node external addresses by hand for the brokers when nodeport is used.
Checklist