diff --git a/questions.yml b/questions.yml index be56b06d7456dc3a0675be0a088edd0e8f959712..b1c83e843a5a29d90ba4b8e786e0323c000b9feb 100644 --- a/questions.yml +++ b/questions.yml @@ -23,12 +23,6 @@ questions: group: "Container" type: string label: "Override Spring boot profile" - - variable: scrapeMetricsDisabled - group: "Other" - type: boolean - default: false - label: "Disable Scrape Metrics" - - variable: kop.bezeichner group: "KOP" label: "Bezeichner" diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 65ec5ce270f2aa7082dcfe66e31419405aa75c94..80cd552570fbd7aecc7ff1935a5a931779baa4da 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -64,11 +64,9 @@ spec: - containerPort: 8080 name: 8080tcp1 protocol: TCP - {{- if not .Values.scrapeMetricsDisabled }} - containerPort: 8081 name: metrics protocol: TCP - {{- end }} readinessProbe: failureThreshold: 3 httpGet: diff --git a/templates/service.yaml b/templates/service.yaml index 29a3e4583044cafe9fd2c785cce8583361a7b8ff..af6bdfe9779e1fa26ffd0ed103ea21414a49becb 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -12,11 +12,9 @@ spec: port: 8080 protocol: TCP targetPort: 8080 - {{- if not .Values.scrapeMetricsDisabled }} - name: metrics port: 8081 protocol: TCP - {{- end }} type: ClusterIP selector: {{- include "app.matchLabels" . | indent 4 }} diff --git a/templates/service_monitor.yaml b/templates/service_monitor.yaml index 05fb7b00f7d1a4545e363021f84f37da1a7f28ca..12786439d5fe5ab1cc46c76f8025c50c35bf7c73 100644 --- a/templates/service_monitor.yaml +++ b/templates/service_monitor.yaml @@ -1,4 +1,3 @@ -{{- if not .Values.scrapeMetricsDisabled }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: @@ -17,5 +16,4 @@ spec: selector: matchLabels: {{- include "app.matchLabels" . | indent 6 }} - component: afm-adapter-service -{{- end }} \ No newline at end of file + component: afm-adapter-service \ No newline at end of file diff --git a/unit-tests/deployment_defaults_annotaion_test.yaml b/unit-tests/deployment_defaults_annotaion_test.yaml index b587c1e7168d395e877b726d6b4ccaefb6af67c4..d1e8a523288952558f02fabd0ec496bdc7c904d1 100644 --- a/unit-tests/deployment_defaults_annotaion_test.yaml +++ b/unit-tests/deployment_defaults_annotaion_test.yaml @@ -9,7 +9,6 @@ tests: set: kop.environment: dev kop.bezeichner: helm - scrapeMetricsDisabled: false asserts: - isKind: of: Ingress diff --git a/unit-tests/deployment_defaults_labels_test.yaml b/unit-tests/deployment_defaults_labels_test.yaml index bbdd6ba114018e2d88cbd6fe92c688e033659831..7698bed1b7f790719c1d805ade657760a22cdcdc 100644 --- a/unit-tests/deployment_defaults_labels_test.yaml +++ b/unit-tests/deployment_defaults_labels_test.yaml @@ -10,7 +10,6 @@ tests: - it: check default labels set: kop.environment: dev - scrapeMetricsDisabled: false asserts: - equal: path: metadata.labels.[app.kubernetes.io/instance] diff --git a/unit-tests/deployment_scrapeMetrics_test.yaml b/unit-tests/deployment_scrapeMetrics_test.yaml deleted file mode 100644 index fd6f0f935c37318e25fa2355f6b12f5597dfbb9b..0000000000000000000000000000000000000000 --- a/unit-tests/deployment_scrapeMetrics_test.yaml +++ /dev/null @@ -1,33 +0,0 @@ -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 diff --git a/unit-tests/service_monitor_test.yaml b/unit-tests/service_monitor_test.yaml index cddc576ce117787ac98528182ea62b34dfe7124b..88c4a5d3cd4e65f5ee818a040a11ab80e12f9205 100644 --- a/unit-tests/service_monitor_test.yaml +++ b/unit-tests/service_monitor_test.yaml @@ -6,8 +6,6 @@ templates: - templates/service_monitor.yaml tests: - it: should have the label component with value afm-adapter-service-monitor attached - set: - scrapeMetricsDisabled: false asserts: - isKind: of: ServiceMonitor @@ -16,7 +14,6 @@ tests: value: afm-adapter-service-monitor - it: should have the metrics endpoint configured by default set: - scrapeMetricsDisabled: false env.springProfiles: oc,stage asserts: - isKind: @@ -27,8 +24,6 @@ tests: port: metrics path: /actuator/prometheus - it: should be able to enable the endpoint - set: - scrapeMetricsDisabled: false asserts: - isKind: of: ServiceMonitor @@ -38,22 +33,16 @@ tests: port: metrics path: /actuator/prometheus - it: namespace selector should contain the namespace - set: - scrapeMetricsDisabled: false asserts: - contains: path: spec.namespaceSelector.matchNames content: sh-helm-test - it: selector should contain the component label with the value afm-adapter-service - set: - scrapeMetricsDisabled: false asserts: - equal: path: spec.selector.matchLabels.[component] value: afm-adapter-service - it: selector should contain helm recommended labels name and namespace - set: - scrapeMetricsDisabled: false asserts: - equal: path: spec.selector.matchLabels.[app.kubernetes.io/name] diff --git a/unit-tests/service_test.yaml b/unit-tests/service_test.yaml index 26c9f0d9760c227fd55904d9cb5b518617721b0e..3c7f9b0307235fa9eab1c3c21d44c59bc9fbe263 100644 --- a/unit-tests/service_test.yaml +++ b/unit-tests/service_test.yaml @@ -29,8 +29,6 @@ tests: count: 1 any: true - it: ports should contain the metrics port - set: - scrapeMetricsDisabled: false asserts: - contains: path: spec.ports @@ -39,18 +37,6 @@ tests: port: 8081 protocol: TCP count: 1 - 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 asserts: diff --git a/values.yaml b/values.yaml index 92e07b979ae7d3d147c4e9eb9c6dd08ac39b0ae3..a509af793575142b33540fb19c1c57e7e1b7a4fe 100644 --- a/values.yaml +++ b/values.yaml @@ -1,5 +1,3 @@ -scrapeMetricsDisabled: true # [default: false]. Flag to disable actuator prometheus route scraping. - image: name: intelliform-adapter # [default: intelliform-adapter] # tag: latest # [default: latest]