UNCLASSIFIED

Commit 7b0d758e authored by bhearn's avatar bhearn
Browse files

Metrics testing

parent 042ad009
...@@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ...@@ -4,6 +4,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
--- ---
## [1.13.0-bb.1]
### Changed
- updated Service Monitor and added Pod Monitor for scraping metrics from Anchore components
- updated chart templates to automatically enable metrics for the Anchore Enterprise feeds service (until patched upstream)
## [1.13.0-bb.0] ## [1.13.0-bb.0]
### Changed ### Changed
- Bumped appVersion and Anchore Engine image tag to 0.10.0 - Bumped appVersion and Anchore Engine image tag to 0.10.0
......
apiVersion: v2 apiVersion: v2
name: anchore-engine name: anchore-engine
version: 1.13.0-bb.0 version: 1.13.0-bb.1
appVersion: 0.10.0 appVersion: 0.10.0
description: Anchore container analysis and policy evaluation engine service description: Anchore container analysis and policy evaluation engine service
keywords: keywords:
......
...@@ -4,7 +4,7 @@ kind: ServiceMonitor ...@@ -4,7 +4,7 @@ kind: ServiceMonitor
metadata: metadata:
labels: labels:
prometheus: k8s prometheus: k8s
name: anchore-metrics name: anchore-service-monitor
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
spec: spec:
selector: selector:
...@@ -22,7 +22,16 @@ spec: ...@@ -22,7 +22,16 @@ spec:
port: anchore-external-api port: anchore-external-api
scheme: http scheme: http
#jobLabel: anchore-metrics-external-api #jobLabel: anchore-metrics-external-api
- interval: 30s
path: /metrics
params:
format:
- prometheus
port: anchore-rbac-manager
scheme: http
#jobLabel: anchore-metrics-rbac-manager
- interval: 30s - interval: 30s
path: /metrics path: /metrics
params: params:
...@@ -49,4 +58,37 @@ spec: ...@@ -49,4 +58,37 @@ spec:
port: anchore-simplequeue-api port: anchore-simplequeue-api
scheme: http scheme: http
#jobLabel: anchore-metrics-simplequeue-api #jobLabel: anchore-metrics-simplequeue-api
{{- end }}
- interval: 30s
path: /metrics
params:
format:
- prometheus
port: feeds-api
scheme: http
#jobLabel: anchore-metrics-feeds-api
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
labels:
prometheus: k8s
name: anchore-pod-monitor
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
app: {{ template "anchore-engine.fullname" . }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
podMetricsEndpoints:
- interval: 30s
path: /metrics
params:
format:
- prometheus
port: analyzer-api
scheme: http
#jobLabel: anchore-metrics-analyzer-api
{{- end }}
\ No newline at end of file
...@@ -30,6 +30,7 @@ data: ...@@ -30,6 +30,7 @@ data:
license_file: /home/anchore/license.yaml license_file: /home/anchore/license.yaml
metrics: metrics:
enabled: {{ .Values.monitoring.enabled }} enabled: {{ .Values.monitoring.enabled }}
auth_disabled: {{ .Values.monitoring.enabled }}
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value # Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs. # Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
......
...@@ -113,6 +113,10 @@ spec: ...@@ -113,6 +113,10 @@ spec:
{{- with .Values.anchoreEnterpriseFeeds.extraEnv }} {{- with .Values.anchoreEnterpriseFeeds.extraEnv }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
- name: ANCHORE_ENABLE_METRICS
value: {{ .Values.monitoring.enabled | quote }}
- name: ANCHORE_DISABLE_METRICS_AUTH
value: {{ .Values.monitoring.enabled | quote }}
- name: ANCHORE_POD_NAME - name: ANCHORE_POD_NAME
valueFrom: valueFrom:
fieldRef: fieldRef:
......
...@@ -180,11 +180,21 @@ Do the same in `chart/templates/enterprise_configmap.yaml`: ...@@ -180,11 +180,21 @@ Do the same in `chart/templates/enterprise_configmap.yaml`:
auth_disabled: {{ .Values.monitoring.enabled }} auth_disabled: {{ .Values.monitoring.enabled }}
``` ```
In `chart/templates/enterprise_feeds_configmap.yaml` also modify the metrics lines: Do the same in `chart/templates/enterprise_feeds_configmap.yaml`:
```yaml ```yaml
metrics: metrics:
enabled: {{ .Values.monitoring.enabled }} enabled: {{ .Values.monitoring.enabled }}
auth_disabled: {{ .Values.monitoring.enabled }}
```
And set required environment variables in `chart/templates/enterprise_feed_deployment.yaml`:
```yaml
- name: ANCHORE_ENABLE_METRICS
value: {{ .Values.monitoring.enabled | quote }}
- name: ANCHORE_DISABLE_METRICS_AUTH
value: {{ .Values.monitoring.enabled | quote }}
``` ```
To resolve a race condition in Big Bang CI pipelines, an additional sleep argument was added in `chart/templates/engine_upgrade_job.yaml`, `enterprise_upgrade_job.yaml`, and `enterprise_feeds_upgrade_jobs.yaml`: To resolve a race condition in Big Bang CI pipelines, an additional sleep argument was added in `chart/templates/engine_upgrade_job.yaml`, `enterprise_upgrade_job.yaml`, and `enterprise_feeds_upgrade_jobs.yaml`:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment