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
675 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,360 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,360 points
2,724 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,360 points
2,548 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,360 points
2,315 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
14,950 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,360 points

reshown Apr 12, 2019 by Kalgi 6,555 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,050 points
5,341 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