Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #22 from kubecost/1.105
Browse files Browse the repository at this point in the history
Kubecost 1.105.0
  • Loading branch information
jessegoodier authored Jul 20, 2023
2 parents 567986d + fb1f8b6 commit dbe384f
Show file tree
Hide file tree
Showing 46 changed files with 612 additions and 737 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
4 changes: 2 additions & 2 deletions cost-analyzer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ annotations:
- name: Homepage
url: https://www.kubecost.com
apiVersion: v2
appVersion: 1.103.2
appVersion: 1.105.0
dependencies:
- condition: global.grafana.enabled
name: grafana
Expand All @@ -20,4 +20,4 @@ dependencies:
description: A Helm chart that sets up Kubecost, Prometheus, and Grafana to monitor
cloud costs.
name: cost-analyzer
version: 1.103.2
version: 1.105.0
91 changes: 46 additions & 45 deletions cost-analyzer/README.md

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions cost-analyzer/charts/grafana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
type: {{ .Values.deploymentStrategy }}
{{- if ne .Values.deploymentStrategy "RollingUpdate" }}
rollingUpdate: null
{{- end }}
{{- end }}
template:
metadata:
labels:
Expand All @@ -45,12 +45,12 @@ spec:
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
{{- if .Values.dashboards }}
initContainers:
- name: download-dashboards
{{- if .Values.initContainers.containerSecurityContext }}
{{- toYaml .Values.initContainers.containerSecurityContext | nindent 10 }}
{{- end }}
image: "{{ .Values.downloadDashboardsImage.repository }}:{{ .Values.downloadDashboardsImage.tag }}"
imagePullPolicy: {{ .Values.downloadDashboardsImage.pullPolicy }}
command: ["sh", "/etc/grafana/download_dashboards.sh"]
Expand Down Expand Up @@ -79,8 +79,8 @@ spec:
{{- if .Values.sidecar.containerSecurityContext }}
{{- toYaml .Values.sidecar.containerSecurityContext | nindent 10 }}
{{- end }}
image: "{{ .Values.sidecar.image }}"
imagePullPolicy: {{ .Values.sidecar.imagePullPolicy }}
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
env:
- name: LABEL
value: "{{ .Values.sidecar.dashboards.label }}"
Expand All @@ -99,8 +99,8 @@ spec:
{{- if .Values.sidecar.containerSecurityContext }}
{{- toYaml .Values.sidecar.containerSecurityContext | nindent 10 }}
{{- end }}
image: "{{ .Values.sidecar.image }}"
imagePullPolicy: {{ .Values.sidecar.imagePullPolicy }}
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
imagePullPolicy: {{ .Values.sidecar.image.pullPolicy }}
env:
- name: LABEL
value: "{{ .Values.sidecar.datasources.label }}"
Expand Down
12 changes: 9 additions & 3 deletions cost-analyzer/charts/grafana/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
rbac:
create: true
pspEnabled: true
pspEnabled: false
pspUseAppArmor: true
serviceAccount:
create: true
Expand Down Expand Up @@ -257,8 +257,10 @@ smtp:
## Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders
## Requires at least Grafana 5 to work and can't be used together with parameters dashboardProviders, datasources and dashboards
sidecar:
image: kiwigrid/k8s-sidecar:1.23.1
imagePullPolicy: IfNotPresent
image:
repository: kiwigrid/k8s-sidecar
tag: 1.23.1
pullPolicy: IfNotPresent
resources:
# limits:
# cpu: 100m
Expand All @@ -276,3 +278,7 @@ sidecar:
enabled: false
# label that the configmaps with datasources are marked with
label: grafana_datasource

## PriorityClassName
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
priorityClassName: ""
2 changes: 2 additions & 0 deletions cost-analyzer/charts/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Parameter | Description | Default
`alertmanager.strategy` | Deployment strategy | `{ "type": "RollingUpdate" }`
`alertmanagerFiles.alertmanager.yml` | Prometheus alertmanager configuration | example configuration
`configmapReload.prometheus.enabled` | If false, the configmap-reload container for Prometheus will not be deployed | `true`
`configmapReload.prometheus.containerSecurityContext` | securityContext for container | `{}`
`configmapReload.prometheus.name` | configmap-reload container name | `configmap-reload`
`configmapReload.prometheus.image.repository` | configmap-reload container image repository | `jimmidyson/configmap-reload`
`configmapReload.prometheus.image.tag` | configmap-reload container image tag | `v0.5.0`
Expand Down Expand Up @@ -320,6 +321,7 @@ Parameter | Description | Default
`server.persistentVolume.storageClass` | Prometheus server data Persistent Volume Storage Class | `unset`
`server.persistentVolume.volumeBindingMode` | Prometheus server data Persistent Volume Binding Mode | `unset`
`server.persistentVolume.subPath` | Subdirectory of Prometheus server data Persistent Volume to mount | `""`
`server.containerSecurityContext` | securityContext for container | `{}`
`server.emptyDir.sizeLimit` | emptyDir sizeLimit if a Persistent Volume is not used | `""`
`server.podAnnotations` | annotations to be added to Prometheus server pods | `{}`
`server.podLabels` | labels to be added to Prometheus server pods | `{}`
Expand Down
17 changes: 12 additions & 5 deletions cost-analyzer/charts/prometheus/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ spec:
{{- end }}
resources:
{{ toYaml .Values.configmapReload.prometheus.resources | indent 12 }}
{{- with .Values.configmapReload.prometheus.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.selfsignedCertConfigMapName }}
- name: {{ .Values.selfsignedCertConfigMapName }}
Expand All @@ -83,9 +87,6 @@ spec:

