Skip to content
Snippets Groups Projects
Commit a13ba2b1 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-2615 remove scrapeMetricsDisabled as metrics should be default enabled

parent 5b60a3d4
No related branches found
No related tags found
No related merge requests found
...@@ -23,12 +23,6 @@ questions: ...@@ -23,12 +23,6 @@ questions:
group: "Container" group: "Container"
type: string type: string
label: "Override Spring boot profile" label: "Override Spring boot profile"
- variable: scrapeMetricsDisabled
group: "Other"
type: boolean
default: false
label: "Disable Scrape Metrics"
- variable: kop.bezeichner - variable: kop.bezeichner
group: "KOP" group: "KOP"
label: "Bezeichner" label: "Bezeichner"
......
...@@ -64,11 +64,9 @@ spec: ...@@ -64,11 +64,9 @@ spec:
- containerPort: 8080 - containerPort: 8080
name: 8080tcp1 name: 8080tcp1
protocol: TCP protocol: TCP
{{- if not .Values.scrapeMetricsDisabled }}
- containerPort: 8081 - containerPort: 8081
name: metrics name: metrics
protocol: TCP protocol: TCP
{{- end }}
readinessProbe: readinessProbe:
failureThreshold: 3 failureThreshold: 3
httpGet: httpGet:
......
...@@ -12,11 +12,9 @@ spec: ...@@ -12,11 +12,9 @@ spec:
port: 8080 port: 8080
protocol: TCP protocol: TCP
targetPort: 8080 targetPort: 8080
{{- if not .Values.scrapeMetricsDisabled }}
- name: metrics - name: metrics
port: 8081 port: 8081
protocol: TCP protocol: TCP
{{- end }}
type: ClusterIP type: ClusterIP
selector: selector:
{{- include "app.matchLabels" . | indent 4 }} {{- include "app.matchLabels" . | indent 4 }}
......
{{- if not .Values.scrapeMetricsDisabled }}
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
...@@ -18,4 +17,3 @@ spec: ...@@ -18,4 +17,3 @@ spec:
matchLabels: matchLabels:
{{- include "app.matchLabels" . | indent 6 }} {{- include "app.matchLabels" . | indent 6 }}
component: afm-adapter-service component: afm-adapter-service
\ No newline at end of file
{{- end }}
\ No newline at end of file
...@@ -9,7 +9,6 @@ tests: ...@@ -9,7 +9,6 @@ tests:
set: set:
kop.environment: dev kop.environment: dev
kop.bezeichner: helm kop.bezeichner: helm
scrapeMetricsDisabled: false
asserts: asserts:
- isKind: - isKind:
of: Ingress of: Ingress
......
...@@ -10,7 +10,6 @@ tests: ...@@ -10,7 +10,6 @@ tests:
- it: check default labels - it: check default labels
set: set:
kop.environment: dev kop.environment: dev
scrapeMetricsDisabled: false
asserts: asserts:
- equal: - equal:
path: metadata.labels.[app.kubernetes.io/instance] path: metadata.labels.[app.kubernetes.io/instance]
......
suite: test deployment
release:
name: afm-adapter
namespace: sh-helm-test
templates:
- templates/deployment.yaml
tests:
- it: should set the metrics port by default
set:
kop.environment: test
scrapeMetricsDisabled: false
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].ports
content:
name: metrics
containerPort: 8081
protocol: TCP
- it: should deactivate the metrics port at will
set:
kop.environment: test
scrapeMetricsDisabled: true
asserts:
- isKind:
of: Deployment
- notContains:
path: spec.template.spec.containers[0].ports
content:
name: metrics
containerPort: 8081
protocol: TCP
\ No newline at end of file
...@@ -6,8 +6,6 @@ templates: ...@@ -6,8 +6,6 @@ templates:
- templates/service_monitor.yaml - templates/service_monitor.yaml
tests: tests:
- it: should have the label component with value afm-adapter-service-monitor attached - it: should have the label component with value afm-adapter-service-monitor attached
set:
scrapeMetricsDisabled: false
asserts: asserts:
- isKind: - isKind:
of: ServiceMonitor of: ServiceMonitor
...@@ -16,7 +14,6 @@ tests: ...@@ -16,7 +14,6 @@ tests:
value: afm-adapter-service-monitor value: afm-adapter-service-monitor
- it: should have the metrics endpoint configured by default - it: should have the metrics endpoint configured by default
set: set:
scrapeMetricsDisabled: false
env.springProfiles: oc,stage env.springProfiles: oc,stage
asserts: asserts:
- isKind: - isKind:
...@@ -27,8 +24,6 @@ tests: ...@@ -27,8 +24,6 @@ tests:
port: metrics port: metrics
path: /actuator/prometheus path: /actuator/prometheus
- it: should be able to enable the endpoint - it: should be able to enable the endpoint
set:
scrapeMetricsDisabled: false
asserts: asserts:
- isKind: - isKind:
of: ServiceMonitor of: ServiceMonitor
...@@ -38,22 +33,16 @@ tests: ...@@ -38,22 +33,16 @@ tests:
port: metrics port: metrics
path: /actuator/prometheus path: /actuator/prometheus
- it: namespace selector should contain the namespace - it: namespace selector should contain the namespace
set:
scrapeMetricsDisabled: false
asserts: asserts:
- contains: - contains:
path: spec.namespaceSelector.matchNames path: spec.namespaceSelector.matchNames
content: sh-helm-test content: sh-helm-test
- it: selector should contain the component label with the value afm-adapter-service - it: selector should contain the component label with the value afm-adapter-service
set:
scrapeMetricsDisabled: false
asserts: asserts:
- equal: - equal:
path: spec.selector.matchLabels.[component] path: spec.selector.matchLabels.[component]
value: afm-adapter-service value: afm-adapter-service
- it: selector should contain helm recommended labels name and namespace - it: selector should contain helm recommended labels name and namespace
set:
scrapeMetricsDisabled: false
asserts: asserts:
- equal: - equal:
path: spec.selector.matchLabels.[app.kubernetes.io/name] path: spec.selector.matchLabels.[app.kubernetes.io/name]
......
...@@ -29,8 +29,6 @@ tests: ...@@ -29,8 +29,6 @@ tests:
count: 1 count: 1
any: true any: true
- it: ports should contain the metrics port - it: ports should contain the metrics port
set:
scrapeMetricsDisabled: false
asserts: asserts:
- contains: - contains:
path: spec.ports path: spec.ports
...@@ -40,18 +38,6 @@ tests: ...@@ -40,18 +38,6 @@ tests:
protocol: TCP protocol: TCP
count: 1 count: 1
any: true any: true
- it: ports should not contain the metrics port when deactivated
set:
scrapeMetricsDisabled: true
asserts:
- notContains:
path: spec.ports
content:
name: metrics
port: 8081
protocol: TCP
count: 1
any: true
- it: selector should contain the component label with the value afm-adapter - it: selector should contain the component label with the value afm-adapter
asserts: asserts:
- equal: - equal:
......
scrapeMetricsDisabled: true # [default: false]. Flag to disable actuator prometheus route scraping.
image: image:
name: intelliform-adapter # [default: intelliform-adapter] name: intelliform-adapter # [default: intelliform-adapter]
# tag: latest # [default: latest] # tag: latest # [default: latest]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment