diff --git a/docs/index.yaml b/docs/index.yaml index efdb92c..a31a307 100644 --- a/docs/index.yaml +++ b/docs/index.yaml @@ -3,7 +3,17 @@ entries: missing-container-metrics: - apiVersion: v2 appVersion: 0.21.0 - created: "2021-03-16T23:23:55.350667202Z" + created: "2021-07-15T10:47:27.639232+01:00" + description: A Helm chart for installing missing-container-metrics exporter + digest: a13d1645b68ea9c096f2f808ff03b564a460f5d77c66f860c0cce9ce43bc1365 + name: missing-container-metrics + type: application + urls: + - https://draganm.github.io/missing-container-metrics/missing-container-metrics-0.2.0.tgz + version: 0.2.0 + - apiVersion: v2 + appVersion: 0.21.0 + created: "2021-06-18T11:17:45.222248+01:00" description: A Helm chart for installing missing-container-metrics exporter digest: 7a7363437f74d90c3ad7071a5a3aff221b68b91ff7dc67bb32d192d5aba60139 name: missing-container-metrics @@ -21,4 +31,4 @@ entries: urls: - https://draganm.github.io/missing-container-metrics/missing-container-metrics-0.1.0.tgz version: 0.1.0 -generated: "2021-03-16T23:23:55.349887903Z" +generated: "2021-07-15T10:47:27.638021+01:00" diff --git a/docs/missing-container-metrics-0.2.0.tgz b/docs/missing-container-metrics-0.2.0.tgz new file mode 100644 index 0000000..36b674d Binary files /dev/null and b/docs/missing-container-metrics-0.2.0.tgz differ diff --git a/docs/missing-container-metrics/Chart.yaml b/docs/missing-container-metrics/Chart.yaml index 1f971b2..928515a 100644 --- a/docs/missing-container-metrics/Chart.yaml +++ b/docs/missing-container-metrics/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/docs/missing-container-metrics/templates/daemon-set.yaml b/docs/missing-container-metrics/templates/daemon-set.yaml index 806197b..8065c3d 100644 --- a/docs/missing-container-metrics/templates/daemon-set.yaml +++ b/docs/missing-container-metrics/templates/daemon-set.yaml @@ -32,7 +32,7 @@ spec: {{- if .Values.useContainerd}} - name: containerdsock hostPath: - path: /run/containerd/containerd.sock + path: {{ .Values.containerdSocketPath }} {{- end }} containers: - name: {{ .Chart.Name }} diff --git a/docs/missing-container-metrics/templates/podmonitor.yaml b/docs/missing-container-metrics/templates/podmonitor.yaml new file mode 100644 index 0000000..2e91173 --- /dev/null +++ b/docs/missing-container-metrics/templates/podmonitor.yaml @@ -0,0 +1,23 @@ +{{ if .Values.prometheusOperator.podMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ include "missing-container-metrics.fullname" . }} + {{- with .Values.prometheusOperator.podMonitor.namespace }} + namespace: {{ . }} + {{- end }} + labels: + {{- include "missing-container-metrics.labels" . | nindent 4 }} + {{- with .Values.prometheusOperator.podMonitor.selector }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "missing-container-metrics.selectorLabels" . | nindent 6 }} + podMetricsEndpoints: + - port: http + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{ end }} diff --git a/docs/missing-container-metrics/templates/prometheusrule.yaml b/docs/missing-container-metrics/templates/prometheusrule.yaml new file mode 100644 index 0000000..d8f43f0 --- /dev/null +++ b/docs/missing-container-metrics/templates/prometheusrule.yaml @@ -0,0 +1,19 @@ +{{ if .Values.prometheusOperator.prometheusRule.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ include "missing-container-metrics.fullname" . }} + {{- with .Values.prometheusOperator.prometheusRule.namespace }} + namespace: {{ . }} + {{- end }} + labels: + {{- include "missing-container-metrics.labels" . | nindent 4 }} + {{- with .Values.prometheusOperator.prometheusRule.selector }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + groups: + - name: {{ include "missing-container-metrics.fullname" . }} + rules: + {{- toYaml .Values.prometheusOperator.prometheusRule.rules | nindent 6 }} +{{ end }} diff --git a/docs/missing-container-metrics/values.yaml b/docs/missing-container-metrics/values.yaml index ede6d6c..a2ee308 100644 --- a/docs/missing-container-metrics/values.yaml +++ b/docs/missing-container-metrics/values.yaml @@ -17,7 +17,6 @@ podAnnotations: prometheus.io/scrape: "true" prometheus.io/port: "3001" - podSecurityContext: {} # fsGroup: 2000 @@ -29,7 +28,6 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 - resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -44,3 +42,41 @@ resources: {} useDocker: false useContainerd: true + +# Override containerd socket path. Bottlerocket uses /run/dockershim.sock even though it uses containerd. +containerdSocketPath: /run/containerd/containerd.sock + +prometheusOperator: + podMonitor: + # Create a Prometheus Operator PodMonitor resource + enabled: false + # Namespace defaults to the Release namespace but can be overridden + namespace: "" + # Additional labels to add to the PodMonitor so it matches the Operator's podMonitorSelector + selector: + # release: "kube-prometheus-stack" + + prometheusRule: + # Create a Prometheus Operator PrometheusRule resource + enabled: false + # Namespace defaults to the Release namespace but can be overridden + namespace: "" + # Additional labels to add to the PrometheusRule so it matches the Operator's ruleSelector + selector: + # release: "kube-prometheus-stack" + # app: "kube-prometheus-stack" + # The rules can be set here. An example is defined here but can be overridden. + rules: + - alert: ContainerOOMObserved + annotations: + message: A process in this Pod has been OOMKilled due to exceeding the Kubernetes memory limit at least twice in the last 15 minutes. Look at the metrics to determine if a memory limit increase is required. + expr: max(increase(container_ooms[15m])) by (exported_namespace, exported_pod) > 2 + labels: + severity: warning + - alert: ContainerOOMObserved + annotations: + message: A process in this Pod has been OOMKilled due to exceeding the Kubernetes memory limit at least ten times in the last 15 minutes. Look at the metrics to determine if a memory limit increase is required. + expr: max(increase(container_ooms[15m])) by (exported_namespace, exported_pod) > 10 + labels: + severity: critical +