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

consul k8s sync statically setting pod status to healthy #4207

Closed
nabilmasri0 opened this issue Jul 24, 2024 · 1 comment · Fixed by #3874
Closed

consul k8s sync statically setting pod status to healthy #4207

nabilmasri0 opened this issue Jul 24, 2024 · 1 comment · Fixed by #3874
Labels
type/bug Something isn't working

Comments

@nabilmasri0
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview

when syncing k8s services to consul the k8s healthcheck is always set to "healthy" regardless of the actual health status

Recreation scenario

  1. consul deployed with the following values
syncCatalog:
  enabled: true
  default: true
  toConsul: true
  k8sAllowNamespaces: ["ns"]
  toK8S: false
  addK8SNamespaceSuffix: false      
  consulWriteInterval: 5s
connectInject:
  enabled: false
  1. Scale new pods
    scale a certain deployment to more replicas, they will be added to consul with status healthy even before passing the k8s health check

Context

the healthcheck status is set to passing regardless of the the actual endpoint status
https://github.com/hashicorp/consul-k8s/blob/main/control-plane/catalog/to-consul/resource.go#L797

the Endpoint object from discovery/v1 does expose an EndpointConditions object from which the actual status can be retrieved

@nabilmasri0 nabilmasri0 added the type/bug Something isn't working label Jul 24, 2024
@jukie
Copy link
Contributor

jukie commented Oct 15, 2024

#3874 fixed this

@blake blake linked a pull request Oct 16, 2024 that will close this issue
2 tasks
@blake blake closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants