Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airship 3913 move node problem detector #19

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .drone.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/rvu/labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service.rvu.co.uk/brand: airship
27 changes: 27 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: push
on: push
permissions:
contents: read
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- id: meta
uses: docker/metadata-action@v5
with:
images: quay.io/uswitch/node-problem-detector
tags: type=sha,prefix=,format=long
- uses: docker/build-push-action@v6
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
Adding our own scripts to https://github.com/kubernetes/node-problem-detector
# Node Problem Detector custom scripts

Adding our own scripts to https://github.com/kubernetes/node-problem-detector and sharing them in case you might find those handy for you use cases.


The scripts details can be found in `/config/plugin/` but ultimately, they are:
* `launch-config-drift`: a way to check if your instances launch template has diverged from your asg launch template
* `spot-termination`: uses the `meta-data/spot/instance-action endpoint` to check EC2 Spot Instance interruption notice
* `local-dns-resolver`: checks the response status value received (if any) from the local dns resolver ip
* `upstream-dns-resolver`: check if we receive an IPv4 address for a given A record.
* `uptime`: every 5 seconds, checks if the information detailing how long the system has been on since its last restart is acceptable (to us the threshold being 604800 seconds)


## Notes
*July 2024 -* The custom `node problem detector` image is now stored in the `uswitch/node_problem_detectr` repository on Quay.
<br>
6 changes: 3 additions & 3 deletions config/plugin/launch_config_drift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ then
fi

instance="$(echo "${instances}" | jq '.AutoScalingInstances[0]')"
instance_launch_config="$(echo "${instance}" | jq -r .LaunchConfigurationName)"
instance_launch_config="$(echo "${instance}" | jq -r .LaunchTemplate.LaunchTemplateName)"
instance_asg="$(echo "${instance}" | jq -r .AutoScalingGroupName)"

asgs="$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names ${instance_asg})"
Expand All @@ -26,11 +26,11 @@ then
exit $UNKNOWN
fi

asg_launch_config="$(echo "${asgs}" | jq -r '.AutoScalingGroups[0].LaunchConfigurationName')"
asg_launch_config="$(echo "${asgs}" | jq -r '.AutoScalingGroups[0].MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName')"

if [ "${instance_launch_config}" = "${asg_launch_config}" ]
then
exit $OK
else
exit $NONOK
fi
fi