From 42a0d7278b7171ee3b98b14648d1dca888eb2dbd Mon Sep 17 00:00:00 2001 From: Jesse Goodier <31039225+jessegoodier@users.noreply.github.com> Date: Wed, 8 Nov 2023 12:03:29 -0500 Subject: [PATCH] hideDiagnostics / hideOrphanedResources (#2739) * hideDiagnostics / hideOrphanedResources --- ...st-analyzer-frontend-config-map-template.yaml | 16 ++++++++++++---- cost-analyzer/values.yaml | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cost-analyzer/templates/cost-analyzer-frontend-config-map-template.yaml b/cost-analyzer/templates/cost-analyzer-frontend-config-map-template.yaml index 3894f70ac..fd54b01f3 100755 --- a/cost-analyzer/templates/cost-analyzer-frontend-config-map-template.yaml +++ b/cost-analyzer/templates/cost-analyzer-frontend-config-map-template.yaml @@ -612,15 +612,23 @@ data: proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } {{- end }} + + location = /model/hideOrphanedResources { + default_type 'application/json'; + {{- if .Values.kubecostFrontend.hideOrphanedResources }} + return 200 '{"hideOrphanedResources": "true"}'; + {{- else }} + return 200 '{"hideOrphanedResources": "false"}'; + {{- end }} + } location = /model/hideDiagnostics { - default_type text/html; + default_type 'application/json'; {{- if .Values.kubecostFrontend.hideDiagnostics }} - return 200 'true'; + return 200 '{"hideDiagnostics": "true"}'; {{- else }} - return 200 'false'; + return 200 '{"hideDiagnostics": "false"}'; {{- end }} } - {{- if .Values.kubecostAggregator.cloudCost.enabled }} location = /model/cloudCost/status { proxy_read_timeout 300; diff --git a/cost-analyzer/values.yaml b/cost-analyzer/values.yaml index 4feaf85ff..9eb215b4c 100644 --- a/cost-analyzer/values.yaml +++ b/cost-analyzer/values.yaml @@ -361,8 +361,8 @@ kubecostFrontend: # proxy_buffers 4 512k; # proxy_buffer_size 256k; # large_client_header_buffers 4 64k; - # hideDiagnostics: false # used if the primary is not monitored. Supported in limited environments. - + # hideDiagnostics: false # useful if the primary is not monitored. Supported in limited environments. + # hideOrphanedResources: false # OrphanedResources works on the primary-cluster's cloud-provider only. # api: # fqdn: kubecost-api.kubecost.svc.cluster.local:9001 # model: