diff --git a/README.md b/README.md index 909ebcb..1493378 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# OpenCost Helm Chart +# OpenCost Helm Charts [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Chart Publish](https://github.com/opencost/opencost-helm-chart/workflows/chart-publish/badge.svg?branch=main) [![Releases downloads](https://img.shields.io/github/downloads/opencost/opencost-helm-chart/total.svg)](https://github.com/opencost/opencost-helm-charts/releases) +This repository holds both the primary [OpenCost Helm Chart](charts/opencost/) and the [Prometheus OpenCost Exporter Helm Chart](charts/prometheus-opencost-exporter/). The Prometheus OpenCost Exporter is co-located in https://github.com/prometheus-community/helm-charts and this is the originating repository. + ## Maintainers | Name | Email | Url | diff --git a/charts/prometheus-opencost-exporter/.helmignore b/charts/prometheus-opencost-exporter/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/prometheus-opencost-exporter/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/prometheus-opencost-exporter/Chart.yaml b/charts/prometheus-opencost-exporter/Chart.yaml new file mode 100644 index 0000000..f98d3fc --- /dev/null +++ b/charts/prometheus-opencost-exporter/Chart.yaml @@ -0,0 +1,16 @@ +appVersion: 1.106.3 +version: 0.1.0 +description: Prometheus OpenCost Exporter +home: https://github.com/opencost/opencost-helm-chart +name: prometheus-opencost-exporter +sources: +- https://github.com/prometheus-community/opencost_exporter +apiVersion: v2 +type: application +keywords: +- opencost +- prometheus +- exporter +maintainers: +- email: mattray@kubecost.com + name: mattray diff --git a/charts/prometheus-opencost-exporter/README.md b/charts/prometheus-opencost-exporter/README.md new file mode 100644 index 0000000..a3f731a --- /dev/null +++ b/charts/prometheus-opencost-exporter/README.md @@ -0,0 +1,55 @@ +# Prometheus Opencost Exporter + +Prometheus exporter for [OpenCost](https://www.opencost.io) Kubernetes cost monitoring data. + +This chart bootstraps a Prometheus [OpenCost exporter](https://github.com/prometheus-community/opencost_exporter) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- Kubernetes 1.23+ +- Helm 3+ + +## Add Helm Chart Repository + +```console +helm repo add prometheus-community https://prometheus-community.github.io/helm-charts +helm repo update +``` + +_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._ + +## Install Chart + +```console +helm install [RELEASE_NAME] prometheus-community/prometheus-opencost-exporter +``` + +_See [configuration](#configuring) below._ + +_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._ + +## Uninstall Chart + +```console +helm uninstall [RELEASE_NAME] +``` + +This removes all the Kubernetes components associated with the chart and deletes the release. + +_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._ + +### Other minor version upgrade + +```console +helm upgrade [RELEASE_NAME] [CHART] --install +``` + +_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ + +## Configuring + +See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands: + +```console +helm show values prometheus-community/prometheus-opencost-exporter +``` diff --git a/charts/prometheus-opencost-exporter/opencost-exporter.yaml b/charts/prometheus-opencost-exporter/opencost-exporter.yaml new file mode 100644 index 0000000..72a2398 --- /dev/null +++ b/charts/prometheus-opencost-exporter/opencost-exporter.yaml @@ -0,0 +1,178 @@ +--- + +# The namespace opencost will run in +apiVersion: v1 +kind: Namespace +metadata: + name: opencost-exporter +--- + +# Service account for permissions +apiVersion: v1 +kind: ServiceAccount +metadata: + name: opencost +--- + +# Cluster role giving opencost to get, list, watch required resources +# No write permissions are required +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: opencost +rules: + - apiGroups: + - '' + resources: + - configmaps + - deployments + - nodes + - pods + - services + - resourcequotas + - replicationcontrollers + - limitranges + - persistentvolumeclaims + - persistentvolumes + - namespaces + - endpoints + verbs: + - get + - list + - watch + - apiGroups: + - extensions + resources: + - daemonsets + - deployments + - replicasets + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - statefulsets + - deployments + - daemonsets + - replicasets + verbs: + - list + - watch + - apiGroups: + - batch + resources: + - cronjobs + - jobs + verbs: + - get + - list + - watch + - apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - get + - list + - watch + - apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - get + - list + - watch + - apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - get + - list + - watch + +--- + +# Bind the role to the service account +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: opencost +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: opencost +subjects: + - kind: ServiceAccount + name: opencost + namespace: opencost-exporter +--- + +# Create a deployment for a single cost model pod +# +# See environment variables if you would like to add a Prometheus for +# cost model to read from for full functionality. +apiVersion: apps/v1 +kind: Deployment +metadata: + name: opencost + labels: + app: opencost +spec: + replicas: 1 + selector: + matchLabels: + app: opencost + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + app: opencost + spec: + restartPolicy: Always + serviceAccountName: opencost + containers: + - image: quay.io/kubecost1/kubecost-cost-model:latest + name: opencost + resources: + requests: + cpu: "10m" + memory: "55M" + limits: + cpu: "999m" + memory: "1G" + env: + - name: PROMETHEUS_SERVER_ENDPOINT + value: "http://my-prometheus-server.prometheus.svc" # The endpoint should have the form http://..svc + - name: CLOUD_PROVIDER_API_KEY + value: "AIzaSyD29bGxmHAVEOBYtgd8sYM2gM2ekfxQX4U" # The GCP Pricing API requires a key. This is supplied just for evaluation. + - name: CLUSTER_ID + value: "cluster-one" # Default cluster ID to use if cluster_id is not set in Prometheus metrics. + imagePullPolicy: Always +--- + +# Expose the cost model with a service +# +# Without a Prometheus endpoint configured in the deployment, +# only opencost/metrics will have useful data as it is intended +# to be used as just an exporter. +kind: Service +apiVersion: v1 +metadata: + name: opencost +spec: + selector: + app: opencost + type: ClusterIP + ports: + - name: opencost + port: 9003 + targetPort: 9003 +--- \ No newline at end of file diff --git a/charts/prometheus-opencost-exporter/templates/_helpers.tpl b/charts/prometheus-opencost-exporter/templates/_helpers.tpl new file mode 100644 index 0000000..6eea184 --- /dev/null +++ b/charts/prometheus-opencost-exporter/templates/_helpers.tpl @@ -0,0 +1,99 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "prometheus-opencost-exporter.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "prometheus-opencost-exporter.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "prometheus-opencost-exporter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "prometheus-opencost-exporter.labels" -}} +helm.sh/chart: {{ include "prometheus-opencost-exporter.chart" . }} +{{ include "prometheus-opencost-exporter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "prometheus-opencost-exporter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "prometheus-opencost-exporter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "prometheus-opencost-exporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "prometheus-opencost-exporter.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "prometheus-opencost-exporter.prometheus.secretname" -}} + {{- if .Values.opencost.prometheus.secret_name -}} + {{- .Values.opencost.prometheus.secret_name -}} + {{- else -}} + {{- include "prometheus-opencost-exporter.fullname" . -}} + {{- end -}} +{{- end -}} + +{{/* +Create the name of the controller service account to use +*/}} +{{- define "prometheus-opencost-exporter.prometheusServerEndpoint" -}} + {{- if .Values.opencost.prometheus.external.enabled -}} + {{ tpl .Values.opencost.prometheus.external.url . }} + {{- else -}} + {{- $host := tpl .Values.opencost.prometheus.internal.serviceName . }} + {{- $ns := tpl .Values.opencost.prometheus.internal.namespaceName . }} + {{- $port := .Values.opencost.prometheus.internal.port | int }} + {{- printf "http://%s.%s.svc:%d" $host $ns $port -}} + {{- end -}} +{{- end -}} + + +{{/* +Check that either prometheus external or internal is defined +*/}} +{{- define "isPrometheusConfigValid" -}} + {{- if and .Values.opencost.prometheus.external.enabled .Values.opencost.prometheus.internal.enabled -}} + {{- fail "Only use one of the prometheus setups, internal or external" -}} + {{- end -}} +{{- end -}} diff --git a/charts/prometheus-opencost-exporter/templates/clusterrole.yaml b/charts/prometheus-opencost-exporter/templates/clusterrole.yaml new file mode 100644 index 0000000..a2dd055 --- /dev/null +++ b/charts/prometheus-opencost-exporter/templates/clusterrole.yaml @@ -0,0 +1,79 @@ +# Cluster role giving opencost to get, list, watch required resources +# No write permissions are required +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ include "prometheus-opencost-exporter.fullname" . }} + labels: {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: + - configmaps + - deployments + - nodes + - pods + - services + - resourcequotas + - replicationcontrollers + - limitranges + - persistentvolumeclaims + - persistentvolumes + - namespaces + - endpoints + verbs: + - get + - list + - watch + - apiGroups: + - extensions + resources: + - daemonsets + - deployments + - replicasets + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - statefulsets + - deployments + - daemonsets + - replicasets + verbs: + - list + - watch + - apiGroups: + - batch + resources: + - cronjobs + - jobs + verbs: + - get + - list + - watch + - apiGroups: + - autoscaling + resources: + - horizontalpodautoscalers + verbs: + - get + - list + - watch + - apiGroups: + - policy + resources: + - poddisruptionbudgets + verbs: + - get + - list + - watch + - apiGroups: + - storage.k8s.io + resources: + - storageclasses + verbs: + - get + - list + - watch diff --git a/charts/prometheus-opencost-exporter/templates/clusterrolebinding.yaml b/charts/prometheus-opencost-exporter/templates/clusterrolebinding.yaml new file mode 100644 index 0000000..5230567 --- /dev/null +++ b/charts/prometheus-opencost-exporter/templates/clusterrolebinding.yaml @@ -0,0 +1,18 @@ +{{- if .Values.rbac.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ include "prometheus-opencost-exporter.fullname" . }} + labels: {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ include "prometheus-opencost-exporter.fullname" . }} +subjects: + - kind: ServiceAccount + name: {{ template "prometheus-opencost-exporter.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/charts/prometheus-opencost-exporter/templates/deployment.yaml b/charts/prometheus-opencost-exporter/templates/deployment.yaml new file mode 100644 index 0000000..1df485a --- /dev/null +++ b/charts/prometheus-opencost-exporter/templates/deployment.yaml @@ -0,0 +1,168 @@ +{{- include "isPrometheusConfigValid" . }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "prometheus-opencost-exporter.fullname" . }} + labels: {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} + {{- with .Values.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.opencost.exporter.replicas }} + selector: + matchLabels: {{- include "prometheus-opencost-exporter.selectorLabels" . | nindent 6 }} + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + {{- include "prometheus-opencost-exporter.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.podAnnotations }} + annotations: {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.priorityClassName }} + priorityClassName: {{ . }} + {{- end }} + {{- with .Values.podSecurityContext }} + securityContext: {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ template "prometheus-opencost-exporter.serviceAccountName" . }} + {{- with .Values.opencost.tolerations }} + tolerations: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.opencost.nodeSelector }} + nodeSelector: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.opencost.affinity }} + affinity: {{- toYaml . | nindent 8 }} + {{- end }} + {{- with.Values.opencost.topologySpreadConstraints }} + topologySpreadConstraints: {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ include "prometheus-opencost-exporter.fullname" . }} + image: "{{ .Values.opencost.exporter.image.registry }}/{{ .Values.opencost.exporter.image.repository }}:{{ .Values.opencost.exporter.image.tag | default (printf "prod-%s" .Chart.AppVersion) }}" + imagePullPolicy: {{ .Values.opencost.exporter.image.pullPolicy }} + ports: + - containerPort: 9003 + name: http + resources: {{- toYaml .Values.opencost.exporter.resources | nindent 12 }} + {{- if .Values.opencost.exporter.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: /healthz + port: 9003 + initialDelaySeconds: {{ .Values.opencost.exporter.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.opencost.exporter.livenessProbe.periodSeconds }} + failureThreshold: {{ .Values.opencost.exporter.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.opencost.exporter.readinessProbe.enabled }} + readinessProbe: + httpGet: + path: /healthz + port: 9003 + initialDelaySeconds: {{ .Values.opencost.exporter.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.opencost.exporter.readinessProbe.periodSeconds }} + failureThreshold: {{ .Values.opencost.exporter.readinessProbe.failureThreshold }} + {{- end }} + {{- with .Values.opencost.exporter.securityContext }} + securityContext: {{- toYaml . | nindent 12 }} + {{- end }} + env: + - name: PROMETHEUS_SERVER_ENDPOINT + value: {{ include "prometheus-opencost-exporter.prometheusServerEndpoint" . | quote }} + {{- if .Values.opencost.exporter.cloudProviderApiKey }} + - name: CLOUD_PROVIDER_API_KEY + value: {{ .Values.opencost.exporter.cloudProviderApiKey | quote }} + {{- end }} + - name: CLUSTER_ID + value: {{ .Values.opencost.exporter.defaultClusterId | quote }} + {{- if .Values.opencost.exporter.aws.access_key_id }} + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: {{ include "prometheus-opencost-exporter.prometheus.secretname" . }} + key: AWS_ACCESS_KEY_ID + {{- end }} + {{- if .Values.opencost.exporter.aws.secret_access_key }} + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: {{ include "prometheus-opencost-exporter.prometheus.secretname" . }} + key: AWS_SECRET_ACCESS_KEY + {{- end }} + # If username, password or bearer_token are defined, pull from secrets + {{- if or .Values.opencost.prometheus.username (and .Values.opencost.prometheus.secret_name .Values.opencost.prometheus.username_key) }} + - name: DB_BASIC_AUTH_USERNAME + valueFrom: + secretKeyRef: + name: {{ include "prometheus-opencost-exporter.prometheus.secretname" . }} + key: {{ .Values.opencost.prometheus.username_key }} + {{- end }} + {{- if or .Values.opencost.prometheus.password (and .Values.opencost.prometheus.secret_name .Values.opencost.prometheus.password_key) }} + - name: DB_BASIC_AUTH_PW + valueFrom: + secretKeyRef: + name: {{ include "prometheus-opencost-exporter.prometheus.secretname" . }} + key: {{ .Values.opencost.prometheus.password_key }} + {{- else if or .Values.opencost.prometheus.bearer_token (and .Values.opencost.prometheus.secret_name .Values.opencost.prometheus.bearer_token_key) }} + - name: DB_BEARER_TOKEN + valueFrom: + secretKeyRef: + name: {{ include "prometheus-opencost-exporter.prometheus.secretname" . }} + key: {{ .Values.opencost.prometheus.bearer_token_key }} + {{- end }} + {{- with .Values.opencost.exporter.env }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.opencost.customPricing.enabled }} + - name: CONFIG_PATH + value: {{ .Values.opencost.customPricing.configPath | quote }} + {{- end }} + # Add any additional provided variables + {{- range $key, $value := .Values.opencost.exporter.extraEnv }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- if or .Values.opencost.exporter.persistence.enabled .Values.opencost.exporter.extraVolumeMounts .Values.opencost.customPricing.enabled}} + volumeMounts: + {{- if .Values.opencost.exporter.persistence.enabled }} + - mountPath: /mnt/export + name: opencost-export + readOnly: false + {{- end }} + {{- if .Values.opencost.customPricing.enabled }} + - mountPath: {{ .Values.opencost.customPricing.configPath }} + name: custom-configs + readOnly: true + {{- end }} + {{- with .Values.opencost.exporter.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} + {{- if or .Values.opencost.exporter.persistence.enabled .Values.extraVolumes .Values.opencost.customPricing.enabled}} + volumes: + {{- if .Values.opencost.customPricing.enabled }} + - name: custom-configs + configMap: + name: {{ .Values.opencost.customPricing.configmapName }} + {{- end }} + {{- if .Values.opencost.exporter.persistence.enabled }} + - name: opencost-export + persistentVolumeClaim: + claimName: {{ include "prometheus-opencost-exporter.fullname" . }}-pvc + {{- end }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} diff --git a/charts/prometheus-opencost-exporter/templates/service.yaml b/charts/prometheus-opencost-exporter/templates/service.yaml new file mode 100644 index 0000000..ecf7723 --- /dev/null +++ b/charts/prometheus-opencost-exporter/templates/service.yaml @@ -0,0 +1,21 @@ +{{- if .Values.service.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "prometheus-opencost-exporter.fullname" . }} + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} + {{- with .Values.service.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.service.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: {{- include "prometheus-opencost-exporter.selectorLabels" . | nindent 4 }} + type: {{ .Values.service.type }} + ports: + - name: http + port: 9003 + targetPort: 9003 +{{- end }} diff --git a/charts/prometheus-opencost-exporter/templates/serviceaccount.yaml b/charts/prometheus-opencost-exporter/templates/serviceaccount.yaml new file mode 100644 index 0000000..c427aeb --- /dev/null +++ b/charts/prometheus-opencost-exporter/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "prometheus-opencost-exporter.serviceAccountName" . }} + labels: {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} +{{- end }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/.helmignore b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/Chart.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/Chart.yaml new file mode 100644 index 0000000..f6c1163 --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: prometheus-opencost-exporter +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# 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: 0.1.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.16.0" diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/NOTES.txt b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/NOTES.txt new file mode 100644 index 0000000..413781e --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "prometheus-opencost-exporter.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "prometheus-opencost-exporter.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "prometheus-opencost-exporter.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "prometheus-opencost-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/_helpers.tpl b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/_helpers.tpl new file mode 100644 index 0000000..c8bd763 --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "prometheus-opencost-exporter.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "prometheus-opencost-exporter.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "prometheus-opencost-exporter.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "prometheus-opencost-exporter.labels" -}} +helm.sh/chart: {{ include "prometheus-opencost-exporter.chart" . }} +{{ include "prometheus-opencost-exporter.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "prometheus-opencost-exporter.selectorLabels" -}} +app.kubernetes.io/name: {{ include "prometheus-opencost-exporter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "prometheus-opencost-exporter.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "prometheus-opencost-exporter.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/deployment.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/deployment.yaml new file mode 100644 index 0000000..733aeb3 --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "prometheus-opencost-exporter.fullname" . }} + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "prometheus-opencost-exporter.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "prometheus-opencost-exporter.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/hpa.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/hpa.yaml new file mode 100644 index 0000000..b4c67f1 --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "prometheus-opencost-exporter.fullname" . }} + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "prometheus-opencost-exporter.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/ingress.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/ingress.yaml new file mode 100644 index 0000000..caf44c1 --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "prometheus-opencost-exporter.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/service.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/service.yaml new file mode 100644 index 0000000..98cf4ed --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "prometheus-opencost-exporter.fullname" . }} + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "prometheus-opencost-exporter.selectorLabels" . | nindent 4 }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/serviceaccount.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/serviceaccount.yaml new file mode 100644 index 0000000..c871e37 --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "prometheus-opencost-exporter.serviceAccountName" . }} + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/tests/test-connection.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/tests/test-connection.yaml new file mode 100644 index 0000000..660058c --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "prometheus-opencost-exporter.fullname" . }}-test-connection" + labels: + {{- include "prometheus-opencost-exporter.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "prometheus-opencost-exporter.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/values.yaml b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/values.yaml new file mode 100644 index 0000000..e41bd66 --- /dev/null +++ b/charts/prometheus-opencost-exporter/tmp/prometheus-opencost-exporter/values.yaml @@ -0,0 +1,98 @@ +# Default values for prometheus-opencost-exporter. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Automatically mount a ServiceAccount's API credentials? + automount: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] +# - name: foo +# secret: +# secretName: mysecret +# optional: false + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: [] +# - name: foo +# mountPath: "/etc/foo" +# readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/prometheus-opencost-exporter/values.yaml b/charts/prometheus-opencost-exporter/values.yaml new file mode 100644 index 0000000..485373c --- /dev/null +++ b/charts/prometheus-opencost-exporter/values.yaml @@ -0,0 +1,176 @@ +# -- Overwrite the default name of the chart +nameOverride: "" +# -- Overwrite all resources name created by the chart +fullnameOverride: "" + +# -- List of secret names to use for pulling the images +imagePullSecrets: [] + +serviceAccount: + # -- Specifies whether a service account should be created + create: true + # -- Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + # -- Whether pods running as this service account should have an API token automatically mounted + automountServiceAccountToken: true + +# -- Annotations to add to the all the resources +annotations: {} +# -- Annotations to add to the OpenCost Pod +podAnnotations: {} +# -- Annotations to add to the Secret +secretAnnotations: {} +# -- Labels to add to the OpenCost Pod +podLabels: {} +# -- Pod priority +priorityClassName: ~ + +# -- Holds pod-level security attributes and common container settings +podSecurityContext: {} + # fsGroup: 2000 + +service: + enabled: true + # -- Annotations to add to the service + annotations: {} + # -- Labels to add to the service account + labels: {} + # -- Kubernetes Service type + type: ClusterIP + +# Create cluster role policies +rbac: + enabled: true + +opencost: + exporter: + # -- The GCP Pricing API requires a key. This is supplied just for evaluation. + cloudProviderApiKey: "" + # -- Default cluster ID to use if cluster_id is not set in Prometheus metrics. + defaultClusterId: 'default-cluster' + image: + # -- Exporter container image registry + registry: quay.io + # -- Exporter container image name + repository: kubecost1/kubecost-cost-model + # -- Exporter container image tag + # @default -- `""` (use appVersion in Chart.yaml) + tag: "" + # -- Exporter container image pull policy + pullPolicy: IfNotPresent + # -- Number of OpenCost replicas to run + replicas: 1 + resources: + # -- CPU/Memory resource requests + requests: + cpu: '10m' + memory: '55Mi' + # -- CPU/Memory resource limits + limits: + cpu: '999m' + memory: '1Gi' + # Liveness probe configuration + livenessProbe: + # -- Whether probe is enabled + enabled: true + # -- Number of seconds before probe is initiated + initialDelaySeconds: 120 + # -- Probe frequency in seconds + periodSeconds: 10 + # -- Number of failures for probe to be considered failed + failureThreshold: 3 + # Readiness probe configuration + readinessProbe: + # -- Whether probe is enabled + enabled: true + # -- Number of seconds before probe is initiated + initialDelaySeconds: 120 + # -- Probe frequency in seconds + periodSeconds: 10 + # -- Number of failures for probe to be considered failed + failureThreshold: 3 + # -- The security options the container should be run with + securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + # Persistent volume claim for storing the data. eg: csv file + persistence: + enabled: false + # -- Annotations for persistent volume + annotations: {} + # -- Access mode for persistent volume + accessMode: "" + # -- Storage class for persistent volume + storageClass: "" + # -- Size for persistent volume + size: "" + + aws: + # -- AWS secret access key + secret_access_key: "" + # -- AWS secret key id + access_key_id: "" + # -- A list of volume mounts to be added to the pod + extraVolumeMounts: [] + # -- List of additional environment variables to set in the container + env: [] + # -- Any extra environment variables you would like to pass on to the pod + extraEnv: {} + # FOO: BAR + customPricing: + # -- Enables custom pricing for on-premise setup. + enabled: false + configmapName: custom-pricing-model + # -- Path for the pricing configuration. + configPath: /tmp/custom-config + # -- Configures the pricing model provided in the values file. + createConfigmap: true + # -- More information about these values here: https://www.opencost.io/docs/configuration/on-prem#custom-pricing-using-the-opencost-helm-chart + costModel: + description: Modified prices based on your internal pricing + CPU: 1.25 + spotCPU: 0.006655 + RAM: 0.50 + spotRAM: 0.000892 + GPU: 0.95 + storage: 0.25 + zoneNetworkEgress: 0.01 + regionNetworkEgress: 0.01 + internetNetworkEgress: 0.12 + + prometheus: + # -- Secret name that contains credentials for Prometheus + secret_name: ~ + # -- Prometheus Basic auth username + username: "" + # -- Key in the secret that references the username + username_key: DB_BASIC_AUTH_USERNAME + # -- Prometheus Basic auth password + password: "" + # -- Key in the secret that references the password + password_key: DB_BASIC_AUTH_PW + # -- Prometheus Bearer token + bearer_token: "" + bearer_token_key: DB_BEARER_TOKEN + external: + # -- Use external Prometheus (eg. Grafana Cloud) + enabled: false + # -- External Prometheus url + url: "https://prometheus.example.com/prometheus" + internal: + # -- Use in-cluster Prometheus + enabled: true + # -- Service name of in-cluster Prometheus + serviceName: my-prometheus + # -- Namespace of in-cluster Prometheus + namespaceName: opencost + # -- Service port of in-cluster Prometheus + port: 9090