Skip to content

Commit

Permalink
FOPTS-2375 Added cost adjustments (#26)
Browse files Browse the repository at this point in the history
* FOPTS-2375 Added cost adjustments for cpuCost, gpuCost, ramCost, pvCost, networkCost and loadBalancerCost

* FOPTS-2382 Added new env var IDLE_BY_NODE

* FOPTS-2382 Unifying both updates in a single helm package

* FOPTS-2382 Fixed log format
  • Loading branch information
JesusParada authored Oct 30, 2023
1 parent 75762c5 commit fd6f936
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 93 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v1.5

- Added costAdjustments for cpuCost, gpuCost, ramCost, pvCost, networkCost and loadBalancerCost
- Added new env var IDLE_BY_NODE to manage if idle allocations are created on a per node basis

## v1.4

- Time window sent to kubecost API was corrected. Was added a config var to allow send previous month of data to Flexera.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The app is configured using environment variables defined in a .env file. The fo
- `SHARE_TENANCY_COSTS` - a flag indicating whether to share tenancy costs among clusters
- `MULTIPLIER` - a multiplier to apply to the cost data
- `IDLE` - whether to include idle resources in the usage data. valid values are true or false.
- `IDLE_BY_NODE` - Idle allocations are created on a per node basis.
- `FILE_ROTATION` - whether to delete files generated during the previous month (or the month before the previous month if INCLUDE_PREVIOUS_MONTH is set to true). Valid values are true or false.
- `FILE_PATH` - the path where the CSV files are stored
- `INCLUDE_PREVIOUS_MONTH` - whether to include data from previous month to export process. Valid values are true or false.
Expand Down Expand Up @@ -130,13 +131,14 @@ You should see 200/201s in the logs, which indicates that the exporter is workin
| flexera.shard | string | `"NAM"` | Shard ("NAM", "EU", "AU") |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"public.ecr.aws/flexera/cbi-oi-kubecost-exporter"` | |
| image.tag | string | `"latest"` | |
| image.tag | string | `"1.5"` | |
| imagePullSecrets | list | `[]` | |
| includePreviousMonth | bool | `false` | Include data from previous month to export process |
| kubecost.aggregation | string | `"pod"` | Aggregation Level ("namespace", "controller", "pod") |
| kubecost.apiPath | string | `"/model/"` | Base path for the Kubecost API endpoints |
| kubecost.host | string | `"kubecost-cost-analyzer.kubecost.svc.cluster.local:9090"` | Default kubecost-cost-analyzer service host on the current cluster. For current cluster is serviceName.namespaceName.svc.cluster.local |
| kubecost.idle | bool | `true` | Include cost of idle resources |
| kubecost.idleByNode | bool | `false` | Idle allocations are created on a per node basis |
| kubecost.multiplier | float | `1` | Cost multiplier |
| kubecost.shareIdle | bool | `false` | Allocate idle cost proportionally |
| kubecost.shareNamespaces | string | `"kube-system,cadvisor"` | Comma-separated list of namespaces to share costs |
Expand Down
4 changes: 2 additions & 2 deletions helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ description: Kubecost exporter helm chart for Kubernetes
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.4.2
version: 1.5.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.4"
appVersion: "1.5"
5 changes: 3 additions & 2 deletions helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cbi-oi-kubecost-exporter

![Version: 1.4.2](https://img.shields.io/badge/Version-1.4.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.4](https://img.shields.io/badge/AppVersion-1.4-informational?style=flat-square)
![Version: 1.5.0](https://img.shields.io/badge/Version-1.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.5](https://img.shields.io/badge/AppVersion-1.5-informational?style=flat-square)

### Kubecost exporter helm chart for Kubernetes

Expand Down Expand Up @@ -94,13 +94,14 @@ You should see 200/201s in the logs, which indicates that the exporter is workin
| flexera.shard | string | `"NAM"` | Shard ("NAM", "EU", "AU") |
| image.pullPolicy | string | `"Always"` | |
| image.repository | string | `"public.ecr.aws/flexera/cbi-oi-kubecost-exporter"` | |
| image.tag | string | `"1.4"` | |
| image.tag | string | `"1.5"` | |
| imagePullSecrets | list | `[]` | |
| includePreviousMonth | bool | `false` | Include data from previous month to export process |
| kubecost.aggregation | string | `"pod"` | Aggregation Level ("namespace", "controller", "pod") |
| kubecost.apiPath | string | `"/model/"` | Base path for the Kubecost API endpoints |
| kubecost.host | string | `"kubecost-cost-analyzer.kubecost.svc.cluster.local:9090"` | Default kubecost-cost-analyzer service host on the current cluster. For current cluster is serviceName.namespaceName.svc.cluster.local |
| kubecost.idle | bool | `true` | Include cost of idle resources |
| kubecost.idleByNode | bool | `false` | Idle allocations are created on a per node basis |
| kubecost.multiplier | float | `1` | Cost multiplier |
| kubecost.shareIdle | bool | `false` | Allocate idle cost proportionally |
| kubecost.shareNamespaces | string | `"kube-system,cadvisor"` | Comma-separated list of namespaces to share costs |
Expand Down
Binary file added helm-chart/cbi-oi-kubecost-exporter-1.5.0.tgz
Binary file not shown.
2 changes: 2 additions & 0 deletions helm-chart/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ spec:
value: "{{ .Values.kubecost.shareNamespaces }}"
- name: IDLE
value: "{{ .Values.kubecost.idle }}"
- name: IDLE_BY_NODE
value: "{{ .Values.kubecost.idleByNode }}"
- name: SHARE_IDLE
value: "{{ .Values.kubecost.shareIdle }}"
- name: SHARE_TENANCY_COSTS
Expand Down
4 changes: 3 additions & 1 deletion helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
image:
repository: public.ecr.aws/flexera/cbi-oi-kubecost-exporter
pullPolicy: Always
tag: "1.4"
tag: "1.5"

imagePullSecrets: []

Expand Down Expand Up @@ -48,6 +48,8 @@ kubecost:
shareNamespaces: "kube-system,cadvisor"
# -- Include cost of idle resources
idle: true
# -- Idle allocations are created on a per node basis
idleByNode: false
# -- Allocate idle cost proportionally
shareIdle: false
# -- Share the cost of cluster overhead assets such as cluster management costs
Expand Down
24 changes: 17 additions & 7 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
apiVersion: v1
entries:
cbi-oi-kubecost-exporter:
- apiVersion: v2
appVersion: "1.5"
created: "2023-10-27T17:36:14.535347-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: a0503a1af7b86a8f0769009de5a71a3613e8503a5f59cf86874d483f0f5f2abb
name: cbi-oi-kubecost-exporter
type: application
urls:
- helm-chart/cbi-oi-kubecost-exporter-1.5.0.tgz
version: 1.5.0
- apiVersion: v2
appVersion: "1.4"
created: "2023-10-19T16:26:14.241281-06:00"
created: "2023-10-27T17:36:14.535157-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: 5b296e921178d84717345be19b92a4eea0c9ca1c65410128dec596692220c8e2
name: cbi-oi-kubecost-exporter
Expand All @@ -13,7 +23,7 @@ entries:
version: 1.4.2
- apiVersion: v2
appVersion: "1.4"
created: "2023-10-19T16:26:14.24105-06:00"
created: "2023-10-27T17:36:14.534766-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: ab6992a0af9f24d5c090db71679b7f274f3576b1cfbe91325e0d6e9af317657e
name: cbi-oi-kubecost-exporter
Expand All @@ -23,7 +33,7 @@ entries:
version: 1.4.1
- apiVersion: v2
appVersion: "1.4"
created: "2023-10-19T16:26:14.240691-06:00"
created: "2023-10-27T17:36:14.534469-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: 870030e989ba274f8b0f9d122a4ada24a4d29ef2c071408bf46d86e18942effd
name: cbi-oi-kubecost-exporter
Expand All @@ -33,7 +43,7 @@ entries:
version: 1.4.0
- apiVersion: v2
appVersion: "1.3"
created: "2023-10-19T16:26:14.24028-06:00"
created: "2023-10-27T17:36:14.534135-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: 0d967927bfab5f4bb6d40ce062710679e98b145c4b3f38709c0bf5d216ad8606
name: cbi-oi-kubecost-exporter
Expand All @@ -43,7 +53,7 @@ entries:
version: 1.3.0
- apiVersion: v2
appVersion: "1.2"
created: "2023-10-19T16:26:14.239255-06:00"
created: "2023-10-27T17:36:14.533242-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: d0c724c7bb085a1801e27f60ff748bc69aba14425cfd27fd132f99966692ed80
name: cbi-oi-kubecost-exporter
Expand All @@ -53,12 +63,12 @@ entries:
version: 1.2.0
- apiVersion: v2
appVersion: "1.1"
created: "2023-10-19T16:26:14.238861-06:00"
created: "2023-10-27T17:36:14.53289-06:00"
description: Kubecost exporter helm chart for Kubernetes
digest: c6f2681575b704b5934efea2357921896d55c4ad5e09692f31ab92b9e614cfea
name: cbi-oi-kubecost-exporter
type: application
urls:
- helm-chart/cbi-oi-kubecost-exporter-1.1.0.tgz
version: 1.1.0
generated: "2023-10-19T16:26:14.237939-06:00"
generated: "2023-10-27T17:36:14.53225-06:00"
Loading

0 comments on commit fd6f936

Please sign in to comment.