Skip to content

Commit

Permalink
Add ingestion config for standard discount (#3591)
Browse files Browse the repository at this point in the history
* Add ingestion config for standard discount

* Remove statefulset check in ingestionconfig

* Fix nil in ingestion config

* Fix nil in _helpers.tpl for standard discount

* Re-add statefulset check in ingestionconfig
  • Loading branch information
kaelanspatel authored Sep 4, 2024
1 parent 1f90cfc commit d55de59
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cost-analyzer/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,12 @@ Begin Kubecost 2.0 templates
value: "true"
- name: FEDERATED_CLUSTER # this ensures the ingester runs assuming federated primary paths in the bucket
value: "true"
{{- if (.Values.kubecostProductConfigs).standardDiscount }}
{{- if .Values.ingestionConfigmapName }}
- name: INGESTION_CONFIGMAP_NAME
value: {{ .Values.ingestionConfigmapName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
- name: LOG_LEVEL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,22 @@ data:
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location = /model/getIngestionConfig {
proxy_read_timeout {{ .Values.kubecostFrontend.timeoutSeconds | default 300 }};
proxy_pass http://aggregator/getIngestionConfig;
proxy_redirect off;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location = /model/setIngestionConfig {
proxy_read_timeout {{ .Values.kubecostFrontend.timeoutSeconds | default 300 }};
proxy_pass http://aggregator/setIngestionConfig;
proxy_redirect off;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location = /model/enablements {
proxy_read_timeout 300;
Expand Down
14 changes: 14 additions & 0 deletions cost-analyzer/templates/cost-analyzer-ingestion-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if eq (include "aggregator.deployMethod" .) "statefulset" }}
{{- if (.Values.kubecostProductConfigs).standardDiscount }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ default "ingestion-configs" .Values.ingestionConfigmapName }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
data:
standardDiscount: "{{ .Values.kubecostProductConfigs.standardDiscount }}"
helmConfig: "true"
{{- end -}}
{{- end -}}
1 change: 1 addition & 0 deletions cost-analyzer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3409,6 +3409,7 @@ costEventsAudit:
# azureOfferDurableID: "MS-AZR-0003p"
# discount: "" # percentage discount applied to compute
# negotiatedDiscount: "" # custom negotiated cloud provider discount
# standardDiscount: "" # custom negotiated cloud provider discount, applied to all incoming asset compute costs in a federated environment. Overrides negotiatedDiscount on any cluster in the federated environment.
# defaultIdle: false
# serviceKeySecretName: "" # Use an existing AWS or Azure secret with format as in aws-service-key-secret.yaml or azure-service-key-secret.yaml. Leave blank if using createServiceKeySecret
# createServiceKeySecret: true # Creates a secret representing your cloud service key based on data in values.yaml. If you are storing unencrypted values, add a secret manually
Expand Down

0 comments on commit d55de59

Please sign in to comment.