godaddy / godaddy/kubernetes-client

Regarding watch event failures and retries

Open
#682 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
963
Forks
189
PR merge metrics
No merged PRs in 30d

Description

Looking at the examples of the implementation of watches for resources. How would the reconciliation work in the event that a creation/update/deletion event fails and needs to be retried again?

It does not seem right to handle the retry from within the code. Is there someway to reschedule a retry?

From the example of the watchDeploymentNotifiers below:
```
function watchDeploymentNotifiers (client) {
const stream = client.apis['kubernetes-client.io'].v1.watch.deploymentnotifiers.getStream()
const jsonStream = new JSONStream()
stream.pipe(jsonStream)

const watchers = {}
jsonStream.on('data', async event => {
const id = `${event.object.metadata.namespace}/${event.object.metadata.name}`
if (event.type === 'ADDED') {

// What happens if the logic fails here and errors out
// How do I ensure that the watch for this particular resource version is triggered again?

} else if (event.type === 'DELETED') {

}
})
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the watchDeploymentNotifiers example, including getStream(), JSONStream, and the data handler. Determine how failed ADDED or DELETED handling should be retried for a resource version, and whether the client already exposes a rescheduling mechanism; done means documenting or defining the retry and reconciliation behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, kubernetes, nodejs
Domain
api, backend, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.