-
Notifications
You must be signed in to change notification settings - Fork 324
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
Don't support syncing multiple addresses when k8s service has multiple ports #511
Conversation
…e ports. Previously, we set a tagged address for each Kubernetes service port, using the "virtual-" prefix for the tagged address key. For example, if a service port is named "tcp", then we synced it to Consul with the tagged address key "virtual-tcp". However, since Consul doesn't really support multiple ports on a service yet, this is unnecessary. So instead, we will find the service's target port that is equal to the service port we are registering with Consul and use that as the Port for the tagged address. Otherwise, if we can't find the target port, we will set the tagged address's port to 0 (it will still have the cluster IP set).
21e535c
to
807207b
Compare
|
||
// clusterIPTaggedAddressName is the key for the tagged address to store the service's cluster IP and service port | ||
// in Consul. Note: This value should not be changed without a corresponding change in Consul. | ||
// TODO: change this to a constant shared with Consul to avoid accidentally changing this. |
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.
We will update it at a future time.
66c80cc
to
71fbb16
Compare
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 great!
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 looks great!! have a suggestion that isnt blocking!! Nice work
* remove unnecessary cluster role usage for enterprise license templates
Previously, we set a tagged address for each Kubernetes service port,
using the "virtual-" prefix for the tagged address key. For example,
if a service port is named "tcp", then we synced it to Consul with
the tagged address key "virtual-tcp".
However, since Consul doesn't really support multiple ports on a service yet,
this is unnecessary. So instead, we will find the service's target port
that is equal to the service port we are registering with Consul
and use that as the Port for the tagged address. Otherwise,
if we can't find the target port, we will set the tagged address's port to 0
(it will still have the cluster IP set).
How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: