-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat: New host collector and analyzer for Kernel Configs #1546
Conversation
1df4af7
to
958ceca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to highlight in this change is that for this collector, all pass outcomes are evaluated, and the outcome will be set to fail if when condition does not match.
This approach will confuse people. It differs from how outcomes have been designed where when one of the outcomes evaluates to true, evaluation of outcomes for that analyser stops.
Other analysers follow an approach where inputs to evaluate against are passed in as separate parameters. Here is an example of how a kernel config analyser might look. Note that the list of kernel config values are passed in as selectedKernelConfigs
input value, not defining each in an outcome.
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
spec:
hostCollectors:
- kernelConfigs: {}
hostAnalyzers:
- kernelConfigs:
collectorName: "Kernel Configs Check"
strict: true
selectedKernelConfigs:
- CONFIG_CGROUP_FREEZER=y
- CONFIG_NETFILTER_XTABLES=m
outcomes:
- pass:
when: "true"
message: "Selected kernel configs are present"
- fail:
message: "{{ .ConfigsNotFound }} kernel configs are missing"
There are exceptions such as velero
and ceph
analysers where the outcomes are hardcoded in the analyser itself. This is acceptable because users do not define outcomes.
The collector implementation looks good |
That's a great idea on |
77e36de
to
add21c3
Compare
Hi @banjoh , I have made the requested changes, please let me know how it goes Sample spec apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: kernel-configs
spec:
hostCollectors:
- kernelConfigs: {}
hostAnalyzers:
- kernelConfigs:
collectorName: "Gerard Kernel Configs Test"
strict: true
selectedConfigs:
- CONFIG_CGROUP_FREEZER=y
- CONFIG_NETFILTER_XTABLES=m
outcomes:
- pass:
message: "all kernel configs are available"
- fail:
message: "missing kernel config(s): {{ .ConfigsNotFound }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description, Motivation and Context
This PR introduces new host collector+analyzer
Kernel Configs
The collector will collect kernel configurations and the analyzer can check existence of kernel config key and value.
This will help with pre-flight checks for software like k0s and Embedded Cluster
https://docs.k0sproject.io/stable/external-runtime-deps/#linux-kernel-configuration
One thing to highlight in this change is that for this collector, all
pass
outcomes are evaluated, and the outcome will be set tofail
ifwhen
condition does not match.Sample spec
Checklist
Does this PR introduce a breaking change?