elastisys / compliantkubernetes-kubespray

Apache License 2.0
28 stars 7 forks source link

rook: add test script #308

Closed lunkan93 closed 1 year ago

lunkan93 commented 1 year ago

What kind of PR is this?

Required: Mark one of the following that is applicable:

Optional: Mark one or more of the following that are applicable:

[!important] Critical security fixes should be marked with kind/security Breaking changes should be marked kind/admin-change or kind/dev-change depending on type

What does this PR do / why do we need this PR?

Added a test script for rook-ceph.

...

Additional information to reviewers

Screenshots

Checklist

lunkan93 commented 1 year ago

I will need to fix some more things to be able to run it in the pipeline, currently looking into that :sweat_smile:

lunkan93 commented 1 year ago

I've tried to address your feedback @Xartos - let me know if I missed something :smile:

Example output with latest changes ❯ ./scripts/test-rook.sh both Testing rook-ceph in sc.. Testing Deployments ==================== csi-rbdplugin-provisioner exists ✔ ready ✔ rook-ceph-operator exists ✔ ready ✔ rook-ceph-toolbox exists ✔ ready ✔ rook-ceph-crashcollector-simon-sc-worker-0 exists ✔ ready ✔ rook-ceph-crashcollector-simon-sc-worker-1 exists ✔ ready ✔ rook-ceph-crashcollector-simon-sc-worker-2 exists ✔ ready ✔ rook-ceph-crashcollector-simon-sc-worker-3 exists ✔ ready ✔ rook-ceph-crashcollector-simon-sc-worker-5 exists ✔ ready ✔ Testing Mons ==================== 3/3 deployments exist ✔ rook-ceph-mon-a ready ✔ rook-ceph-mon-b ready ✔ rook-ceph-mon-c ready ✔ Testing Mgrs ==================== 1/1 deployments exist ✔ rook-ceph-mgr-a ready ✔ Testing OSDs ==================== 5/5 deployments exist ✔ rook-ceph-osd-0 ready ✔ rook-ceph-osd-1 ready ✔ rook-ceph-osd-2 ready ✔ rook-ceph-osd-3 ready ✔ rook-ceph-osd-4 ready ✔ Testing DaemonSets ==================== csi-rbdplugin exists ✔ ready ✔ Testing Jobs ==================== rook-ceph-osd-prepare-simon-sc-worker-0 exists ✔ completed ✔ rook-ceph-osd-prepare-simon-sc-worker-1 exists ✔ completed ✔ rook-ceph-osd-prepare-simon-sc-worker-2 exists ✔ completed ✔ rook-ceph-osd-prepare-simon-sc-worker-3 exists ✔ completed ✔ rook-ceph-osd-prepare-simon-sc-worker-5 exists ✔ completed ✔ Testing CephClusters ==================== Cluster health is not ok: HEALTH_WARN ❌ Cluster phase is ready ✔ Testing ServiceMonitors ==================== Checking targets up to 5 times to avoid flakes... 1 Running tests... serviceMonitor/rook-ceph/rook-ceph-mgr/0 ✔ Testing rook-ceph in wc.. Testing Deployments ==================== csi-rbdplugin-provisioner exists ✔ ready ✔ rook-ceph-operator exists ✔ ready ✔ rook-ceph-toolbox exists ✔ ready ✔ rook-ceph-crashcollector-simon-wc-worker-0 exists ✔ ready ✔ rook-ceph-crashcollector-simon-wc-worker-1 exists ✔ ready ✔ rook-ceph-crashcollector-simon-wc-worker-2 exists ✔ ready ✔ Testing Mons ==================== 3/3 deployments exist ✔ rook-ceph-mon-a ready ✔ rook-ceph-mon-b ready ✔ rook-ceph-mon-c ready ✔ Testing Mgrs ==================== 1/1 deployments exist ✔ rook-ceph-mgr-a ready ✔ Testing OSDs ==================== 3/3 deployments exist ✔ rook-ceph-osd-0 ready ✔ rook-ceph-osd-1 ready ✔ rook-ceph-osd-2 ready ✔ Testing DaemonSets ==================== csi-rbdplugin exists ✔ ready ✔ Testing Jobs ==================== rook-ceph-osd-prepare-simon-wc-worker-0 exists ✔ completed ✔ rook-ceph-osd-prepare-simon-wc-worker-1 exists ✔ completed ✔ rook-ceph-osd-prepare-simon-wc-worker-2 exists ✔ completed ✔ Testing CephClusters ==================== Cluster health is not ok: HEALTH_WARN ❌ Cluster phase is ready ✔ Testing ServiceMonitors ==================== Checking targets up to 5 times to avoid flakes... 1 Running tests... serviceMonitor/rook-ceph/rook-ceph-mgr/0 ✔ Summary ==================== Successes: 58 Failures: 2 Something failed Json output of failed test resources ==================================== { "MON_CLOCK_SKEW": { "message": "clock skew detected on mon.b, mon.c", "severity": "HEALTH_WARN" } } { "MON_DISK_LOW": { "message": "mon a is low on available space", "severity": "HEALTH_WARN" } } Unhealthy/missing prometheus targets ====================================