-
Notifications
You must be signed in to change notification settings - Fork 38
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
optional pod selector labels #98
Conversation
Thanks for this as well. |
Thanks for looking into it! |
This allows enabling core-dump-handler only on pods that match a configured selector pod-label. Useful if we need core-dump-handler only for a subset of our workload. The composer checks for the pod label and only prepares the upload only if the pod matches the selector configured. The default (empty selector label) is to have no selectors and enable collection for all. Only the existence of the label is checked for. The selector can be configured via `daemonSet.podSelectorLabel` in `values.yaml`, which translates to the `POD_SELECTOR_LABEL` environment variable in the daemonset.
89010c6
to
abba8f9
Compare
charts/core-dump-handler/README.md
Outdated
@@ -214,6 +214,7 @@ The agent pod has the following environment variables and these are all set by t | |||
* INTERVAL - The amount of time in milliseconds between each check of the core dump folder for files to upload. | |||
* SCHEDULE - A CRON formatted string [See cron library](https://github.com/mvniekerk/tokio-cron-scheduler#usage). | |||
* USE_INOTIFY - Set a listener for the coredump folder can be used in conjunction with SCHEDULE | |||
* POD_SELECTOR_LABEL - Optional selector label to filter pods that have core dump collection enabled. Default (empty) disables filter. |
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.
As per conversation this should be COMP_POD_SELECTOR_LABEL
Also add an an example label so it's clear how this works
@@ -33,6 +33,7 @@ daemonset: | |||
hostDirectory: "/var/mnt/core-dump-handler" | |||
coreDirectory: "/var/mnt/core-dump-handler/cores" | |||
crioEndpoint: "unix:///run/containerd/containerd.sock" | |||
podSelectorLabel: "" |
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.
As per conversation should be in composer not daemonset
@@ -33,6 +33,7 @@ daemonset: | |||
hostDirectory: "/var/mnt/core-dump-handler" | |||
coreDirectory: "/var/mnt/core-dump-handler/cores" | |||
crioEndpoint: "unix:///run/containerd/containerd.sock" | |||
podSelectorLabel: "" |
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.
As per conversation should be in composer not daemonset
@@ -33,6 +33,7 @@ daemonset: | |||
hostDirectory: "/var/mnt/core-dump-handler" | |||
coreDirectory: "/var/mnt/core-dump-handler/cores" | |||
crioEndpoint: "unix:///run/containerd/containerd.sock" | |||
podSelectorLabel: "" |
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.
As per conversation should be in composer not daemonset
@@ -34,6 +34,7 @@ daemonset: | |||
hostDirectory: "/var/mnt/core-dump-handler" | |||
coreDirectory: "/var/mnt/core-dump-handler/cores" | |||
crioEndpoint: "unix:///run/containerd/containerd.sock" | |||
podSelectorLabel: "" |
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.
As per conversation should be in composer not daemonset
@@ -45,6 +45,8 @@ spec: | |||
value: {{ .Values.daemonset.deployCrioConfig | quote }} | |||
- name: CRIO_ENDPOINT | |||
value: {{ .Values.daemonset.crioEndpoint | quote }} | |||
- name: POD_SELECTOR_LABEL |
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.
Should have COMP_ prefix
@@ -205,6 +205,9 @@ | |||
"crioEndpoint": { | |||
"type": "string" | |||
}, | |||
"podSelectorLabel": { | |||
"type": "string" |
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.
Should move to composer definition
charts/core-dump-handler/values.yaml
Outdated
@@ -33,6 +33,7 @@ daemonset: | |||
hostDirectory: "/var/mnt/core-dump-handler" | |||
coreDirectory: "/var/mnt/core-dump-handler/cores" | |||
crioEndpoint: "unix:///run/containerd/containerd.sock" | |||
podSelectorLabel: "" |
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.
As per conversation should be in composer not daemonset
The good news is that this doesn't interfere with the cloud events. The bad news is that the pod selector config mapping isn't quite in the right place. All config that is passed to the composer should be in the composer section Could you add an example of a label value in the Environment config The values section in the docs also needs to be updated along with the environment section. I've gone through the PR to also highlight where I think these changes need to be done. (Edit) Once the mapping is aligned I'm happy to merge and push a release. |
I have now added 1186de2 which hopefully addresses these. Thanks for the guidance! |
Looks good - I have some dep updates to land then I'll put together a release |
This allows enabling core-dump-handler only on pods that match a configured selector pod-label. Useful if we need core-dump-handler only for a subset of our workload. The composer checks for the pod label and only prepares the upload only if the pod matches the selector configured. The default (empty selector label) is to have no selectors and enable collection for all. Only the existence of the label is checked for.
The selector can be configured via
daemonSet.podSelectorLabel
invalues.yaml
, which translates to thePOD_SELECTOR_LABEL
environment variable in the daemonset.