Kubernetes Endpoints with TTL

0 votes
I have a Kubernetes service without a selector. I want to manually manage the Endpoints by having the endpoint servers register themselves.

Is there a way to specify a TTL for Endpoints when I POST them to the Kubernetes API server, so that they will timeout and be deleted automatically if my endpoint server terminates and stops heartbeating?
Aug 27, 2018 in Kubernetes by lina
• 8,220 points
777 views

1 answer to this question.

0 votes

Follow these steps:

  1. add an annotation to each object that you want to have a TTL. The annotation can say when it should expire. You can pick the name and format of this annotation.
  2. update the annotation each time you update the object.
  3. run another process that repeatedly lists all the objects of a given type and deletes ones that need to expire

Ready to master the future of cloud computing? Enroll now in our Kubernetes Course! Gain hands-on expertise in container orchestration, scale applications effortlessly, and streamline deployment workflows with Kubernetes.

answered Aug 27, 2018 by Kalgi
• 52,350 points

Related Questions In Kubernetes

0 votes
1 answer

Kubernetes endpoints showing "ServiceUnavailable"

Those URLs are incomplete. Influx's ports are ...READ MORE

answered Sep 6, 2018 in Kubernetes by Kalgi
• 52,350 points
2,815 views
0 votes
1 answer

Kubernetes Ingress Path only works with /

Have you changed the context path in ...READ MORE

answered Sep 7, 2018 in Kubernetes by Kalgi
• 52,350 points
2,719 views
0 votes
1 answer

Issue with Kubernetes ingress routing to Nextjs applications

You’re using nginx ingress controller which does ...READ MORE

answered Sep 11, 2018 in Kubernetes by Kalgi
• 52,350 points
2,530 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
0 votes
2 answers

DNS does not resolve with NGINX in Kubernetes

adding to @kalgi's answer Using just the hostname ...READ MORE

answered Aug 30, 2018 in Kubernetes by Nilesh
• 7,060 points
5,620 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP