add MODE: apicert to check the expiration date #35
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.
The K8s API use also the internal PKI TLS certificate to provide HTTPs. We can check the TLS certificate on port 6443 to check the expiredate of the internal PKI TLS certificate. We can use params like -w 30 (days) and -c 15 (days) to sent warning and critical alarms. This would be a own MODE.
The API cert in K8s: /etc/kubernetes/pki/apiserver.crt
example:
if APIPORT is on 443 (you don't have to specify the port)
./check_kubernetes.sh -H https://192.168.100.10 -t $TOKENFILE -m apicert -w 30 -c 15
if APIPORT != 443 (you have to specify the port)
./check_kubernetes.sh -H https://192.168.100.10:6443 -t $TOKENFILE -m apicert -w 30 -c 15