Skip to content

Commit 47c3198

Browse files
committed
build(gh-action): add debug information
1 parent c5aa96c commit 47c3198

File tree

1 file changed

+70
-70
lines changed

1 file changed

+70
-70
lines changed
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
1+
---
12
name: Checks deployment of kubenurse
3+
description: series of health check to validate kubenurse deployment
24

35
inputs:
46
namespace:
57
description: Namespace where the kubenurse is deployed
68
required: true
7-
type: string
89
svc-domain:
910
description: Ingress domain on which the kubenurse is running
1011
required: true
11-
type: string
1212

1313
runs:
1414
using: "composite"
1515
steps:
16-
- shell: bash
17-
run: |
18-
echo "Check number of kubenurses"
19-
test $(kubectl -n ${{ inputs.namespace }} get pods -l app.kubernetes.io/name=kubenurse \
20-
| wc -l) -eq 4 # Test for 3 Pods + header
21-
- shell: bash
22-
run: |
23-
echo "Check for unexpected log lines"
24-
test $(kubectl -n ${{ inputs.namespace }} logs -l app.kubernetes.io/name=kubenurse \
25-
| grep -v "kubenurse just started" \
26-
| wc -l) -eq 0 \
27-
- shell: bash
28-
run: |
29-
echo "Check if the kubenurse had any restarts"
30-
kubectl -n ${{ inputs.namespace }} get pods -l app.kubernetes.io/name=kubenurse \
31-
-o jsonpath='{range .items[*]}{.status.containerStatuses[0].restartCount}{"\n"}{end}' \
32-
| (! grep -v 0) # Validate for 0 restarts
33-
- shell: bash
34-
run: |
35-
echo "Check that metrics contain kubenurse specific data"
36-
curl -k -s --resolve \
37-
${{ inputs.svc-domain }}:443:127.0.0.1 \
38-
https://${{ inputs.svc-domain }}:443/metrics \
39-
| grep "kubenurse_httpclient_request_" > /dev/null
40-
- shell: bash
41-
run: |
42-
echo "Check that metrics contain neighbours"
43-
curl -k -s --resolve \
44-
${{ inputs.svc-domain }}:443:127.0.0.1 \
45-
https://${{ inputs.svc-domain }}:443/metrics \
46-
| grep "kubenurse_httpclient_request_" | grep 'type="path_' > /dev/null
47-
- shell: bash
48-
run: |
49-
echo "Check that metrics contain no errors"
50-
curl -k -s --resolve \
51-
${{ inputs.svc-domain }}:443:127.0.0.1 \
52-
https://${{ inputs.svc-domain }}:443/metrics \
53-
| (! grep "kubenurse_errors_total")
54-
- shell: bash
55-
run: |
56-
echo "Check the neighbourhood state"
57-
curl -k -s --resolve \
58-
${{ inputs.svc-domain }}:443:127.0.0.1 \
59-
https://${{ inputs.svc-domain }}:443/alive \
60-
| grep '"neighbourhood_state": "ok"' > /dev/null
61-
- shell: bash
62-
run: |
63-
echo "Check that discovery is ok and status page includes neighbours"
64-
curl -k -s --resolve \
65-
${{ inputs.svc-domain }}:443:127.0.0.1 \
66-
https://${{ inputs.svc-domain }}:443/alive \
67-
| grep '"neighbourhood": \[' > /dev/null # If no others are discovered, this is null
68-
- shell: bash
69-
run: |
70-
echo "Show kubenurse status"
71-
curl -k -s --resolve \
72-
${{ inputs.svc-domain }}:443:127.0.0.1 \
73-
https://${{ inputs.svc-domain }}:443/alive
74-
if: ${{ always() }}
75-
- shell: bash
76-
run: |
77-
echo "Describe resources on failure"
78-
kubectl -n ${{ inputs.namespace }} get pods -o wide
79-
kubectl -n ${{ inputs.namespace }} logs -l app.kubernetes.io/name=kubenurse
80-
kubectl -n ${{ inputs.namespace }} describe pods -l app.kubernetes.io/name=kubenurse
81-
kubectl -n ${{ inputs.namespace }} describe daemonsets -l app.kubernetes.io/name=kubenurse
82-
kubectl -n ${{ inputs.namespace }} get events
83-
if: ${{ failure() }}
16+
- shell: bash
17+
run: |
18+
echo "Check number of kubenurses"
19+
test $(kubectl -n ${{ inputs.namespace }} get pods -l app.kubernetes.io/name=kubenurse \
20+
| wc -l) -eq 4 # Test for 3 Pods + header
21+
- shell: bash
22+
run: |
23+
echo "Check for unexpected log lines"
24+
test $(kubectl -n ${{ inputs.namespace }} logs -l app.kubernetes.io/name=kubenurse \
25+
| grep -v "kubenurse just started" \
26+
| wc -l) -eq 0 \
27+
- shell: bash
28+
run: |
29+
echo "Check if the kubenurse had any restarts"
30+
kubectl -n ${{ inputs.namespace }} get pods -l app.kubernetes.io/name=kubenurse \
31+
-o jsonpath='{range .items[*]}{.status.containerStatuses[0].restartCount}{"\n"}{end}' \
32+
| (! grep -v 0) # Validate for 0 restarts
33+
- shell: bash
34+
run: |
35+
echo "Check that metrics contain kubenurse specific data"
36+
curl -k -s --resolve \
37+
${{ inputs.svc-domain }}:443:127.0.0.1 \
38+
https://${{ inputs.svc-domain }}:443/metrics \
39+
| grep "kubenurse_httpclient_request_" > /dev/null
40+
- shell: bash
41+
run: |
42+
echo "Check that metrics contain neighbours"
43+
curl -k -s --resolve \
44+
${{ inputs.svc-domain }}:443:127.0.0.1 \
45+
https://${{ inputs.svc-domain }}:443/metrics \
46+
| grep "kubenurse_httpclient_request_" | grep 'type="path_' > /dev/null
47+
- shell: bash
48+
run: |
49+
echo "Check that metrics contain no errors"
50+
curl -k -s --resolve \
51+
${{ inputs.svc-domain }}:443:127.0.0.1 \
52+
https://${{ inputs.svc-domain }}:443/metrics \
53+
| (! grep "kubenurse_errors_total")
54+
- shell: bash
55+
run: |
56+
echo "Check the neighbourhood state"
57+
curl -k -s --resolve \
58+
${{ inputs.svc-domain }}:443:127.0.0.1 \
59+
https://${{ inputs.svc-domain }}:443/alive \
60+
| grep '"neighbourhood_state": "ok"' > /dev/null
61+
- shell: bash
62+
run: |
63+
echo "Check that discovery is ok and status page includes neighbours"
64+
curl -k -s --resolve \
65+
${{ inputs.svc-domain }}:443:127.0.0.1 \
66+
https://${{ inputs.svc-domain }}:443/alive \
67+
| grep '"neighbourhood": \[' > /dev/null # If no others are discovered, this is null
68+
- shell: bash
69+
run: |
70+
echo "Show kubenurse status"
71+
curl -k -s --resolve \
72+
${{ inputs.svc-domain }}:443:127.0.0.1 \
73+
https://${{ inputs.svc-domain }}:443/alive
74+
if: ${{ always() }}
75+
- shell: bash
76+
run: |
77+
echo "Describe resources on failure"
78+
kubectl get pods -o wide --all-namespaces
79+
kubectl -n ${{ inputs.namespace }} logs -l app.kubernetes.io/name=kubenurse
80+
kubectl -n ${{ inputs.namespace }} describe pods -l app.kubernetes.io/name=kubenurse
81+
kubectl -n ${{ inputs.namespace }} describe daemonsets -l app.kubernetes.io/name=kubenurse
82+
kubectl -n ${{ inputs.namespace }} get events
83+
if: ${{ failure() }}

0 commit comments

Comments
 (0)