Skip to content
This repository was archived by the owner on Nov 5, 2021. It is now read-only.
This repository was archived by the owner on Nov 5, 2021. It is now read-only.

RDS Kubernetes Endpoints include pod name #612

Description

@tbuchier

Hello,

We are using the rds endpoints to probe some statefulsets in kubernetes.
We would like to have the pod name available in the endpoint resource so we can add it in the metrics labels for clearer alerting.

Indeed statefulsets pod name are "fixed" whereas pod IP is prone to change so right now our temporary solution is to do some PromQL join to link the pod ip with it's name to print it correctly in the alert message / dashboard.

I saw that the k8s pods rds type does contain the name but it doesn't allow specifying container port and in our case there is multiple port and we select the good one via it's name so we have to use k8s endpoints.

Currently how endpoints are built:

resources = append(resources, &pb.Resource{
	Name:   proto.String(resName),
	Ip:     proto.String(addr.IP),
	Port:   proto.Int(port.Port),
	Labels: epi.Metadata.Labels,
})

The idea would be to add the targetRef.name located in the endpoint subset (eps) if exist.

      {
        "ip": "10.28.0.3",
        "nodeName": "gke-cluster-1-default-pool-abd8ad35-ccr7",
        "targetRef": {
          "kind": "Pod",
          "namespace": "default",
          "name": "cloudprober-test-577cf7bbcc-c7l5p",
          "uid": "61b2a6f7-f9cc-11e9-a334-42010a8a00f9",
          "resourceVersion": "82681480"
        }
      },

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions