Skip to content
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

Prometheus Operator Support and Change Socket Path #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Binary file added docs/missing-container-metrics-0.2.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/missing-container-metrics/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/missing-container-metrics/templates/daemon-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
{{- if .Values.useContainerd}}
- name: containerdsock
hostPath:
path: /run/containerd/containerd.sock
path: {{ .Values.containerdSocketPath }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
Expand Down
23 changes: 23 additions & 0 deletions docs/missing-container-metrics/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
19 changes: 19 additions & 0 deletions docs/missing-container-metrics/templates/prometheusrule.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
40 changes: 38 additions & 2 deletions docs/missing-container-metrics/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "3001"


podSecurityContext: {}
# fsGroup: 2000

Expand All @@ -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
Expand All @@ -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