Loading .gitlab-ci.yml +5 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ variables: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.portal/cart/hypo-portal-jvm labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.portal/web/hypo-portal lint: stage: lint image: Loading Loading @@ -320,6 +321,8 @@ get_images: FABRIC_API=$(curl --header "PRIVATE-TOKEN: $GROUP_ACCESS_TOKEN" --url $FABRIC_API_URL | jq -r '.[].location' | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) - | PORTAL=$(curl --header "PRIVATE-TOKEN: $GROUP_ACCESS_TOKEN" --url $PORTAL_URL | jq -r '.[].location' | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) - | MONITOR=$(curl --header "PRIVATE-TOKEN: $GROUP_ACCESS_TOKEN" --url $MONITOR_URL | jq -r '.[].location' | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) - echo "TMF_API=$TMF_API" > build.env - echo "SONATA=$SONATA" >> build.env - echo "PKG_MANAGER=$PKG_MANAGER" >> build.env Loading @@ -330,6 +333,7 @@ get_images: - echo "REGISTRY_API=$REGISTRY_API" >> build.env - echo "FABRIC_API=$FABRIC_API" >> build.env - echo "PORTAL=$PORTAL" >> build.env - echo "MONITOR=$MONITOR" >> build.env artifacts: paths: - build.env Loading Loading @@ -363,7 +367,7 @@ update_values: - python3 -m pip install ruamel.yaml script: - pwd - python3 scripts/helm_update_etsi.py $PKG_MANAGER $OSS_CLIENT $SONATA $TMF_API $PORTAL_CART $TELEMETRY_CLIENT $PEERING_API $REGISTRY_API $FABRIC_API $PORTAL --bump-chart --file=./charts/hypo/values.yaml - python3 scripts/helm_update_etsi.py $PKG_MANAGER $OSS_CLIENT $SONATA $TMF_API $PORTAL_CART $TELEMETRY_CLIENT $PEERING_API $REGISTRY_API $FABRIC_API $PORTAL $MONITOR --bump-chart --file=./charts/hypo/values.yaml - git add . - git config --global user.email $GITLAB_USER_EMAIL - git config --global user.name $GITLAB_USER_NAME Loading charts/hypo/templates/service-monitor/deployment.yaml 0 → 100644 +71 −0 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 -}} charts/hypo/values.yaml +45 −0 Original line number Diff line number Diff line Loading @@ -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/lcm pullPolicy: Always tag: "1.0.0" 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 Loading scripts/get_tags.sh +6 −1 Original line number Diff line number Diff line Loading @@ -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/3036/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) Loading Loading @@ -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 Loading @@ -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 scripts/helm_update.py +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
.gitlab-ci.yml +5 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ variables: labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.portal/cart/hypo-portal-jvm labs.etsi.org:5050/osl/hypo/code/org.etsi.osl.hypo.portal/web/hypo-portal lint: stage: lint image: Loading Loading @@ -320,6 +321,8 @@ get_images: FABRIC_API=$(curl --header "PRIVATE-TOKEN: $GROUP_ACCESS_TOKEN" --url $FABRIC_API_URL | jq -r '.[].location' | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) - | PORTAL=$(curl --header "PRIVATE-TOKEN: $GROUP_ACCESS_TOKEN" --url $PORTAL_URL | jq -r '.[].location' | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) - | MONITOR=$(curl --header "PRIVATE-TOKEN: $GROUP_ACCESS_TOKEN" --url $MONITOR_URL | jq -r '.[].location' | grep -E '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) - echo "TMF_API=$TMF_API" > build.env - echo "SONATA=$SONATA" >> build.env - echo "PKG_MANAGER=$PKG_MANAGER" >> build.env Loading @@ -330,6 +333,7 @@ get_images: - echo "REGISTRY_API=$REGISTRY_API" >> build.env - echo "FABRIC_API=$FABRIC_API" >> build.env - echo "PORTAL=$PORTAL" >> build.env - echo "MONITOR=$MONITOR" >> build.env artifacts: paths: - build.env Loading Loading @@ -363,7 +367,7 @@ update_values: - python3 -m pip install ruamel.yaml script: - pwd - python3 scripts/helm_update_etsi.py $PKG_MANAGER $OSS_CLIENT $SONATA $TMF_API $PORTAL_CART $TELEMETRY_CLIENT $PEERING_API $REGISTRY_API $FABRIC_API $PORTAL --bump-chart --file=./charts/hypo/values.yaml - python3 scripts/helm_update_etsi.py $PKG_MANAGER $OSS_CLIENT $SONATA $TMF_API $PORTAL_CART $TELEMETRY_CLIENT $PEERING_API $REGISTRY_API $FABRIC_API $PORTAL $MONITOR --bump-chart --file=./charts/hypo/values.yaml - git add . - git config --global user.email $GITLAB_USER_EMAIL - git config --global user.name $GITLAB_USER_NAME Loading
charts/hypo/templates/service-monitor/deployment.yaml 0 → 100644 +71 −0 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 -}}
charts/hypo/values.yaml +45 −0 Original line number Diff line number Diff line Loading @@ -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/lcm pullPolicy: Always tag: "1.0.0" 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 Loading
scripts/get_tags.sh +6 −1 Original line number Diff line number Diff line Loading @@ -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/3036/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) Loading Loading @@ -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 Loading @@ -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
scripts/helm_update.py +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading