Skip to content
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

False positive: Single endpoint is associated with this service #296

Closed
jim-barber-he opened this issue Mar 11, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@jim-barber-he
Copy link




Describe the bug

For the SERVICES checks all services are reporting [POP-1109] Single endpoint is associated with this service.
However this is not the case.
An example of one of the warnings produced is:

  · traefik/traefik-metrics........................................................................😱
    😱 [POP-1109] Single endpoint is associated with this service.

But if I look at the endpoints for this there are more than one:

$ kubectl -n traefik get endpoints                               
NAME              ENDPOINTS                                                           AGE
traefik-metrics   10.9.128.150:9200,10.9.128.222:9200,10.9.129.168:9200 + 3 more...   12d

Or in more detail from the kubectl -n traefik get endpoints -o yaml traefik-metrics command:

apiVersion: v1
kind: Endpoints
metadata:
  annotations:
    endpoints.kubernetes.io/last-change-trigger-time: "2024-02-28T01:50:38Z"
  creationTimestamp: "2024-02-28T01:50:24Z"
  labels:
    app.kubernetes.io/component: metrics
    app.kubernetes.io/instance: traefik-traefik
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: traefik
    helm.sh/chart: traefik-26.1.0
  name: traefik-metrics
  namespace: traefik
  resourceVersion: "14073"
  uid: 1c75b85b-df16-4d73-b74f-338457f41350
subsets:
- addresses:
  - ip: 10.9.128.150
    nodeName: i-0d75932ff80159969
    targetRef:
      kind: Pod
      name: traefik-8gvs7
      namespace: traefik
      uid: e5646859-a0e6-402a-8acd-0824aeaaa0f2
  - ip: 10.9.128.222
    nodeName: i-0ee22b17bffdb7461
    targetRef:
      kind: Pod
      name: traefik-xmjr8
      namespace: traefik
      uid: 5778a08d-d5b8-4444-8353-98950c20e65c
  - ip: 10.9.129.168
    nodeName: i-0b233037342313af8
    targetRef:
      kind: Pod
      name: traefik-kvw8j
      namespace: traefik
      uid: 472fb300-8422-44d0-970a-150caa5e93c2
  - ip: 10.9.129.186
    nodeName: i-005173f692492bbf2
    targetRef:
      kind: Pod
      name: traefik-tfjbm
      namespace: traefik
      uid: 43abfd55-d771-47e3-9ce2-94428fae0491
  - ip: 10.9.130.61
    nodeName: i-049e48f99d51a727a
    targetRef:
      kind: Pod
      name: traefik-sqjpv
      namespace: traefik
      uid: d51b18a5-dcb8-47c3-a0ec-28a9257a4abf
  - ip: 10.9.130.82
    nodeName: i-092198aa0e9ae66cc
    targetRef:
      kind: Pod
      name: traefik-99kgs
      namespace: traefik
      uid: 85fdeac6-8d91-41b0-ba8d-efb80086aaf6
  ports:
  - name: metrics
    port: 9200
    protocol: TCP

The code in internal/lint/svc.go seems to be:

        if len(ep.Subsets) == 1 {
                s.AddCode(ctx, 1109)
        }

And indeed the YAML above only has one list item in subsets, however that subset contains multiple addresses and these haven't been catered for.

To Reproduce
Steps to reproduce the behavior:

  1. Use popeye version v0.21.0
  2. In a cluster with services that have multiple endpoints run: popeye -A -s services
  3. See that the services that have multiple endpoints have the [POP-1109] Single endpoint is associated with this service. warning against them.

Expected behavior

This is a false alert and it shouldn't be saying that services only have one endpoint when they have 2 or more.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

  • OS: Debian Linux (12 stable / bookworm)
  • Popeye: 0.21.0
  • K8s: 1.28.7

Additional context
Add any other context about the problem here.

@derailed derailed added the bug Something isn't working label Mar 16, 2024
@derailed
Copy link
Owner

@jim-barber-he Thank you for this great report Jim! Doh indeed. Will fix in v0.21.1

derailed added a commit that referenced this issue Mar 16, 2024
derailed added a commit that referenced this issue Mar 16, 2024
@jim-barber-he
Copy link
Author

Thank you. I can confirm this is working now in the new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants