question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

discovery.service-labels not works with spring-cloud-starter-kubernetes-client v2.0.1

See original GitHub issue

Describe the bug spring.cloud.kubernetes.discovery.service-labels is ignored with spring-cloud-starter-kubernetes-client v2.0.1, and ServiceInstance metadata contains null key(null=8080) if the k8s service/deployment doesn’t have named ports, which causes NPE from downstream like spring boot admin Tags.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
andreincommented, Aug 3, 2021

I’ve attached a somewhat-minimal example using spring-boot-admin

There are two (separate?) issues here:

  1. spring.cloud.kubernetes.discovery.service-labels seems to be ignored, spring-boot-admin detects every service in the namespace
  2. if one of the detected services doesn’t have named ports, discovery crashes with with a NPE (this looks like a bug in spring-boot-admin):

If I switch from spring-cloud-starter-kubernetes-client to spring-cloud-starter-kubernetes-fabric8, the app works correctly. Does that mean that both issues might be bugs in spring-cloud-starter-kubernetes-client?

1reaction
edwardzjlcommented, Jul 29, 2021

I think I’m running into the same issue with spring-cloud-starter-kubernetes-client v2.0.3

I have 3 services, and only 1 of them is labeled as “openapi-service”:

svc

when I set service-labels to only select service with “openapi-service” label: ( or openapi-service=true, same effect )

config

The pod cannot start, with no ERROR information container log shows it’s applying a service without “openapi-service” label, twice:

error

And that’s the end of log, the container exists after that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found