Add service monitor

Merge request reports

Loading
+71 −0
Changes for charts/hypo/templates/service-monitor/deployment.yaml: 71 added lines, 0 removed lines.
Original line number Diff line number Diff line
{{ $serviceMonitor := index .Values "service-monitor" }}
{{- if $serviceMonitor.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template "hypo.service-monitor.fullname" . }}
  namespace: {{ .Release.Namespace  }}
  labels:
{{ include "hypo.labels" . | nindent 4 }}
    app: {{ template "hypo.service-monitor.fullname" . }}
spec:
  replicas: {{ $serviceMonitor.replicaCount }}
  selector:
    matchLabels:
{{ include "hypo.selectorLabels" . | nindent 6 }}
      app: {{ template "hypo.service-monitor.fullname" . }}
  template:
    metadata:
      {{- with $serviceMonitor.podAnnotations }}
      annotations:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      labels:
        app: {{ template "hypo.service-monitor.fullname" . }}
        {{- include "hypo.labels" . | nindent 8 }}
	{{- with $serviceMonitor.podLabels }}
        {{- toYaml . | nindent 8 }}
        {{- end }}
    spec:
      initContainers:
        - name: wait-for-kafka
          image: busybox:latest
          imagePullPolicy: IfNotPresent
          securityContext:
            capabilities:
              add:
              - NET_ADMIN
          command:
            - sh
            - -c
            - |
              echo "Attempting to set MTU..."
              ip link set dev eth0 mtu 1000
              echo "Current MTU is: $(cat /sys/class/net/eth0/mtu)"
              until nc -z -w 1 {{ template "hypo.kafka.url" . }} {{ .Values.kafka.service.ports.client }}; do
                echo "Sleeping for Kafka"
                sleep 1
              done
              echo "ready!"
      {{- with $serviceMonitor.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      containers:
        - name: {{ $serviceMonitor.name }}
          image: "{{ $serviceMonitor.image.repository }}:{{ $serviceMonitor.image.tag }}"
          imagePullPolicy: {{ $serviceMonitor.image.pullPolicy }}
          env:
            - name: KAFKA_BROKERS
              value: {{ template "hypo.kafka.url" . }}:{{ .Values.kafka.service.ports.client }}
          resources:
            {{- toYaml $serviceMonitor.resources | nindent 12 }}
          {{- with $serviceMonitor.volumeMounts }}
          volumeMounts:
            {{- toYaml . | nindent 12 }}
          {{- end }}
      {{- with $serviceMonitor.volumes }}
      volumes:
        {{- toYaml . | nindent 8 }}
      {{- end }}
{{- end -}}      
+45 −0
Changes for charts/hypo/values.yaml: 45 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -515,6 +515,51 @@ fabric-api:

  tolerations: []

service-monitor:
  enabled: true
  name: service-monitor
  replicaCount: 1
  image:
    repository: 
      labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.core/service.monitor/service-monitor
    pullPolicy: Always
    tag: "latest"

  imagePullSecrets:
  - name: regcred
  nameOverride: ""
  fullnameOverride: ""

  podAnnotations: {}
  podLabels: {}

  podSecurityContext: {}

  containerPort: 8880

  # service:
  #   type: NodePort
  #   port: 8880
  #   nodePort: 30095

  securityContext: {}

  resources: {}
    # limits:
    #   cpu: 100m
    #   memory: 128Mi
    # requests:
    #   cpu: 100m
    #   memory: 128Mi

  volumes: []
  volumeMounts: []

  nodeSelector: {}

  tolerations: []


infinispan:
  enabled: true

+6 −1
Changes for scripts/get_tags.sh: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ PEERING_API_URL="https://labs.etsi.org/rep/api/v4/projects/468/registry/reposito
REGISTRY_API_URL="https://labs.etsi.org/rep/api/v4/projects/469/registry/repositories/3018/tags?page=1&per_page=500"
FABRIC_API_URL="https://labs.etsi.org/rep/api/v4/projects/467/registry/repositories/3011/tags?page=1&per_page=500"
PORTAL_URL="https://labs.etsi.org/rep/api/v4/projects/466/registry/repositories/3038/tags?page=1&per_page=500"
MONITOR_URL="https://labs.etsi.org/rep/api/v4/projects/480/registry/repositories/3119/tags?page=1&per_page=500"

# Get TMF_API version
TMF_API=$(curl --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" --url "$TMF_API_URL" | jq -r '.[].location' | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
@@ -56,6 +57,9 @@ FABRIC_API=$(curl --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" --url $FABRIC_API_URL
# Get Portal version
PORTAL=$(curl --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" --url $PORTAL_URL | jq -r '.[].location'  | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)

# Get Service Monitor version
MONITOR=$(curl --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" --url $MONITOR_URL | jq -r '.[].location'  | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)


# Write versions to build.env
echo "TMF_API=$TMF_API" > build.env
@@ -68,9 +72,10 @@ echo "PEERING_API=$PEERING_API" >> build.env
echo "REGISTRY_API=$REGISTRY_API" >> build.env
echo "FABRIC_API=$FABRIC_API" >> build.env
echo "PORTAL=$PORTAL" >> build.env
echo "MONITOR=$MONITOR" >> build.env
# Notify the user
echo "Version information written to build.env"

#Remember to then run: 
#source build.env
#python3 scripts/helm_update.py $PKG_MANAGER $OSS_CLIENT $SONATA $TMF_API $PORTAL_CART $TELEMETRY_CLIENT $PEERING_API $REGISTRY_API $FABRIC_API $PORTAL --file=./charts/hypo/values.yaml
#python3 scripts/helm_update.py $PKG_MANAGER $OSS_CLIENT $SONATA $TMF_API $PORTAL_CART $TELEMETRY_CLIENT $PEERING_API $REGISTRY_API $FABRIC_API $PORTAL $MONITOR --file=./charts/hypo/values.yaml
+1 −1
Changes for scripts/helm_update.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ def main():
    print("--------------------------------------")

    # Adding all of our microservices
    microservices = ["pkg-manager", "oss-client", "tmf-api", "sonata", "portal-cart", "telemetry-client", "peering-api", "registry-api", "fabric-api", "portal"]
    microservices = ["pkg-manager", "oss-client", "tmf-api", "sonata", "portal-cart", "telemetry-client", "peering-api", "registry-api", "fabric-api", "portal", "service-monitor"]

    tag_changed = False
    chart_updated = False  # Track if chart has been updated already
+1 −1
Changes for scripts/helm_update_etsi.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ def main():
    print("--------------------------------------")

    # Adding all of our microservices
    microservices = ["pkg-manager", "oss-client", "tmf-api", "sonata", "portal-cart", "telemetry-client", "peering-api", "registry-api", "fabric-api", "portal"]
    microservices = ["pkg-manager", "oss-client", "tmf-api", "sonata", "portal-cart", "telemetry-client", "peering-api", "registry-api", "fabric-api", "portal", "service-monitor"]

    tag_changed = False
    chart_updated = False  # Track if chart has been updated already
Loading
Loading