- name: {{ template "prometheus.name" . }}-{{ .Values.server.name }}
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
{{- if .Values.server.containerSecurityContext }}
{{- toYaml .Values.server.containerSecurityContext | nindent 10 }}
{{- end }}
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
{{- if .Values.server.env }}
env:
Expand All @@ -94,6 +95,9 @@ spec:
args:
{{- if .Values.server.retention }}
- --storage.tsdb.retention.time={{ .Values.server.retention }}
{{- end }}
{{- if .Values.server.retentionSize }}
- --storage.tsdb.retention.size={{ .Values.server.retentionSize }}
{{- end }}
- --config.file={{ .Values.server.configPath }}
- --storage.tsdb.path={{ .Values.server.persistentVolume.mountPath }}
Expand Down Expand Up @@ -128,7 +132,11 @@ spec:
failureThreshold: {{ .Values.server.livenessProbeFailureThreshold }}
successThreshold: {{ .Values.server.livenessProbeSuccessThreshold }}
resources:
{{ toYaml .Values.server.resources | indent 12 }}
{{ toYaml .Values.server.resources | indent 12 }}
{{- with .Values.server.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config-volume
mountPath: /etc/config
Expand Down Expand Up @@ -158,7 +166,6 @@ spec:
{{- end }}
{{- if .Values.server.sidecarContainers }}
{{- toYaml .Values.server.sidecarContainers | nindent 8 }}
{{- toYaml .Values.sidecarContainers.containerSecurityContext | nindent 10 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
6 changes: 4 additions & 2 deletions cost-analyzer/charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ configmapReload:
##
extraVolumeDirs: []


## Additional configmap-reload mounts
##
extraConfigmapMounts: []
Expand All @@ -339,11 +338,14 @@ configmapReload:
# configMap: prometheus-alerts
# readOnly: true


## configmap-reload resource requests and limits
## Ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}

## configmap-reload container securityContext
containerSecurityContext: {}

alertmanager:
## If false, the configmap-reload container will not be deployed
##
Expand Down
3 changes: 3 additions & 0 deletions cost-analyzer/charts/thanos/templates/bucket-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
containers:
- name: thanos-bucket
Expand Down
3 changes: 3 additions & 0 deletions cost-analyzer/charts/thanos/templates/compact-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
containers:
- name: thanos-compact
Expand Down
3 changes: 3 additions & 0 deletions cost-analyzer/charts/thanos/templates/query-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
containers:
- name: thanos-query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
containers:
- name: thanos-query-frontend
Expand Down
3 changes: 3 additions & 0 deletions cost-analyzer/charts/thanos/templates/store-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ spec:
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
containers:
- name: thanos-store
Expand Down
4 changes: 4 additions & 0 deletions cost-analyzer/charts/thanos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ image:
tag: v0.29.0
pullPolicy: IfNotPresent

## PriorityClassName
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
priorityClassName: ""

store:
enabled: true
# Maximum size of items held in the index cache.
Expand Down
27 changes: 26 additions & 1 deletion cost-analyzer/grafana-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Kubecost, by default, ships with a Grafana instance that already contains the dashboards in this repo.
Kubecost, by default, is bundled with a Grafana instance that already contains the dashboards in this repo.

The dashboards in this repo are templated for those wanting to load the dashboards into an existing Grafana instance.

Expand All @@ -14,6 +14,31 @@ The primary purpose of the dashboards provided is to allow visibility into the m

The networkCosts-metrics dashboard requires the optional networkCosts daemonset to be [enabled](https://docs.kubecost.com/install-and-configure/advanced-configuration/network-costs-configuration).

## Metrics Required

`kubecost-container-stats` metrics:

```
container_cpu_usage_seconds_total
kube_pod_container_resource_requests
container_memory_working_set_bytes
container_cpu_cfs_throttled_periods_total
container_cpu_cfs_periods_total
```

`network-transfer-data` metrics:

```
kubecost_pod_network_ingress_bytes_total
kubecost_pod_network_egress_bytes_total
```

`disk-usage` metrics:
```
container_fs_limit_bytes
container_fs_usage_bytes
```

## Additional Information

Kubecost Grafana [Configuration Guide](https://docs.kubecost.com/install-and-configure/install/custom-grafana)
Loading

0 comments on commit dbe384f

Please sign in to comment.