[feat] add linode token health check #296
Open
+287
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes it happens that the LINODE API TOKEN used by ccm expires or is revoked. This can go unnoticed for long periods since the only mechanism in place is logging it when actual call to Linode API fails. This PR implements health checker component that periodically makes calls to authenticated linode api endpoint (/v4/profile) to determine validity of token being used. Upon detection of invalid token health checker sends a signal to shut down controllers. This results in ccm Pod CrashLoopBackOffing which is greatly visible and can be acted upon. Health checker is only started when the controller is elected the leader. This reduces number of calls done to Linode API if there are multiple replicas of ccm. Whole health checker functionality is behind
--enable-token-health-checker
flag to be explicitly enabled if needed rather than enabling it by default.General:
Pull Request Guidelines: