Skip to content

Commit c86cecd

Browse files
authored
get apiserver & etcd certificates and their http health checks (#666)
1 parent 7891136 commit c86cecd

File tree

1 file changed

+74
-5
lines changed

1 file changed

+74
-5
lines changed

pkg/goods/support/host-support-bundle.yaml

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,81 @@ spec:
1111
- hostOS: {}
1212
- memory: {}
1313
- blockDevices: {}
14+
- certificate:
15+
collectorName: k8s-api-keypair
16+
certificatePath: /var/lib/k0s/pki/k0s-api.crt
17+
keyPath: /var/lib/k0s/pki/k0s-api.key
18+
- certificate:
19+
collectorName: etcd-keypair
20+
certificatePath: /var/lib/k0s/pki/etcd/server.crt
21+
keyPath: /var/lib/k0s/pki/etcd/server.key
22+
# Disk usage for commonly used directories
1423
- diskUsage:
1524
collectorName: root-disk-usage
1625
path: /
1726
- diskUsage:
1827
collectorName: openebs-disk-usage
1928
path: /var/openebs/local
29+
- diskUsage:
30+
collectorName: tmp
31+
path: /tmp
32+
# APIserver and etcd health endpoints
33+
- run:
34+
collectorName: k8s-api-healthz-6443
35+
command: 'curl'
36+
args:
37+
[
38+
'--cert',
39+
'/var/lib/k0s/pki/admin.crt',
40+
'--key',
41+
'/var/lib/k0s/pki/admin.key',
42+
'--cacert',
43+
'/var/lib/k0s/pki/ca.crt',
44+
'-i',
45+
'https://localhost:6443/healthz?verbose',
46+
]
47+
- run:
48+
collectorName: etcd-healthz-2379
49+
command: 'curl'
50+
args:
51+
[
52+
'--cert',
53+
'/var/lib/k0s/pki/apiserver-etcd-client.crt',
54+
'--key',
55+
'/var/lib/k0s/pki/apiserver-etcd-client.key',
56+
'--cacert',
57+
'/var/lib/k0s/pki/etcd/ca.crt',
58+
'-i',
59+
'https://localhost:2379/health',
60+
]
61+
# Run collectors for system information & metrics
62+
- run:
63+
collectorName: free
64+
command: free
65+
args: ['-h']
66+
- run:
67+
collectorName: top
68+
command: top
69+
args: ['-b', '-n', '1']
70+
- run:
71+
collectorName: df
72+
command: df
73+
args: ['-h']
74+
- run:
75+
collectorName: iostat
76+
command: iostat
77+
args: ['-x']
78+
- run:
79+
collectorName: vmstat
80+
command: vmstat
81+
args: ['1', '5']
82+
- run:
83+
collectorName: uptime
84+
command: uptime
85+
- run:
86+
collectorName: k0s-version
87+
command: /usr/local/bin/k0s
88+
args: ['version']
2089
- run:
2190
collectorName: k0s-status
2291
command: /usr/local/bin/k0s
@@ -52,7 +121,7 @@ spec:
52121
- memory:
53122
checkName: Amount of Memory
54123
outcomes:
55-
- warn:
124+
- fail:
56125
when: "< 2G"
57126
message: At least 2G of memory is recommended
58127
- pass:
@@ -64,10 +133,10 @@ spec:
64133
- fail:
65134
when: "total < 40Gi"
66135
message: The disk containing directory / has less than 40Gi of total space
67-
- warn:
136+
- fail:
68137
when: "used/total > 80%"
69138
message: The disk containing directory / is more than 80% full
70-
- warn:
139+
- fail:
71140
when: "available < 10Gi"
72141
message: The disk containing directory / has less than 10Gi of disk space available
73142
- pass:
@@ -79,10 +148,10 @@ spec:
79148
- fail:
80149
when: "total < 40Gi"
81150
message: The disk containing OpenEBS volumes has less than 40Gi of space
82-
- warn:
151+
- fail:
83152
when: "used/total > 80%"
84153
message: The disk containing OpenEBS volumes is more than 80% full
85-
- warn:
154+
- fail:
86155
when: "available < 10Gi"
87156
message: The disk containing OpenEBS volumes has less than 10Gi of disk space available
88157
- pass:

0 commit comments

Comments
 (0)