diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f793f2d2c..cf53b086c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,9 @@ - Bump CoreDNS version to 1.8.0 (PR[#3354](https://github.com/scality/metalk8s/pull/3354)) -- [#3279](https://github.com/scality/metalk8s/issues/3279) - Bump - prometheus-adapter chart version from 2.10.1 to 2.12.2. - k8s-prometheus-adapter-amd64 image has been bump accordingly from v0.8.2 - to v0.8.4 (PR[#3362](https://github.com/scality/metalk8s/pull/3362)) +- Bump prometheus-adapter chart version to 2.14.2. + k8s-prometheus-adapter-amd64 image has been bump accordingly to v0.8.4 + (PR[#3429](https://github.com/scality/metalk8s/pull/3429)) - [#3279](https://github.com/scality/metalk8s/issues/3279) - Bump fluent-bit chart version from 2.0.1 to 2.2.0 diff --git a/charts/prometheus-adapter/Chart.yaml b/charts/prometheus-adapter/Chart.yaml index cf3fb5c280..60fbd31ae1 100644 --- a/charts/prometheus-adapter/Chart.yaml +++ b/charts/prometheus-adapter/Chart.yaml @@ -17,4 +17,4 @@ name: prometheus-adapter sources: - https://github.com/kubernetes/charts - https://github.com/DirectXMan12/k8s-prometheus-adapter -version: 2.12.2 +version: 2.14.2 diff --git a/charts/prometheus-adapter/README.md b/charts/prometheus-adapter/README.md index 1fe1fad661..67970458b1 100644 --- a/charts/prometheus-adapter/README.md +++ b/charts/prometheus-adapter/README.md @@ -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 diff --git a/charts/prometheus-adapter/templates/deployment.yaml b/charts/prometheus-adapter/templates/deployment.yaml index bfa02bc869..75060d9433 100644 --- a/charts/prometheus-adapter/templates/deployment.yaml +++ b/charts/prometheus-adapter/templates/deployment.yaml @@ -67,12 +67,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 }} diff --git a/charts/prometheus-adapter/templates/psp.yaml b/charts/prometheus-adapter/templates/psp.yaml index a88c9c2f2a..c5ae106074 100644 --- a/charts/prometheus-adapter/templates/psp.yaml +++ b/charts/prometheus-adapter/templates/psp.yaml @@ -12,6 +12,9 @@ metadata: spec: {{- if .Values.hostNetwork.enabled }} hostNetwork: true + hostPorts: + - min: {{ .Values.listenPort }} + max: {{ .Values.listenPort }} {{- end }} fsGroup: rule: RunAsAny diff --git a/charts/prometheus-adapter/templates/serviceaccount.yaml b/charts/prometheus-adapter/templates/serviceaccount.yaml index 42ef0267eb..c3050f0528 100644 --- a/charts/prometheus-adapter/templates/serviceaccount.yaml +++ b/charts/prometheus-adapter/templates/serviceaccount.yaml @@ -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 -}} diff --git a/charts/prometheus-adapter/values.yaml b/charts/prometheus-adapter/values.yaml index f85383871a..7d42f5c5de 100644 --- a/charts/prometheus-adapter/values.yaml +++ b/charts/prometheus-adapter/values.yaml @@ -39,6 +39,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 +86,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 +98,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 diff --git a/salt/metalk8s/addons/prometheus-adapter/deployed/chart.sls b/salt/metalk8s/addons/prometheus-adapter/deployed/chart.sls index a215594c0f..2d225e987b 100644 --- a/salt/metalk8s/addons/prometheus-adapter/deployed/chart.sls +++ b/salt/metalk8s/addons/prometheus-adapter/deployed/chart.sls @@ -14,7 +14,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter @@ -93,8 +93,10 @@ data: resourceRules: cpu: containerLabel: container_name - containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) by (<<.GroupBy>>) - nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) by (<<.GroupBy>>) + containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>}[3m])) + by (<<.GroupBy>>) + nodeQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>, id='/'}[3m])) + by (<<.GroupBy>>) resources: overrides: namespace: @@ -106,7 +108,8 @@ data: memory: containerLabel: container_name containerQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>}) by (<<.GroupBy>>) - nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by (<<.GroupBy>>) + nodeQuery: sum(container_memory_working_set_bytes{<<.LabelMatchers>>,id='/'}) by + (<<.GroupBy>>) resources: overrides: namespace: @@ -123,7 +126,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter @@ -137,7 +140,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-resource-reader @@ -163,7 +166,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-server-resources @@ -184,7 +187,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-metrics @@ -209,7 +212,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-system-auth-delegator @@ -231,7 +234,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-resource-reader @@ -253,7 +256,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-hpa-controller @@ -275,7 +278,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-hpa-controller-metrics @@ -297,7 +300,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter-auth-reader @@ -320,7 +323,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter @@ -343,7 +346,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter @@ -357,13 +360,13 @@ spec: template: metadata: annotations: - checksum/config: 78db41895b530d031fc6986d06be80739327f0d2777cb46288a7923ea5211e63 + checksum/config: 3e715c75546058341566d8edc8b37751d58f8e6a4de8901e830278b5e535050a labels: app: prometheus-adapter app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: prometheus-adapter @@ -388,6 +391,7 @@ spec: port: https scheme: HTTPS initialDelaySeconds: 30 + timeoutSeconds: 5 name: prometheus-adapter ports: - containerPort: 6443 @@ -398,6 +402,7 @@ spec: port: https scheme: HTTPS initialDelaySeconds: 30 + timeoutSeconds: 5 securityContext: allowPrivilegeEscalation: false capabilities: @@ -438,7 +443,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: v1beta1.custom.metrics.k8s.io @@ -461,7 +466,7 @@ metadata: app.kubernetes.io/managed-by: salt app.kubernetes.io/name: prometheus-adapter app.kubernetes.io/part-of: metalk8s - chart: prometheus-adapter-2.12.2 + chart: prometheus-adapter-2.14.2 heritage: metalk8s release: prometheus-adapter name: v1beta1.metrics.k8s.io