-
Notifications
You must be signed in to change notification settings - Fork 318
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
Deal with duplicated IP in the pod cache #252
Conversation
…i server when we have a dup in the cache
@Jacobious52 @jtblin any updates on this PR? |
@Jacobious52 or @SharpEdgeMarshall do any of you have available cycles to look at this? |
Can someone please review this PR? |
lgtm |
Can someone please review and merge this PR? |
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.
A bunch of nit-picky things that I think will help future readers of this code. My one big question is, is there value in conditionalizing this at all? Why not unconditionally support resolving a pod when there are multiple pods with the same IP?
metrics/metrics.go
Outdated
Namespace: namespace, | ||
Subsystem: "iam", | ||
Name: "k8s_dup_req_count", | ||
Help: "Total number of K8s Api requests performed when duplicated pods are identified in the cache.", |
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.
s/Api/API/
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.
I think this should be capitalised to match the official Kubernetes docs: https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/
Help: "Total number of K8s Api requests performed when duplicated pods are identified in the cache.", | |
Help: "Total number of K8s API requests performed when duplicated pods are identified in the cache.", |
I'm happy to work on any change that can help this to get merged. |
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.
Everything looks good to me except the argument naming. I've provided the suggestions for everything that needs to change, if you agree just accept all those changes and squash the commits and I'll get this merged and into a release ASAP.
metrics/metrics.go
Outdated
Namespace: namespace, | ||
Subsystem: "iam", | ||
Name: "k8s_dup_req_success_count", | ||
Help: "Total number of times we successfully retrieve the pod from the K8s Api.", |
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.
Help: "Total number of times we successfully retrieve the pod from the K8s Api.", | |
Help: "Total number of times we successfully retrieve the pod from the K8s API.", |
@mwhittington21 thank you for the review I've addressed all you suggestions via 4654208 Looking forward to see this merged and released. |
Trying to definitely fix issue #244 maintaining retro compatibility.
When the flag is set to true (default is false) in case the cache lookups returns more than 1 result,
a query to the API server is issued and a pod is returned only if it is running and not with host network.
I've also added some metrics in order to track the amount of requests that are performed to the api server.
@Jacobious52 or any other maintainers can you please check this out?