Loading deploy.sh +7 −3 Original line number Diff line number Diff line Loading @@ -200,8 +200,8 @@ for COMPONENT in $TFS_COMPONENTS; do DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" kubectl --namespace $TFS_K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" echo " Collecting env-vars for '$COMPONENT' component..." Loading Loading @@ -234,7 +234,11 @@ done echo "Deploying extra manifests..." for EXTRA_MANIFEST in $TFS_EXTRA_MANIFESTS; do echo "Processing manifest '$EXTRA_MANIFEST'..." if [[ "$EXTRA_MANIFEST" == *"servicemonitor"* ]]; then kubectl apply -f $EXTRA_MANIFEST else kubectl --namespace $TFS_K8S_NAMESPACE apply -f $EXTRA_MANIFEST fi printf "\n" done printf "\n" Loading manifests/contextservice.yaml +7 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ spec: ports: - containerPort: 1010 - containerPort: 8080 - containerPort: 9192 env: - name: DB_BACKEND value: "redis" Loading Loading @@ -74,6 +75,8 @@ apiVersion: v1 kind: Service metadata: name: contextservice labels: app: contextservice spec: type: ClusterIP selector: Loading @@ -87,3 +90,7 @@ spec: protocol: TCP port: 8080 targetPort: 8080 - name: metrics protocol: TCP port: 9192 targetPort: 9192 manifests/deviceservice.yaml +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ spec: selector: matchLabels: app: deviceservice replicas: 1 template: metadata: labels: Loading @@ -32,6 +33,7 @@ spec: imagePullPolicy: Always ports: - containerPort: 2020 - containerPort: 9192 env: - name: LOG_LEVEL value: "INFO" Loading @@ -53,6 +55,8 @@ apiVersion: v1 kind: Service metadata: name: deviceservice labels: app: deviceservice spec: type: ClusterIP selector: Loading @@ -62,3 +66,7 @@ spec: protocol: TCP port: 2020 targetPort: 2020 - name: metrics protocol: TCP port: 9192 targetPort: 9192 manifests/pathcompservice.yaml +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ spec: selector: matchLabels: app: pathcompservice replicas: 5 template: metadata: labels: Loading manifests/servicemonitors.yaml 0 → 100644 +231 −0 Original line number Diff line number Diff line apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-contextservice-metric labels: app: contextservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: contextservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-deviceservice-metric labels: app: deviceservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: deviceservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-serviceservice-metric labels: app: serviceservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: serviceservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-sliceservice-metric labels: app: sliceservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: sliceservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-pathcompservice-metric labels: app: pathcompservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: pathcompservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-monitoringservice-metric labels: app: monitoringservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: monitoringservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-dltservice-metric labels: app: dltservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: dltservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-interdomainservice-metric labels: app: interdomainservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: interdomainservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running Loading
deploy.sh +7 −3 Original line number Diff line number Diff line Loading @@ -200,8 +200,8 @@ for COMPONENT in $TFS_COMPONENTS; do DEPLOY_LOG="$TMP_LOGS_FOLDER/deploy_${COMPONENT}.log" kubectl --namespace $TFS_K8S_NAMESPACE apply -f "$MANIFEST" > "$DEPLOY_LOG" COMPONENT_OBJNAME=$(echo "${COMPONENT}" | sed "s/\_/-/") kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=0 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" #kubectl --namespace $TFS_K8S_NAMESPACE scale deployment --replicas=1 ${COMPONENT_OBJNAME}service >> "$DEPLOY_LOG" echo " Collecting env-vars for '$COMPONENT' component..." Loading Loading @@ -234,7 +234,11 @@ done echo "Deploying extra manifests..." for EXTRA_MANIFEST in $TFS_EXTRA_MANIFESTS; do echo "Processing manifest '$EXTRA_MANIFEST'..." if [[ "$EXTRA_MANIFEST" == *"servicemonitor"* ]]; then kubectl apply -f $EXTRA_MANIFEST else kubectl --namespace $TFS_K8S_NAMESPACE apply -f $EXTRA_MANIFEST fi printf "\n" done printf "\n" Loading
manifests/contextservice.yaml +7 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ spec: ports: - containerPort: 1010 - containerPort: 8080 - containerPort: 9192 env: - name: DB_BACKEND value: "redis" Loading Loading @@ -74,6 +75,8 @@ apiVersion: v1 kind: Service metadata: name: contextservice labels: app: contextservice spec: type: ClusterIP selector: Loading @@ -87,3 +90,7 @@ spec: protocol: TCP port: 8080 targetPort: 8080 - name: metrics protocol: TCP port: 9192 targetPort: 9192
manifests/deviceservice.yaml +8 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ spec: selector: matchLabels: app: deviceservice replicas: 1 template: metadata: labels: Loading @@ -32,6 +33,7 @@ spec: imagePullPolicy: Always ports: - containerPort: 2020 - containerPort: 9192 env: - name: LOG_LEVEL value: "INFO" Loading @@ -53,6 +55,8 @@ apiVersion: v1 kind: Service metadata: name: deviceservice labels: app: deviceservice spec: type: ClusterIP selector: Loading @@ -62,3 +66,7 @@ spec: protocol: TCP port: 2020 targetPort: 2020 - name: metrics protocol: TCP port: 9192 targetPort: 9192
manifests/pathcompservice.yaml +1 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ spec: selector: matchLabels: app: pathcompservice replicas: 5 template: metadata: labels: Loading
manifests/servicemonitors.yaml 0 → 100644 +231 −0 Original line number Diff line number Diff line apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-contextservice-metric labels: app: contextservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: contextservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-deviceservice-metric labels: app: deviceservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: deviceservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-serviceservice-metric labels: app: serviceservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: serviceservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-sliceservice-metric labels: app: sliceservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: sliceservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-pathcompservice-metric labels: app: pathcompservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: pathcompservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-monitoringservice-metric labels: app: monitoringservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: monitoringservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-dltservice-metric labels: app: dltservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: dltservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: namespace: monitoring # namespace where prometheus is running name: tfs-interdomainservice-metric labels: app: interdomainservice #release: prometheus #release: prom # name of the release # ( VERY IMPORTANT: You need to know the correct release name by viewing # the servicemonitor of Prometheus itself: Without the correct name, # Prometheus cannot identify the metrics of the Flask app as the target.) spec: selector: matchLabels: # Target app service #namespace: tfs app: interdomainservice # same as above #release: prometheus # same as above endpoints: - port: metrics # named port in target app scheme: http path: /metrics # path to scrape interval: 1s # scrape interval namespaceSelector: any: false matchNames: - tfs # namespace where the app is running