From faae3663020f2b067880a55821276fb77ef6f397 Mon Sep 17 00:00:00 2001 From: Andrew Zammit Date: Sat, 21 Aug 2021 13:34:38 -0700 Subject: [PATCH] [smarter-device-manager] use a termination message path outside of /dev to allow a read-only /dev mount (#1092), use the container log for termination message (#1129) Signed-off-by: Andrew Zammit --- charts/stable/smarter-device-manager/Chart.yaml | 2 +- charts/stable/smarter-device-manager/README.md | 12 +++++++++++- .../README_CHANGELOG.md.gotmpl | 8 ++++++++ charts/stable/smarter-device-manager/values.yaml | 12 ++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/charts/stable/smarter-device-manager/Chart.yaml b/charts/stable/smarter-device-manager/Chart.yaml index b447b883..8fd7d0b0 100644 --- a/charts/stable/smarter-device-manager/Chart.yaml +++ b/charts/stable/smarter-device-manager/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 1.20.7 description: Manage hardware resource allocation without a need for privileged containers name: smarter-device-manager -version: 6.0.0 +version: 6.1.0 kubeVersion: ">=1.16.0-0" keywords: - kubernetes diff --git a/charts/stable/smarter-device-manager/README.md b/charts/stable/smarter-device-manager/README.md index 0db0a701..7457829d 100644 --- a/charts/stable/smarter-device-manager/README.md +++ b/charts/stable/smarter-device-manager/README.md @@ -1,6 +1,6 @@ # smarter-device-manager -![Version: 6.0.0](https://img.shields.io/badge/Version-6.0.0-informational?style=flat-square) ![AppVersion: 1.20.7](https://img.shields.io/badge/AppVersion-1.20.7-informational?style=flat-square) +![Version: 6.1.0](https://img.shields.io/badge/Version-6.1.0-informational?style=flat-square) ![AppVersion: 1.20.7](https://img.shields.io/badge/AppVersion-1.20.7-informational?style=flat-square) Manage hardware resource allocation without a need for privileged containers @@ -124,6 +124,8 @@ In this case host device `/dev/ttyUSB-Conbee-2` will be given at the same path, | persistence | object | See values.yaml | Configure persistence settings for the chart under this key. | | priorityClassName | string | `"system-node-critical"` | Custom priority class for different treatment by the scheduler Setting this is not necessary, but it is recommended. [[ref]](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/) | | securityContext | object | See values.yaml | Configure the securityContext for this pod [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) | +| termination.messagePath | string | `"/var/log/termination-log"` | Configure the path at which the file to which the main container's termination message will be written. Overrides the default of `/dev/termination-log` to allow read-only `persistence.devfs` at `/dev`. [[ref](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle-1)] | +| termination.messagePolicy | string | `"FallbackToLogsOnError"` | Indicate how the main container's termination message should be populated. Valid options are `File` and `FallbackToLogsOnError`. smarter-device-manager does not support a termination-log, so use the container's log. [[ref](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle-1)] | ## Changelog @@ -131,6 +133,13 @@ All notable changes to this application Helm chart will be documented in this fi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [6.1.0] + +#### Changed + +- Override the default container `terminationMessagePath` to allow mounting `/dev` as read-only. The path is now `/var/log/termination-log`. Fixes #1092. +- Use the container's error log to populate the container termination message, since smarter-device-manager does not support a k8s `termination-log`. + ### [6.0.0] #### Changed @@ -164,6 +173,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Initial version +[6.1.0]: #610 [6.0.0]: #600 [5.0.0]: #500 [4.0.0]: #400 diff --git a/charts/stable/smarter-device-manager/README_CHANGELOG.md.gotmpl b/charts/stable/smarter-device-manager/README_CHANGELOG.md.gotmpl index 04dc25a6..875dd8bc 100644 --- a/charts/stable/smarter-device-manager/README_CHANGELOG.md.gotmpl +++ b/charts/stable/smarter-device-manager/README_CHANGELOG.md.gotmpl @@ -9,6 +9,13 @@ All notable changes to this application Helm chart will be documented in this fi The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [6.1.0] + +#### Changed + +- Override the default container `terminationMessagePath` to allow mounting `/dev` as read-only. The path is now `/var/log/termination-log`. Fixes #1092. +- Use the container's error log to populate the container termination message, since smarter-device-manager does not support a k8s `termination-log`. + ### [6.0.0] #### Changed @@ -42,6 +49,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Initial version +[6.1.0]: #610 [6.0.0]: #600 [5.0.0]: #500 [4.0.0]: #400 diff --git a/charts/stable/smarter-device-manager/values.yaml b/charts/stable/smarter-device-manager/values.yaml index 70dc5034..31394287 100644 --- a/charts/stable/smarter-device-manager/values.yaml +++ b/charts/stable/smarter-device-manager/values.yaml @@ -25,6 +25,18 @@ hostNetwork: true # -- Defaults to "ClusterFirst" if hostNetwork is false and "ClusterFirstWithHostNet" if hostNetwork is true. dnsPolicy: # ClusterFirstWithHostNet +termination: + # -- Configure the path at which the file to which the main container's termination message will be written. + # Overrides the default of `/dev/termination-log` to allow read-only `persistence.devfs` at `/dev`. + # [[ref](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle-1)] + messagePath: /var/log/termination-log + + # -- Indicate how the main container's termination message should be populated. + # Valid options are `File` and `FallbackToLogsOnError`. + # smarter-device-manager does not support a termination-log, so use the container's log. + # [[ref](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle-1)] + messagePolicy: FallbackToLogsOnError + # -- Configure persistence settings for the chart under this key. # @default -- See values.yaml persistence: