diff --git a/charts/flyte-core/README.md b/charts/flyte-core/README.md index 41ce2af6edc..11b1030ada3 100644 --- a/charts/flyte-core/README.md +++ b/charts/flyte-core/README.md @@ -218,6 +218,11 @@ helm install gateway bitnami/contour -n flyte | flyteconsole.resources | object | `{"limits":{"cpu":"500m","memory":"250Mi"},"requests":{"cpu":"10m","memory":"50Mi"}}` | Default resources requests and limits for Flyteconsole deployment | | flyteconsole.securityContext | object | `{"fsGroupChangePolicy":"OnRootMismatch","runAsNonRoot":true,"runAsUser":1000,"seLinuxOptions":{"type":"spc_t"}}` | Sets securityContext for flyteconsole pod(s). | | flyteconsole.service | object | `{"annotations":{},"type":"ClusterIP"}` | Service settings for Flyteconsole | +| flyteconsole.serviceMonitor | object | `{"enabled":false,"interval":"60s","labels":{},"scrapeTimeout":"30s"}` | Settings for flyteconsole service monitor | +| flyteconsole.serviceMonitor.enabled | bool | `false` | If enabled create the flyteconsole service monitor | +| flyteconsole.serviceMonitor.interval | string | `"60s"` | Sets the interval at which metrics will be scraped by prometheus | +| flyteconsole.serviceMonitor.labels | object | `{}` | Sets the labels for the service monitor which are required by the prometheus to auto-detect the service monitor and start scrapping the metrics | +| flyteconsole.serviceMonitor.scrapeTimeout | string | `"30s"` | Sets the timeout after which request to scrape metrics will time out | | flyteconsole.tolerations | list | `[]` | tolerations for Flyteconsole deployment | | flytepropeller.additionalContainers | list | `[]` | Appends additional containers to the deployment spec. May include template values. | | flytepropeller.additionalVolumeMounts | list | `[]` | Appends additional volume mounts to the main container's spec. May include template values. | diff --git a/charts/flyte-core/templates/console/deployment.yaml b/charts/flyte-core/templates/console/deployment.yaml index 2d89e0265a6..7d089b3b5ea 100644 --- a/charts/flyte-core/templates/console/deployment.yaml +++ b/charts/flyte-core/templates/console/deployment.yaml @@ -37,6 +37,11 @@ spec: name: flyte-console-config ports: - containerPort: 8080 + {{- if .Values.flyteconsole.serviceMonitor.enabled }} + - containerPort: 8081 + name: http-metrics + protocol: TCP + {{- end }} {{- if or .Values.flyteconsole.ga.enabled .Values.flyteconsole.podEnv }} env: {{- end }} diff --git a/charts/flyte-core/templates/console/service-monitor.yaml b/charts/flyte-core/templates/console/service-monitor.yaml new file mode 100644 index 00000000000..84c9b217521 --- /dev/null +++ b/charts/flyte-core/templates/console/service-monitor.yaml @@ -0,0 +1,19 @@ +{{- if and .Values.flyteconsole.serviceMonitor.enabled .Values.flyteconsole.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ template "flyteconsole.name" . }} + namespace: {{ template "flyte.namespace" . }} + labels: + {{- with .Values.flyteconsole.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + endpoints: + - interval: {{ .Values.flyteconsole.serviceMonitor.interval }} + port: http-metrics + path: /metrics + scrapeTimeout: {{ .Values.flyteconsole.serviceMonitor.scrapeTimeout }} + selector: + matchLabels: {{ include "flyteconsole.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/flyte-core/templates/console/service.yaml b/charts/flyte-core/templates/console/service.yaml index b907b909604..1845294cef5 100644 --- a/charts/flyte-core/templates/console/service.yaml +++ b/charts/flyte-core/templates/console/service.yaml @@ -17,5 +17,10 @@ spec: port: 80 protocol: TCP targetPort: 8080 + {{- if .Values.flyteconsole.serviceMonitor.enabled }} + - name: http-metrics + port: 8081 + protocol: TCP + {{- end }} selector: {{ include "flyteconsole.selectorLabels" . | nindent 4 }} {{- end }} diff --git a/charts/flyte-core/values.yaml b/charts/flyte-core/values.yaml index 34693250579..02ff3a54ab0 100755 --- a/charts/flyte-core/values.yaml +++ b/charts/flyte-core/values.yaml @@ -442,6 +442,18 @@ flyteconsole: seLinuxOptions: type: spc_t + # -- Settings for flyteconsole service monitor + serviceMonitor: + # -- If enabled create the flyteconsole service monitor + enabled: false + # -- Sets the interval at which metrics will be scraped by prometheus + interval: 60s + # -- Sets the timeout after which request to scrape metrics will time out + scrapeTimeout: 30s + # -- Sets the labels for the service monitor which are required by the + # prometheus to auto-detect the service monitor and start scrapping the metrics + labels: {} + # It will enable the redoc route in ingress deployRedoc: false diff --git a/docker/sandbox-bundled/manifests/complete-agent.yaml b/docker/sandbox-bundled/manifests/complete-agent.yaml index 04d26d6440b..f43ba75b4e7 100644 --- a/docker/sandbox-bundled/manifests/complete-agent.yaml +++ b/docker/sandbox-bundled/manifests/complete-agent.yaml @@ -816,7 +816,7 @@ type: Opaque --- apiVersion: v1 data: - haSharedSecret: MWZZMXJJcWFNeW5pVG9vRg== + haSharedSecret: Qm5HWVV1QUFNb3YxbW45WQ== proxyPassword: "" proxyUsername: "" kind: Secret @@ -1412,7 +1412,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: b0052aa89fd923e4be52d976ca724f568545dcab728e5f921f20c882546abfb3 + checksum/secret: 64a35ebb21d379461a7846f02d38e59d6e09c2cf53f5254a3eee3f9c91464887 labels: app: docker-registry release: flyte-sandbox diff --git a/docker/sandbox-bundled/manifests/complete.yaml b/docker/sandbox-bundled/manifests/complete.yaml index e17a424ef94..07850d61710 100644 --- a/docker/sandbox-bundled/manifests/complete.yaml +++ b/docker/sandbox-bundled/manifests/complete.yaml @@ -796,7 +796,7 @@ type: Opaque --- apiVersion: v1 data: - haSharedSecret: a0xtWmJJU2tyNUVMT3NqbQ== + haSharedSecret: cllsN0RhMWZlcHloeGZrZg== proxyPassword: "" proxyUsername: "" kind: Secret @@ -1360,7 +1360,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: de6b9493b8ac7022ecaf53f7bbd447a8f74e594e429e4c49b9fa346458c7a80d + checksum/secret: 8ca680f0c05182912281c1d391564a95daddb1472d6b517abe2d61019cc33935 labels: app: docker-registry release: flyte-sandbox diff --git a/docker/sandbox-bundled/manifests/dev.yaml b/docker/sandbox-bundled/manifests/dev.yaml index ef69639c32a..8853bf91f66 100644 --- a/docker/sandbox-bundled/manifests/dev.yaml +++ b/docker/sandbox-bundled/manifests/dev.yaml @@ -499,7 +499,7 @@ metadata: --- apiVersion: v1 data: - haSharedSecret: VENNTk91RkVPTWdUa3V3VA== + haSharedSecret: Um0xN045YzNQM3BpejM4cg== proxyPassword: "" proxyUsername: "" kind: Secret @@ -934,7 +934,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: 7fa86dc213b7e243519854ad34d0f779e2e48304da9cd8db5f019c52f958302e + checksum/secret: 9ef10229438d994b621886d5c5f3e327fd344e76c00a287efe9aaeec4b3f8e49 labels: app: docker-registry release: flyte-sandbox