Skip to content

Commit

Permalink
clean up agent values - fix diagnostic pod logic (#2889)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegoodier authored Dec 21, 2023
1 parent dfd49c0 commit 1d646db
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 37 deletions.
4 changes: 2 additions & 2 deletions cost-analyzer/templates/diagnostics-deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.diagnostics.enabled }}
{{- if or .Values.global.thanos.enabled (not (empty .Values.kubecostModel.federatedStorageConfigSecret )) -}}
{{- if or ( not (empty .Values.prometheus.server.extraSecretMounts )) (not (empty .Values.kubecostModel.federatedStorageConfigSecret )) -}}

{{- if eq .Values.prometheus.server.global.external_labels.cluster_id "cluster-one" }}
{{- fail "Error: The 'cluster_id' is set to default 'cluster-one'. Please update so that the diagnostics service can uniquely identify data coming from this cluster." }}
Expand Down Expand Up @@ -46,7 +46,7 @@ spec:
secret:
defaultMode: 420
secretName: {{ .Values.kubecostModel.federatedStorageConfigSecret }}
{{- else if .Values.global.thanos.enabled }}
{{- else }}
- name: federated-storage-config
secret:
defaultMode: 420
Expand Down
46 changes: 11 additions & 35 deletions cost-analyzer/values-agent.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Kubecost running as an Agent is designed for external hosting. The current setup deploys a
# kubecost-agent pod, low data retention prometheus server + thanos sidecar, and node-exporter.
networkCosts:
Expand All @@ -7,7 +8,8 @@ networkCosts:
# amazon-web-services: true
# google-cloud-services: true
# azure-cloud-services: true

thanos:
storeSecretName: kubecost-agent-object-store

global:
thanos:
Expand All @@ -17,7 +19,7 @@ global:
proxy: false
# Agent enables specific features designed to enhance the metrics exporter deployment
# with enhancements designed for external hosting.
agent: true
# agent: true
# agentKeySecretName: kubecost-agent-object-store
agentCsi:
enabled: false
Expand All @@ -27,21 +29,15 @@ agentCsi:
parameters: {}
secretObjects: {}


# No Grafana configuration is required.
grafana:
sidecar:
dashboards:
enabled: false
datasources:
defaultDatasourceEnabled: false
kubecostFrontend:
enabled: false

# Exporter Pod
kubecostMetrics:
exporter:
enabled: true
exportClusterInfo: true
exportClusterCache: true
# kubecostMetrics:
# exporter:
# enabled: true
# exportClusterInfo: true
# exportClusterCache: true

# Prometheus defaults to low retention (10h), disables KSM, and attaches a thanos-sidecar
# for exporting metrics.
Expand All @@ -51,26 +47,6 @@ prometheus:
kube-state-metrics:
enabled: false
disabled: true
extraScrapeConfigs: |
- job_name: kubecost-agent
honor_labels: true
scrape_interval: 1m
scrape_timeout: 60s
metrics_path: /metrics
scheme: http
dns_sd_configs:
- names:
- kubecost-agent-agent
type: 'A'
port: 9005
- job_name: kubecost-networking
kubernetes_sd_configs:
- role: pod
relabel_configs:
# Scrape only the the targets matching the following metadata
- source_labels: [__meta_kubernetes_pod_label_app]
action: keep
regex: {{ template "cost-analyzer.networkCostsName" . }}
server:
retention: 50h
# retentionSize: 1Gi
Expand Down

0 comments on commit 1d646db

Please sign in to comment.