From e8a07a08e6e5520ee2f44d0d0da572d36655f121 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Mon, 17 Mar 2025 23:51:35 +0800 Subject: [PATCH] feat: add metricsEnabled and probesEnabled configuration options to payment, content, centralStorage, authentication, and notification services Signed-off-by: zhenyus --- .../authentication/authentication-config.yaml | 4 ++-- .../templates/authentication/deployment.yaml | 11 +---------- freeleaps/helm-pkg/authentication/values.prod.yaml | 2 ++ freeleaps/helm-pkg/authentication/values.yaml | 6 +++++- .../central-storage/central-storage-config.yaml | 5 ++--- .../templates/central-storage/deployment.yaml | 10 ---------- freeleaps/helm-pkg/centralStorage/values.prod.yaml | 2 ++ freeleaps/helm-pkg/centralStorage/values.yaml | 4 ++++ .../content/templates/content/content-config.yaml | 5 ++--- .../content/templates/content/deployment.yaml | 10 ---------- freeleaps/helm-pkg/content/values.prod.yaml | 2 ++ freeleaps/helm-pkg/content/values.yaml | 4 ++++ .../templates/notification/deployment.yaml | 11 +---------- .../templates/notification/notification-config.yaml | 5 ++--- freeleaps/helm-pkg/notification/values.prod.yaml | 2 ++ freeleaps/helm-pkg/notification/values.yaml | 6 +++++- .../payment/templates/payment/deployment.yaml | 10 ---------- .../payment/templates/payment/payment-config.yaml | 4 ++-- freeleaps/helm-pkg/payment/values.prod.yaml | 2 ++ freeleaps/helm-pkg/payment/values.yaml | 4 ++++ 20 files changed, 44 insertions(+), 65 deletions(-) diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/authentication-config.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/authentication-config.yaml index 747cf28e..688f65ca 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/authentication-config.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/authentication-config.yaml @@ -16,6 +16,6 @@ data: MONGODB_NAME: {{ .Values.authentication.configs.mongodbName | b64enc | quote }} MONGODB_PORT: {{ .Values.authentication.configs.mongodbPort | toString | b64enc }} MONGODB_URI: {{ .Values.authentication.configs.mongodbUri | b64enc | quote }} - METRICS_ENABLED: {{ .Values.authentication.serviceMonitor.enabled | default false | toString | b64enc }} - PROBES_ENABLED: {{ if and .Values.authentication.probes (gt (len .Values.authentication.probes) 0) }}{{ "true" | b64enc }}{{ else }}{{ "false" | b64enc }}{{ end }} + METRICS_ENABLED: {{ .Values.authentication.configs.metricsEnabled | default false | toString | b64enc }} + PROBES_ENABLED: {{ .Values.authentication.configs.probesEnabled | default false | toString | b64enc }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml index 7b48a281..4917a059 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/deployment.yaml @@ -93,13 +93,4 @@ spec: name: authentication-config key: {{ $key | snakecase | upper }} {{- end }} - - name: METRICS_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: METRICS_ENABLED - - name: PROBES_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: PROBES_ENABLED + diff --git a/freeleaps/helm-pkg/authentication/values.prod.yaml b/freeleaps/helm-pkg/authentication/values.prod.yaml index c19f4ff5..ffafaece 100644 --- a/freeleaps/helm-pkg/authentication/values.prod.yaml +++ b/freeleaps/helm-pkg/authentication/values.prod.yaml @@ -68,3 +68,5 @@ authentication: mongodbName: freeleaps2 mongodbPort: 27017 mongodbUri: mongodb+srv://freeadmin:0eMV0bt8oyaknA0m@freeleaps2.zmsmpos.mongodb.net/?retryWrites=true&w=majority + metricsEnabled: "true" + probesEnabled: "true" diff --git a/freeleaps/helm-pkg/authentication/values.yaml b/freeleaps/helm-pkg/authentication/values.yaml index acfcfa19..508650d1 100644 --- a/freeleaps/helm-pkg/authentication/values.yaml +++ b/freeleaps/helm-pkg/authentication/values.yaml @@ -55,4 +55,8 @@ authentication: # MONGODB_PORT mongodbPort: "27017" # MONGODB_URI - mongodbUri: "" \ No newline at end of file + mongodbUri: "" + # METRICS_ENABLED + metricsEnabled: "false" + # PROBES_ENABLED + probesEnabled: "false" \ No newline at end of file diff --git a/freeleaps/helm-pkg/centralStorage/templates/central-storage/central-storage-config.yaml b/freeleaps/helm-pkg/centralStorage/templates/central-storage/central-storage-config.yaml index 056bccf8..dd2adc06 100644 --- a/freeleaps/helm-pkg/centralStorage/templates/central-storage/central-storage-config.yaml +++ b/freeleaps/helm-pkg/centralStorage/templates/central-storage/central-storage-config.yaml @@ -14,6 +14,5 @@ data: MONGODB_URI: {{ .Values.centralStorage.configs.mongodbUri | b64enc | quote }} AZURE_STORAGE_DOCUMENT_API_KEY: {{ .Values.centralStorage.configs.azureStorageDocumentApiKey | b64enc | quote }} AZURE_STORAGE_DOCUMENT_API_ENDPOINT: {{ .Values.centralStorage.configs.azureStorageDocumentApiEndpoint | b64enc | quote }} - METRICS_ENABLED: {{ .Values.centralStorage.serviceMonitor.enabled | default false | toString | b64enc }} - PROBES_ENABLED: {{ if and .Values.centralStorage.probes (gt (len .Values.centralStorage.probes) 0) }}{{ "true" | b64enc }}{{ else }}{{ "false" | b64enc }}{{ end }} - \ No newline at end of file + METRICS_ENABLED: {{ .Values.centralStorage.configs.metricsEnabled | default false | toString | b64enc }} + PROBES_ENABLED: {{ .Values.centralStorage.configs.probesEnabled | default false | toString | b64enc }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/centralStorage/templates/central-storage/deployment.yaml b/freeleaps/helm-pkg/centralStorage/templates/central-storage/deployment.yaml index 4cea438e..afd1808e 100644 --- a/freeleaps/helm-pkg/centralStorage/templates/central-storage/deployment.yaml +++ b/freeleaps/helm-pkg/centralStorage/templates/central-storage/deployment.yaml @@ -93,13 +93,3 @@ spec: name: central-storage-config key: {{ $key | snakecase | upper }} {{- end }} - - name: METRICS_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: METRICS_ENABLED - - name: PROBES_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: PROBES_ENABLED \ No newline at end of file diff --git a/freeleaps/helm-pkg/centralStorage/values.prod.yaml b/freeleaps/helm-pkg/centralStorage/values.prod.yaml index 95c79bf5..b40dd369 100644 --- a/freeleaps/helm-pkg/centralStorage/values.prod.yaml +++ b/freeleaps/helm-pkg/centralStorage/values.prod.yaml @@ -66,3 +66,5 @@ centralStorage: mongodbUri: mongodb+srv://freeadmin:0eMV0bt8oyaknA0m@freeleaps2.zmsmpos.mongodb.net/?retryWrites=true&w=majority azureStorageDocumentApiKey: xbiFtFeQ6v5dozgVM99fZ9huUomL7QcLu6s0y8zYHtIXZ8XdneKDMcg4liQr/9oNlVoRFcZhWjLY+ASt9cjICQ== azureStorageDocumentApiEndpoint: https://freeleaps1document.blob.core.windows.net/ + metricsEnabled: "true" + probesEnabled: "true" \ No newline at end of file diff --git a/freeleaps/helm-pkg/centralStorage/values.yaml b/freeleaps/helm-pkg/centralStorage/values.yaml index 44ab9d69..3769713f 100644 --- a/freeleaps/helm-pkg/centralStorage/values.yaml +++ b/freeleaps/helm-pkg/centralStorage/values.yaml @@ -55,3 +55,7 @@ central-storage: azureStorageDocumentApiKey: "" # AZURE_STORAGE_DOCUMENT_API_ENDPOINT azureStorageDocumentApiEndpoint: "" + # METRICS_ENABLED + metricsEnabled: "false" + # PROBES_ENABLED + probesEnabled: "false" diff --git a/freeleaps/helm-pkg/content/templates/content/content-config.yaml b/freeleaps/helm-pkg/content/templates/content/content-config.yaml index 2f247dca..326b059b 100644 --- a/freeleaps/helm-pkg/content/templates/content/content-config.yaml +++ b/freeleaps/helm-pkg/content/templates/content/content-config.yaml @@ -14,6 +14,5 @@ data: MONGODB_URI: {{ .Values.content.configs.mongodbUri | b64enc | quote }} FREELEAPS_WWW_AS_AZURE_CLIENT_SECRET: {{ .Values.content.configs.freeleapsWwwAsAzureClientSecret | b64enc | quote }} CENTRAL_STORAGE_WEBAPI_URL_BASE: {{ .Values.content.configs.centralStorageWebapiUrlBase | b64enc | quote }} - METRICS_ENABLED: {{ .Values.content.serviceMonitor.enabled | default false | toString | b64enc }} - PROBES_ENABLED: {{ if and .Values.content.probes (gt (len .Values.content.probes) 0) }}{{ "true" | b64enc }}{{ else }}{{ "false" | b64enc }}{{ end }} - \ No newline at end of file + METRICS_ENABLED: {{ .Values.content.configs.metricsEnabled | default false | toString | b64enc }} + PROBES_ENABLED: {{ .Values.content.configs.probesEnabled | default false | toString | b64enc }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/content/templates/content/deployment.yaml b/freeleaps/helm-pkg/content/templates/content/deployment.yaml index 37924b09..d7f83112 100644 --- a/freeleaps/helm-pkg/content/templates/content/deployment.yaml +++ b/freeleaps/helm-pkg/content/templates/content/deployment.yaml @@ -93,13 +93,3 @@ spec: name: content-config key: {{ $key | snakecase | upper }} {{- end }} - - name: METRICS_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: METRICS_ENABLED - - name: PROBES_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: PROBES_ENABLED \ No newline at end of file diff --git a/freeleaps/helm-pkg/content/values.prod.yaml b/freeleaps/helm-pkg/content/values.prod.yaml index c9369371..2be4abc8 100644 --- a/freeleaps/helm-pkg/content/values.prod.yaml +++ b/freeleaps/helm-pkg/content/values.prod.yaml @@ -66,3 +66,5 @@ content: mongodbUri: mongodb+srv://freeadmin:0eMV0bt8oyaknA0m@freeleaps2.zmsmpos.mongodb.net/?retryWrites=true&w=majority freeleapsWwwAsAzureClientSecret: jTu8Q~WceiK-5dfZB44Ww-K4fVGi3_5tHNWYYbdX centralStorageWebapiUrlBase: http://central-storage-service.freeleaps-prod.svc.freeleaps.cluster:8005/api/central_storage + metricsEnabled: "true" + probesEnabled: "true" \ No newline at end of file diff --git a/freeleaps/helm-pkg/content/values.yaml b/freeleaps/helm-pkg/content/values.yaml index 02aef249..c0e671eb 100644 --- a/freeleaps/helm-pkg/content/values.yaml +++ b/freeleaps/helm-pkg/content/values.yaml @@ -55,4 +55,8 @@ content: freeleapsWwwAsAzureClientSecret: "" # CENTRAL_STORAGE_WEBAPI_URL_BASE centralStorageWebapiUrlBase: "" + # METRICS_ENABLED + metricsEnabled: "false" + # PROBES_ENABLED + probesEnabled: "false" diff --git a/freeleaps/helm-pkg/notification/templates/notification/deployment.yaml b/freeleaps/helm-pkg/notification/templates/notification/deployment.yaml index 2c288a59..6cffad89 100644 --- a/freeleaps/helm-pkg/notification/templates/notification/deployment.yaml +++ b/freeleaps/helm-pkg/notification/templates/notification/deployment.yaml @@ -93,13 +93,4 @@ spec: name: notification-config key: {{ $key | snakecase | upper }} {{- end }} - - name: METRICS_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: METRICS_ENABLED - - name: PROBES_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: PROBES_ENABLED + diff --git a/freeleaps/helm-pkg/notification/templates/notification/notification-config.yaml b/freeleaps/helm-pkg/notification/templates/notification/notification-config.yaml index 367554b9..e8bfe28f 100644 --- a/freeleaps/helm-pkg/notification/templates/notification/notification-config.yaml +++ b/freeleaps/helm-pkg/notification/templates/notification/notification-config.yaml @@ -21,6 +21,5 @@ data: SENDGRID_API_KEY: {{ .Values.notification.configs.sendgridApiKey | b64enc | quote }} TWILIO_ACCOUNT_SID: {{ .Values.notification.configs.twilioAccountSid | b64enc | quote }} TWILIO_AUTH_TOKEN: {{ .Values.notification.configs.twilioAuthToken | b64enc | quote }} - METRICS_ENABLED: {{ .Values.notification.serviceMonitor.enabled | default false | toString | b64enc }} - PROBES_ENABLED: {{ if and .Values.notification.probes (gt (len .Values.notification.probes) 0) }}{{ "true" | b64enc }}{{ else }}{{ "false" | b64enc }}{{ end }} - \ No newline at end of file + METRICS_ENABLED: {{ .Values.notification.configs.metricsEnabled | default false | toString | b64enc }} + PROBES_ENABLED: {{ .Values.notification.configs.probesEnabled | default false | toString | b64enc }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/notification/values.prod.yaml b/freeleaps/helm-pkg/notification/values.prod.yaml index 1011cb35..e08a11f4 100644 --- a/freeleaps/helm-pkg/notification/values.prod.yaml +++ b/freeleaps/helm-pkg/notification/values.prod.yaml @@ -73,3 +73,5 @@ notification: sendgridApiKey: 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 twilioAccountSid: ACf8c9283a6acda060258eadb29be58bc8 twilioAuthToken: ef160748cc22c8b7195b49df4b8eca7e + metricsEnabled: "true" + probesEnabled: "true" \ No newline at end of file diff --git a/freeleaps/helm-pkg/notification/values.yaml b/freeleaps/helm-pkg/notification/values.yaml index c0c1291f..4b7c66a2 100644 --- a/freeleaps/helm-pkg/notification/values.yaml +++ b/freeleaps/helm-pkg/notification/values.yaml @@ -68,4 +68,8 @@ notification: # TWILIO_ACCOUNT_SID twilioAccountSid: "" # TWILIO_AUTH_TOKEN - twilioAuthToken: "" \ No newline at end of file + twilioAuthToken: "" + # METRICS_ENABLED + metricsEnabled: "false" + # PROBES_ENABLED + probesEnabled: "false" \ No newline at end of file diff --git a/freeleaps/helm-pkg/payment/templates/payment/deployment.yaml b/freeleaps/helm-pkg/payment/templates/payment/deployment.yaml index a878d584..bcc581cd 100644 --- a/freeleaps/helm-pkg/payment/templates/payment/deployment.yaml +++ b/freeleaps/helm-pkg/payment/templates/payment/deployment.yaml @@ -93,13 +93,3 @@ spec: name: payment-config key: {{ $key | snakecase | upper }} {{- end }} - - name: METRICS_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: METRICS_ENABLED - - name: PROBES_ENABLED - valueFrom: - secretKeyRef: - name: authentication-config - key: PROBES_ENABLED \ No newline at end of file diff --git a/freeleaps/helm-pkg/payment/templates/payment/payment-config.yaml b/freeleaps/helm-pkg/payment/templates/payment/payment-config.yaml index fbbcad01..bd3b5dcb 100644 --- a/freeleaps/helm-pkg/payment/templates/payment/payment-config.yaml +++ b/freeleaps/helm-pkg/payment/templates/payment/payment-config.yaml @@ -14,5 +14,5 @@ data: MONGODB_URI: {{ .Values.payment.configs.mongodbUri | b64enc | quote }} STRIPE_API_KEY: {{ .Values.payment.configs.stripeApiKey | b64enc | quote }} SITE_URL_ROOT: {{ .Values.payment.configs.siteUrlRoot | b64enc | quote }} - METRICS_ENABLED: {{ .Values.payment.serviceMonitor.enabled | default false | toString | b64enc }} - PROBES_ENABLED: {{ if and .Values.payment.probes (gt (len .Values.payment.probes) 0) }}{{ "true" | b64enc }}{{ else }}{{ "false" | b64enc }}{{ end }} \ No newline at end of file + METRICS_ENABLED: {{ .Values.payment.configs.metricsEnabled | default false | toString | b64enc }} + PROBES_ENABLED: {{ .Values.payment.configs.probesEnabled | default false | toString | b64enc }} \ No newline at end of file diff --git a/freeleaps/helm-pkg/payment/values.prod.yaml b/freeleaps/helm-pkg/payment/values.prod.yaml index c0ee65cb..b8380fe6 100644 --- a/freeleaps/helm-pkg/payment/values.prod.yaml +++ b/freeleaps/helm-pkg/payment/values.prod.yaml @@ -66,3 +66,5 @@ payment: mongodbUri: mongodb+srv://freeadmin:0eMV0bt8oyaknA0m@freeleaps2.zmsmpos.mongodb.net/?retryWrites=true&w=majority stripeApiKey: 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 siteUrlRoot: https://freeleaps.mathmast.com + metricsEnabled: "true" + probesEnabled: "true" \ No newline at end of file diff --git a/freeleaps/helm-pkg/payment/values.yaml b/freeleaps/helm-pkg/payment/values.yaml index 7fdba84a..844c007f 100644 --- a/freeleaps/helm-pkg/payment/values.yaml +++ b/freeleaps/helm-pkg/payment/values.yaml @@ -55,3 +55,7 @@ payment: stripeApiKey: "" # SITE_URL_ROOT siteUrlRoot: "" + # METRICS_ENABLED + metricsEnabled: "false" + # PROBES_ENABLED + probesEnabled: "false"