chore: update prometheus adapater

This commit is contained in:
MacLikorne
2021-08-16 11:45:43 +02:00
committed by Benjamin
parent 6baf9b5f88
commit 334ffefb7e
9 changed files with 51 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: v0.8.3
appVersion: v0.8.4
description: A Helm chart for k8s prometheus adapter
home: https://github.com/DirectXMan12/k8s-prometheus-adapter
keywords:
@@ -17,4 +17,4 @@ name: prometheus-adapter
sources:
- https://github.com/kubernetes/charts
- https://github.com/DirectXMan12/k8s-prometheus-adapter
version: 2.12.1
version: 2.15.2

View File

@@ -118,11 +118,11 @@ Enabling this option will cause resource metrics to be served at `/apis/metrics.
rules:
resource:
cpu:
containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>)
containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, container!=""}[3m])) by (<<.GroupBy>>)
nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>)
resources:
overrides:
instance:
node:
resource: node
namespace:
resource: namespace
@@ -130,11 +130,11 @@ rules:
resource: pod
containerLabel: container
memory:
containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>)
containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>, container!=""}) by (<<.GroupBy>>)
nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>)
resources:
overrides:
instance:
node:
resource: node
namespace:
resource: namespace

View File

@@ -10,6 +10,7 @@ metadata:
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.replicas }}
strategy: {{ toYaml .Values.strategy | nindent 4 }}
selector:
matchLabels:
app: {{ template "k8s-prometheus-adapter.name" . }}
@@ -67,12 +68,14 @@ spec:
port: https
scheme: HTTPS
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: https
scheme: HTTPS
initialDelaySeconds: 30
timeoutSeconds: 5
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
@@ -107,6 +110,10 @@ spec:
affinity:
{{- toYaml .Values.affinity | nindent 8 }}
priorityClassName: {{ .Values.priorityClassName }}
{{- if .Values.podSecurityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- end }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
{{- if .Values.image.pullSecrets }}

View File

@@ -12,6 +12,9 @@ metadata:
spec:
{{- if .Values.hostNetwork.enabled }}
hostNetwork: true
hostPorts:
- min: {{ .Values.listenPort }}
max: {{ .Values.listenPort }}
{{- end }}
fsGroup:
rule: RunAsAny

View File

@@ -9,4 +9,8 @@ metadata:
heritage: {{ .Release.Service }}
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.serviceAccount.annotations }}
annotations:
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
{{- end }}
{{- end -}}

View File

@@ -3,7 +3,7 @@ affinity: {}
image:
repository: directxman12/k8s-prometheus-adapter-amd64
tag: v0.8.3
tag: v0.8.4
pullPolicy: IfNotPresent
logLevel: 4
@@ -25,6 +25,11 @@ prometheus:
replicas: 1
# k8s 1.21 needs fsGroup to be set for non root deployments
# ref: https://github.com/kubernetes/kubernetes/issues/70679
podSecurityContext:
fsGroup: 10001
rbac:
# Specifies whether RBAC resources should be created
create: true
@@ -39,6 +44,11 @@ serviceAccount:
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
# ServiceAccount annotations.
# Use case: AWS EKS IAM roles for service accounts
# ref: https://docs.aws.amazon.com/eks/latest/userguide/specify-service-account-role.html
annotations: {}
# Custom DNS configuration to be added to prometheus-adapter pods
dnsConfig: {}
# nameservers:
@@ -81,11 +91,11 @@ rules:
# metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)
resource: {}
# cpu:
# containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>)
# containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, container!=""}[3m])) by (<<.GroupBy>>)
# nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>)
# resources:
# overrides:
# instance:
# node:
# resource: node
# namespace:
# resource: namespace
@@ -93,11 +103,11 @@ rules:
# resource: pod
# containerLabel: container
# memory:
# containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>)
# containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>, container!=""}) by (<<.GroupBy>>)
# nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>)
# resources:
# overrides:
# instance:
# node:
# resource: node
# namespace:
# resource: namespace
@@ -163,6 +173,13 @@ hostNetwork:
# When hostNetwork is enabled, you probably want to set this to ClusterFirstWithHostNet
# dnsPolicy: ClusterFirstWithHostNet
# Deployment strategy type
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 25%
maxSurge: 25%
podDisruptionBudget:
# Specifies if PodDisruptionBudget should be enabled
# When enabled, minAvailable or maxUnavailable should also be defined.

View File

@@ -75,7 +75,7 @@ charts:
dest: do-bootstrap
repo_name: do-k8s-token-rotate
- name: prometheus-adapter
version: 2.12.1
version: 2.15.2
repo_name: prometheus-community
- name: digital-mobius
version: 0.1.4

View File

@@ -539,19 +539,19 @@ pub fn aws_helm_charts(
// resources limits
ChartSetValue {
key: "resources.limits.cpu".to_string(),
value: "100m".to_string(),
value: "200m".to_string(),
},
ChartSetValue {
key: "resources.requests.cpu".to_string(),
value: "100m".to_string(),
value: "200m".to_string(),
},
ChartSetValue {
key: "resources.limits.memory".to_string(),
value: "128Mi".to_string(),
value: "256Mi".to_string(),
},
ChartSetValue {
key: "resources.requests.memory".to_string(),
value: "128Mi".to_string(),
value: "256Mi".to_string(),
},
],
..Default::default()

View File

@@ -305,19 +305,19 @@ pub fn scw_helm_charts(
// Limits kube-state-metrics
ChartSetValue {
key: "kube-state-metrics.resources.limits.cpu".to_string(),
value: "100m".to_string(),
value: "200m".to_string(),
},
ChartSetValue {
key: "kube-state-metrics.resources.requests.cpu".to_string(),
value: "20m".to_string(),
value: "200m".to_string(),
},
ChartSetValue {
key: "kube-state-metrics.resources.limits.memory".to_string(),
value: "128Mi".to_string(),
value: "256Mi".to_string(),
},
ChartSetValue {
key: "kube-state-metrics.resources.requests.memory".to_string(),
value: "128Mi".to_string(),
value: "256Mi".to_string(),
},
// Limits prometheus-node-exporter
ChartSetValue {