Retry Microservice
π Contents
β Description
The Retry service's goal is to reschedule pods that failed
β Deployment of the retry service
Before deploying the retry.yaml file, please configure the environment variables to the correct values used by the queue microservice.
env:
- name: MQ_HOST
value: "sched-rabbitmq-0.sched-rabbitmq.custom-scheduler.svc.cluster.local"
- name: MQ_PORT
value: "5672"
- name: MQ_USER
value: "guest"
- name: MQ_PASS
value: "guest"
- name: RECEIVE_QUEUE
value: "epsilon.backoff"
β Retry algorithm
[STEP 1]
The retry service monitors the queue for new pods that failed.
[STEP 2]
When a pod that failed is recevied, the retry service will generate a backoff timer and wait for the backoff timer to pass
[STEP 3]
Once the backoff duration had past, the retry service will send the failed pod back to its respective scheduling queue
β Directory and File Description
Directory Name |
File name |
Description |
/ |
main.go |
Implementation code of the main routine |
/helper |
helper.go |
Contain helper methods use by the main routine |
/docker |
Dockerfile |
Used by docker to create a docker image |
/yaml |
retry.yaml |
Deployment file to deploy the scheduler in a Kubernetes cluster |
β Common questions
- How to change the retry algorithm?
- The function WaitAndSend() in line 176 of main.go, contains the implementation of the retry algorithm. By modifiying this function the retry algorithm can be modified.