Merge "[AAI] Service monitor for scraping prometheus metrics"
authorAndreas Geissler <andreas-geissler@telekom.de>
Wed, 23 Nov 2022 20:41:55 +0000 (20:41 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 23 Nov 2022 20:41:55 +0000 (20:41 +0000)
1  2 
kubernetes/aai/components/aai-graphadmin/values.yaml
kubernetes/aai/components/aai-traversal/values.yaml
kubernetes/aai/templates/service.yaml
kubernetes/aai/values.yaml

@@@ -96,7 -96,7 +96,7 @@@ global: # global default
  
      # Specifies which clients should always default to realtime graph connection
      realtime:
 -      clients: SDNC,MSO,SO,robot-ete
 +      clients: SDNC,-1|MSO,-1|SO,-1|robot-ete,-1
  
  #################################################################
  # Certificate configuration
@@@ -240,6 -240,8 +240,8 @@@ service
    internalPort: 8449
    portName2: tcp-5005
    internalPort2: 5005
+   portName3: aai-graphadmin-8448
+   internalPort3: 8448
    terminationGracePeriodSeconds: 120
  
  ingress:
@@@ -296,6 -298,24 +298,24 @@@ resources
        memory: 2Gi
    unlimited: {}
  
+ metrics:
+   serviceMonitor:
+     enabled: false
+     targetPort: 8448
+     path: /prometheus
+     basicAuth:
+       enabled: false
+     selector:
+       app: '{{ include "common.name" . }}'
+       chart: '{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}'
+       release: '{{ include "common.release" . }}'
+       heritage: '{{ .Release.Service }}'
+     relabelings: []
+     metricRelabelings: []
  # Not fully used for now
  securityContext:
    user_id: *user_id
@@@ -231,12 -231,6 +231,12 @@@ persistence
  # default number of instances
  replicaCount: 1
  
 +minReadySeconds: 10
 +updateStrategy:
 +  type: RollingUpdate
 +  maxUnavailable: 0
 +  maxSurge: 1
 +
  nodeSelector: {}
  
  affinity: {}
@@@ -259,7 -253,10 +259,10 @@@ service
    internalPort: 8446
    portName2: tcp-5005
    internalPort2: 5005
+   portName3: aai-traversal-8448
+   internalPort3: 8448
    terminationGracePeriodSeconds: 120
+   sessionAffinity: None
  
  ingress:
    enabled: false
@@@ -295,6 -292,58 +298,58 @@@ resources
        memory: 4Gi
    unlimited: {}
  
+ metrics:
+   serviceMonitor:
+     enabled: false
+     targetPort: 8448
+     path: /prometheus
+     basicAuth:
+       enabled: false
+       externalSecretName: mysecretname
+       externalSecretUserKey: login
+       externalSecretPasswordKey: password
+     ## Namespace in which Prometheus is running
+     ##
+     # namespace: monitoring
+     ## Interval at which metrics should be scraped.
+     ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
+     ##
+     #interval: 30s
+     ## Timeout after which the scrape is ended
+     ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
+     ##
+     # scrapeTimeout: 10s
+     ## ServiceMonitor selector labels
+     ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
+     ##
+     selector:
+       app: '{{ include "common.name" . }}'
+       chart: '{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}'
+       release: '{{ include "common.release" . }}'
+       heritage: '{{ .Release.Service }}'
+     ## RelabelConfigs to apply to samples before scraping
+     ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
+     ## Value is evalued as a template
+     ##
+     relabelings: []
+     ## MetricRelabelConfigs to apply to samples before ingestion
+     ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
+     ## Value is evalued as a template
+     ##
+     metricRelabelings: []
+     #  - sourceLabels:
+     #      - "__name__"
+     #    targetLabel: "__name__"
+     #    action: replace
+     #    regex: '(.*)'
+     #    replacement: 'example_prefix_$1'
  #Pods Service Account
  serviceAccount:
    nameOverride: aai-traversal
@@@ -35,6 -35,8 +35,8 @@@ spec
    type: {{ .Values.service.type }}
    selector:
      app: {{ include "common.name" . }}
+   clusterIP: {{ .Values.service.aaiServiceClusterIp }}
+   sessionAffinity: {{ .Values.service.sessionAffinity }}
  ---
  apiVersion: v1
  kind: Service
@@@ -54,23 -56,4 +56,23 @@@ spec
    type: ClusterIP
    selector:
      app: {{ include "common.name" . }}
 -
 +---
 +apiVersion: v1
 +kind: Service
 +metadata:
 +  name: {{ include "common.servicename" . }}-metrics
 +  namespace: {{ include "common.namespace" . }}
 +  labels:
 +    app: {{ include "common.name" . }}-metrics
 +    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
 +    release: {{ include "common.release" . }}
 +    heritage: {{ .Release.Service }}
 +spec:
 +  ports:
 +    - port: {{ .Values.metricsService.externalPort }}
 +      targetPort: {{ .Values.metricsService.internalPort }}
 +      name: {{ .Values.metricsService.portName }}
 +  type: {{ .Values.metricsService.type }}
 +  selector:
 +    app: {{ include "common.name" . }}
 +  clusterIP: None
@@@ -328,7 -328,7 +328,7 @@@ certInitializer
  
  # application image
  dockerhubRepository: registry.hub.docker.com
 -image: aaionap/haproxy:1.4.2
 +image: onap/aai-haproxy:1.9.5
  pullPolicy: Always
  
  flavor: small
@@@ -345,27 -345,15 +345,27 @@@ config
  # default number of instances
  replicaCount: 1
  
 +updateStrategy:
 +  type: RollingUpdate
 +  maxUnavailable: 0
 +  maxSurge: 1
 +
  nodeSelector: {}
  
  affinity: {}
  
  # HAProxy configuration to block HTTP requests to AAI based on configurable URL patterns
  haproxy:
 +  initContainers:
 +    resources:
 +      memory: 100Mi
 +      cpu: 50m
    requestBlocking:
      enabled: false
      customConfigs: []
 +  replicas:
 +    aaiResources: 1
 +    aaiTraversal: 1
  
  # probe configuration parameters
  liveness:
@@@ -404,31 -392,9 +404,33 @@@ service
    externalPlainPort: 80
    internalPlainPort: 8080
    nodeport: 33
+   aaiServiceClusterIp:
+   sessionAffinity: None
  
 +metricsService:
 +  type: ClusterIP
 +  portName: prometheus
 +  externalPort: 8448
 +  internalPort: 8448
 +
 +metrics:
 +  serviceMonitor:
 +    enabled: false
 +    targetPort: 8448
 +    path: /metrics
 +    basicAuth:
 +      enabled: false
 +
 +    selector:
 +      app: '{{ include "common.name" . }}-metrics'
 +      chart: '{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}'
 +      release: '{{ include "common.release" . }}'
 +      heritage: '{{ .Release.Service }}'
 +
 +    relabelings: []
 +
 +    metricRelabelings: []
 +
  ingress:
    enabled: false
    service: