From 061071538a765a63bf64ff16c6c55ef4352c4958 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Fri, 6 Oct 2023 18:18:00 +1100 Subject: [PATCH 1/9] Initial commits Signed-off-by: Matt Ray --- .../prometheus-opencost-exporter/.helmignore | 23 ++++++++ charts/prometheus-opencost-exporter/README.md | 55 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 charts/prometheus-opencost-exporter/.helmignore create mode 100644 charts/prometheus-opencost-exporter/README.md diff --git a/charts/prometheus-opencost-exporter/.helmignore b/charts/prometheus-opencost-exporter/.helmignore new file mode 100644 index 000000000000..0e8a0eb36f4c --- /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/README.md b/charts/prometheus-opencost-exporter/README.md new file mode 100644 index 000000000000..a3f731ab3a12 --- /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 +``` From 9da0ff3a7a9e5a7a417f4ec4b2092fafb2576158 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Fri, 6 Oct 2023 18:18:23 +1100 Subject: [PATCH 2/9] Migrated over ServiceAccount from the opencost-helm-chart repo Signed-off-by: Matt Ray --- .../prometheus-opencost-exporter/Chart.yaml | 16 ++ .../templates/_helpers.tpl | 63 +++++ .../templates/serviceaccount.yaml | 11 + .../prometheus-opencost-exporter/values.yaml | 257 ++++++++++++++++++ 4 files changed, 347 insertions(+) create mode 100644 charts/prometheus-opencost-exporter/Chart.yaml create mode 100644 charts/prometheus-opencost-exporter/templates/_helpers.tpl create mode 100644 charts/prometheus-opencost-exporter/templates/serviceaccount.yaml create mode 100644 charts/prometheus-opencost-exporter/values.yaml diff --git a/charts/prometheus-opencost-exporter/Chart.yaml b/charts/prometheus-opencost-exporter/Chart.yaml new file mode 100644 index 000000000000..33959c77cb92 --- /dev/null +++ b/charts/prometheus-opencost-exporter/Chart.yaml @@ -0,0 +1,16 @@ +appVersion: 1.106.2 +version: 0.1.0 +description: Prometheus OpenCost Exporter +home: https://github.com/prometheus-community/opencost_exporter +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/templates/_helpers.tpl b/charts/prometheus-opencost-exporter/templates/_helpers.tpl new file mode 100644 index 000000000000..69b789c68cb4 --- /dev/null +++ b/charts/prometheus-opencost-exporter/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* 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" -}} +chart: {{ include "prometheus-opencost-exporter.chart" . }} +{{ include "prometheus-opencost-exporter.selectorLabels" . }} +heritage: {{ .Release.Service }} +{{- if .Values.commonLabels}} +{{ toYaml .Values.commonLabels }} +{{- end }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "prometheus-opencost-exporter.selectorLabels" -}} +app: {{ include "prometheus-opencost-exporter.name" . }} +release: {{ .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/templates/serviceaccount.yaml b/charts/prometheus-opencost-exporter/templates/serviceaccount.yaml new file mode 100644 index 000000000000..c427aeba5c5e --- /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/values.yaml b/charts/prometheus-opencost-exporter/values.yaml new file mode 100644 index 000000000000..3c4b39ebb851 --- /dev/null +++ b/charts/prometheus-opencost-exporter/values.yaml @@ -0,0 +1,257 @@ +# -- 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 + +# replicaCount: 1 + +# image: +# repository: quay.io/kubecost1/kubecost-cost-model +# # if not set appVersion field from Chart.yaml is used +# tag: "" +# pullPolicy: IfNotPresent + +# ## Optionally specify an array of imagePullSecrets. +# ## Secrets must be manually created in the namespace. +# ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +# ## +# # pullSecrets: +# # - myRegistrKeySecretName + +# service: +# type: ClusterIP +# port: 9003 +# targetPort: 9003 +# name: opencost +# labels: {} +# annotations: {} + +# automountServiceAccountToken: false + +# serviceMonitor: +# # When set true then use a ServiceMonitor to configure scraping +# enabled: false +# # Set the namespace the ServiceMonitor should be deployed +# namespace: "" +# # Set how frequently Prometheus should scrape +# scrapeInterval: 30s +# # -- HonorLabels chooses the metric's labels on collisions with target labels +# honorLabels: true +# # -- RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields +# relabelings: [] +# # -- MetricRelabelConfigs to apply to samples before ingestion +# metricRelabelings: [] + +# prometheusRule: +# enabled: false +# additionalLabels: {} +# namespace: "" +# rules: [] +# ## These are just examples rules, please adapt them to your needs. +# ## Make sure to constraint the rules to the current prometheus-postgres-exporter service. +# # - alert: HugeReplicationLag +# # expr: pg_replication_lag{service="{{ template "prometheus-postgres-exporter.fullname" . }}"} / 3600 > 1 +# # for: 1m +# # labels: +# # severity: critical +# # annotations: +# # description: replication for {{ template "prometheus-postgres-exporter.fullname" . }} PostgreSQL is lagging by {{ "{{ $value }}" }} hour(s). +# # summary: PostgreSQL replication is lagging by {{ "{{ $value }}" }} hour(s). + +# 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 + +# rbac: +# # Specifies whether RBAC resources should be created +# create: true + +# serviceAccount: +# # Specifies whether a ServiceAccount should be created +# create: true +# # The name of the ServiceAccount to use. +# # If not set and create is true, a name is generated using the fullname template +# name: +# # Add annotations to the ServiceAccount, useful for EKS IAM Roles for Service Accounts or Google Workload Identity. +# annotations: {} + +# # Add a default ingress to allow namespace access to service.targetPort +# # Helpful if other NetworkPolicies are configured in the namespace +# networkPolicy: +# # Specifies whether a NetworkPolicy should be created +# enabled: false +# # Set labels for the NetworkPolicy +# labels: {} + +# # The securityContext of the pod. +# # See https://kubernetes.io/docs/concepts/policy/security-context/ for more. +# podSecurityContext: +# runAsGroup: 1001 +# runAsUser: 1001 +# runAsNonRoot: true +# seccompProfile: +# type: RuntimeDefault + +# # The securityContext of the container. +# # See https://kubernetes.io/docs/concepts/policy/security-context/ for more. +# securityContext: +# allowPrivilegeEscalation: false +# capabilities: +# drop: +# - ALL +# privileged: false +# readOnlyRootFilesystem: true + +# hostAliases: [] +# # Set Host Aliases as per https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/ +# # - ip: "127.0.0.1" +# # hostnames: +# # - "foo.local" +# # - "bar.local" + +# config: +# ## The datasource properties on config are passed through helm tpl function. +# ## ref: https://helm.sh/docs/developing_charts/#using-the-tpl-function +# datasource: +# # Specify one of both datasource or datasourceSecret +# host: '' +# user: postgres +# userSecret: {} +# # Secret name +# # name: +# # User key inside secret +# # key: +# # Only one of password, passwordFile, passwordSecret and pgpassfile can be specified +# password: +# # Specify passwordFile if DB password is stored in a file. +# # For example, to use with vault-injector from Hashicorp +# passwordFile: '' +# # Specify passwordSecret if DB password is stored in secret. +# passwordSecret: {} +# # Secret name +# # name: +# # Password key inside secret +# # key: +# pgpassfile: '' +# # If pgpassfile is set, it is used to initialize the PGPASSFILE environment variable. +# # See https://www.postgresql.org/docs/14/libpq-pgpass.html for more info. +# port: "5432" +# database: '' +# sslmode: disable +# extraParams: '' +# datasourceSecret: {} +# # Specifies if datasource should be sourced from secret value in format: postgresql://login:password@hostname:port/dbname?sslmode=disable +# # Multiple Postgres databases can be configured by comma separated postgres connection strings +# # Secret name +# # name: +# # Connection string key inside secret +# # key: +# disableCollectorDatabase: false +# disableCollectorBgwriter: false +# disableDefaultMetrics: false +# disableSettingsMetrics: false + +# # possible values debug, info, warn, error, fatal +# logLevel: "" +# # possible values logfmt, json +# logFormat: "" +# extraArgs: [] + +# # postgres_exporter.yml +# postgresExporter: "" +# # auth_modules: +# # first: +# # type: userpass +# # userpass: +# # username: first +# # password: firstpass +# # options: +# # sslmode: disable + +# nodeSelector: {} + +# tolerations: [] + +# affinity: {} + +# annotations: {} + +# podLabels: {} + +# # Configurable health checks +# livenessProbe: +# initialDelaySeconds: 0 +# timeoutSeconds: 3 + +# readinessProbe: +# initialDelaySeconds: 0 +# timeoutSeconds: 1 + +# # Labels and annotations to attach to the deployment resource +# deployment: +# labels: {} +# annotations: {} + +# # ExtraEnvs +# extraEnvs: [] +# # - name: EXTRA_ENV +# # value: value +# # - name: POD_NAMESPACE +# # valueFrom: +# # fieldRef: +# # fieldPath: metadata.namespace + +# # Init containers, e. g. for secrets creation before the exporter +# initContainers: [] +# # - name: +# # image: +# # volumeMounts: +# # - name: creds +# # mountPath: /creds + +# # Additional sidecar containers, e. g. for a database proxy, such as Google's cloudsql-proxy +# extraContainers: [] + +# # Additional volumes, e. g. for secrets used in an extraContainer +# extraVolumes: [] +# # Uncomment for mounting custom ca-certificates +# # - name: ssl-certs +# # secret: +# # defaultMode: 420 +# # items: +# # - key: ca-certificates.crt +# # path: ca-certificates.crt +# # secretName: ssl-certs + +# # Additional volume mounts +# extraVolumeMounts: [] +# # Uncomment for mounting custom ca-certificates file into container +# # - name: ssl-certs +# # mountPath: /etc/ssl/certs/ca-certificates.crt +# # subPath: ca-certificates.crt + +# podDisruptionBudget: +# enabled: false +# maxUnavailable: 1 From 72736016c8f31de35c96c532330cdef1dab9186f Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Fri, 6 Oct 2023 18:24:09 +1100 Subject: [PATCH 3/9] Imported ClusterRole and ClusterRoleBinding Signed-off-by: Matt Ray --- .../templates/clusterrole.yaml | 79 ++++++ .../templates/clusterrolebinding.yaml | 18 ++ .../prometheus-opencost-exporter/values.yaml | 241 +----------------- 3 files changed, 100 insertions(+), 238 deletions(-) create mode 100644 charts/prometheus-opencost-exporter/templates/clusterrole.yaml create mode 100644 charts/prometheus-opencost-exporter/templates/clusterrolebinding.yaml diff --git a/charts/prometheus-opencost-exporter/templates/clusterrole.yaml b/charts/prometheus-opencost-exporter/templates/clusterrole.yaml new file mode 100644 index 000000000000..a2dd0551a7ed --- /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 000000000000..523056772e9b --- /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/values.yaml b/charts/prometheus-opencost-exporter/values.yaml index 3c4b39ebb851..9094e44a97fd 100644 --- a/charts/prometheus-opencost-exporter/values.yaml +++ b/charts/prometheus-opencost-exporter/values.yaml @@ -17,241 +17,6 @@ serviceAccount: # -- Whether pods running as this service account should have an API token automatically mounted automountServiceAccountToken: true -# replicaCount: 1 - -# image: -# repository: quay.io/kubecost1/kubecost-cost-model -# # if not set appVersion field from Chart.yaml is used -# tag: "" -# pullPolicy: IfNotPresent - -# ## Optionally specify an array of imagePullSecrets. -# ## Secrets must be manually created in the namespace. -# ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ -# ## -# # pullSecrets: -# # - myRegistrKeySecretName - -# service: -# type: ClusterIP -# port: 9003 -# targetPort: 9003 -# name: opencost -# labels: {} -# annotations: {} - -# automountServiceAccountToken: false - -# serviceMonitor: -# # When set true then use a ServiceMonitor to configure scraping -# enabled: false -# # Set the namespace the ServiceMonitor should be deployed -# namespace: "" -# # Set how frequently Prometheus should scrape -# scrapeInterval: 30s -# # -- HonorLabels chooses the metric's labels on collisions with target labels -# honorLabels: true -# # -- RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields -# relabelings: [] -# # -- MetricRelabelConfigs to apply to samples before ingestion -# metricRelabelings: [] - -# prometheusRule: -# enabled: false -# additionalLabels: {} -# namespace: "" -# rules: [] -# ## These are just examples rules, please adapt them to your needs. -# ## Make sure to constraint the rules to the current prometheus-postgres-exporter service. -# # - alert: HugeReplicationLag -# # expr: pg_replication_lag{service="{{ template "prometheus-postgres-exporter.fullname" . }}"} / 3600 > 1 -# # for: 1m -# # labels: -# # severity: critical -# # annotations: -# # description: replication for {{ template "prometheus-postgres-exporter.fullname" . }} PostgreSQL is lagging by {{ "{{ $value }}" }} hour(s). -# # summary: PostgreSQL replication is lagging by {{ "{{ $value }}" }} hour(s). - -# 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 - -# rbac: -# # Specifies whether RBAC resources should be created -# create: true - -# serviceAccount: -# # Specifies whether a ServiceAccount should be created -# create: true -# # The name of the ServiceAccount to use. -# # If not set and create is true, a name is generated using the fullname template -# name: -# # Add annotations to the ServiceAccount, useful for EKS IAM Roles for Service Accounts or Google Workload Identity. -# annotations: {} - -# # Add a default ingress to allow namespace access to service.targetPort -# # Helpful if other NetworkPolicies are configured in the namespace -# networkPolicy: -# # Specifies whether a NetworkPolicy should be created -# enabled: false -# # Set labels for the NetworkPolicy -# labels: {} - -# # The securityContext of the pod. -# # See https://kubernetes.io/docs/concepts/policy/security-context/ for more. -# podSecurityContext: -# runAsGroup: 1001 -# runAsUser: 1001 -# runAsNonRoot: true -# seccompProfile: -# type: RuntimeDefault - -# # The securityContext of the container. -# # See https://kubernetes.io/docs/concepts/policy/security-context/ for more. -# securityContext: -# allowPrivilegeEscalation: false -# capabilities: -# drop: -# - ALL -# privileged: false -# readOnlyRootFilesystem: true - -# hostAliases: [] -# # Set Host Aliases as per https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/ -# # - ip: "127.0.0.1" -# # hostnames: -# # - "foo.local" -# # - "bar.local" - -# config: -# ## The datasource properties on config are passed through helm tpl function. -# ## ref: https://helm.sh/docs/developing_charts/#using-the-tpl-function -# datasource: -# # Specify one of both datasource or datasourceSecret -# host: '' -# user: postgres -# userSecret: {} -# # Secret name -# # name: -# # User key inside secret -# # key: -# # Only one of password, passwordFile, passwordSecret and pgpassfile can be specified -# password: -# # Specify passwordFile if DB password is stored in a file. -# # For example, to use with vault-injector from Hashicorp -# passwordFile: '' -# # Specify passwordSecret if DB password is stored in secret. -# passwordSecret: {} -# # Secret name -# # name: -# # Password key inside secret -# # key: -# pgpassfile: '' -# # If pgpassfile is set, it is used to initialize the PGPASSFILE environment variable. -# # See https://www.postgresql.org/docs/14/libpq-pgpass.html for more info. -# port: "5432" -# database: '' -# sslmode: disable -# extraParams: '' -# datasourceSecret: {} -# # Specifies if datasource should be sourced from secret value in format: postgresql://login:password@hostname:port/dbname?sslmode=disable -# # Multiple Postgres databases can be configured by comma separated postgres connection strings -# # Secret name -# # name: -# # Connection string key inside secret -# # key: -# disableCollectorDatabase: false -# disableCollectorBgwriter: false -# disableDefaultMetrics: false -# disableSettingsMetrics: false - -# # possible values debug, info, warn, error, fatal -# logLevel: "" -# # possible values logfmt, json -# logFormat: "" -# extraArgs: [] - -# # postgres_exporter.yml -# postgresExporter: "" -# # auth_modules: -# # first: -# # type: userpass -# # userpass: -# # username: first -# # password: firstpass -# # options: -# # sslmode: disable - -# nodeSelector: {} - -# tolerations: [] - -# affinity: {} - -# annotations: {} - -# podLabels: {} - -# # Configurable health checks -# livenessProbe: -# initialDelaySeconds: 0 -# timeoutSeconds: 3 - -# readinessProbe: -# initialDelaySeconds: 0 -# timeoutSeconds: 1 - -# # Labels and annotations to attach to the deployment resource -# deployment: -# labels: {} -# annotations: {} - -# # ExtraEnvs -# extraEnvs: [] -# # - name: EXTRA_ENV -# # value: value -# # - name: POD_NAMESPACE -# # valueFrom: -# # fieldRef: -# # fieldPath: metadata.namespace - -# # Init containers, e. g. for secrets creation before the exporter -# initContainers: [] -# # - name: -# # image: -# # volumeMounts: -# # - name: creds -# # mountPath: /creds - -# # Additional sidecar containers, e. g. for a database proxy, such as Google's cloudsql-proxy -# extraContainers: [] - -# # Additional volumes, e. g. for secrets used in an extraContainer -# extraVolumes: [] -# # Uncomment for mounting custom ca-certificates -# # - name: ssl-certs -# # secret: -# # defaultMode: 420 -# # items: -# # - key: ca-certificates.crt -# # path: ca-certificates.crt -# # secretName: ssl-certs - -# # Additional volume mounts -# extraVolumeMounts: [] -# # Uncomment for mounting custom ca-certificates file into container -# # - name: ssl-certs -# # mountPath: /etc/ssl/certs/ca-certificates.crt -# # subPath: ca-certificates.crt - -# podDisruptionBudget: -# enabled: false -# maxUnavailable: 1 +# Create cluster role policies +rbac: + enabled: true From 21c16f4bbc6cad4fb6170c2532217b14a13ccfb6 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Sat, 7 Oct 2023 11:23:31 +1100 Subject: [PATCH 4/9] Add the Deployment from opencost-helm-chart Signed-off-by: Matt Ray --- .../templates/_helpers.tpl | 36 ++++ .../templates/deployment.yaml | 168 ++++++++++++++++++ .../prometheus-opencost-exporter/values.yaml | 154 ++++++++++++++++ 3 files changed, 358 insertions(+) create mode 100644 charts/prometheus-opencost-exporter/templates/deployment.yaml diff --git a/charts/prometheus-opencost-exporter/templates/_helpers.tpl b/charts/prometheus-opencost-exporter/templates/_helpers.tpl index 69b789c68cb4..63edafc64bcc 100644 --- a/charts/prometheus-opencost-exporter/templates/_helpers.tpl +++ b/charts/prometheus-opencost-exporter/templates/_helpers.tpl @@ -61,3 +61,39 @@ Create the name of the service account to use {{ 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/deployment.yaml b/charts/prometheus-opencost-exporter/templates/deployment.yaml new file mode 100644 index 000000000000..1df485ace588 --- /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/values.yaml b/charts/prometheus-opencost-exporter/values.yaml index 9094e44a97fd..485373cb551c 100644 --- a/charts/prometheus-opencost-exporter/values.yaml +++ b/charts/prometheus-opencost-exporter/values.yaml @@ -17,6 +17,160 @@ serviceAccount: # -- 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 From 6588dd227f3343a2e94c0fbdf0d44522fe52f332 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Sat, 7 Oct 2023 11:27:44 +1100 Subject: [PATCH 5/9] Add the Service from opencost-helm-chart, edited for exporter-only Signed-off-by: Matt Ray --- .../templates/service.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 charts/prometheus-opencost-exporter/templates/service.yaml diff --git a/charts/prometheus-opencost-exporter/templates/service.yaml b/charts/prometheus-opencost-exporter/templates/service.yaml new file mode 100644 index 000000000000..ecf7723dd718 --- /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 }} From 2f0b9d1d49fe5df950c8ffa7c030d774ca9ffb65 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Tue, 17 Oct 2023 16:46:15 +1100 Subject: [PATCH 6/9] Updated with recommendations from review and latest OpenCost release Signed-off-by: Matt Ray --- .github/CODEOWNERS | 1 + charts/prometheus-opencost-exporter/Chart.yaml | 4 ++-- .../templates/_helpers.tpl | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 769861f91535..779f19796dc8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -32,6 +32,7 @@ /charts/prometheus-nats-exporter/ @caarlos0 @okgolove /charts/prometheus-nginx-exporter/ @nlamirault @zeritti /charts/prometheus-node-exporter/ @gianrubio @zanhsieh @zeritti +/charts/prometheus-opencost-exporter/ @mattray /charts/prometheus-operator-admission-webhook/ @zeritti /charts/prometheus-operator-crds/ @dacamposol @desaintmartin @jkroepke @QuentinBisson /charts/prometheus-pgbouncer-exporter/ @stewartshea @zeritti diff --git a/charts/prometheus-opencost-exporter/Chart.yaml b/charts/prometheus-opencost-exporter/Chart.yaml index 33959c77cb92..f98d3fca66ac 100644 --- a/charts/prometheus-opencost-exporter/Chart.yaml +++ b/charts/prometheus-opencost-exporter/Chart.yaml @@ -1,7 +1,7 @@ -appVersion: 1.106.2 +appVersion: 1.106.3 version: 0.1.0 description: Prometheus OpenCost Exporter -home: https://github.com/prometheus-community/opencost_exporter +home: https://github.com/opencost/opencost-helm-chart name: prometheus-opencost-exporter sources: - https://github.com/prometheus-community/opencost_exporter diff --git a/charts/prometheus-opencost-exporter/templates/_helpers.tpl b/charts/prometheus-opencost-exporter/templates/_helpers.tpl index 63edafc64bcc..6eea1847b5c5 100644 --- a/charts/prometheus-opencost-exporter/templates/_helpers.tpl +++ b/charts/prometheus-opencost-exporter/templates/_helpers.tpl @@ -35,20 +35,20 @@ Create chart name and version as used by the chart label. Common labels */}} {{- define "prometheus-opencost-exporter.labels" -}} -chart: {{ include "prometheus-opencost-exporter.chart" . }} +helm.sh/chart: {{ include "prometheus-opencost-exporter.chart" . }} {{ include "prometheus-opencost-exporter.selectorLabels" . }} -heritage: {{ .Release.Service }} -{{- if .Values.commonLabels}} -{{ toYaml .Values.commonLabels }} +{{- 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: {{ include "prometheus-opencost-exporter.name" . }} -release: {{ .Release.Name }} +app.kubernetes.io/name: {{ include "prometheus-opencost-exporter.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* From 879a2c6e2eec2d74de33b8be7623922a99be9887 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Fri, 20 Oct 2023 14:23:41 +1100 Subject: [PATCH 7/9] Updated to sync with upstream https://github.com/opencost/opencost-helm-chart Once that's merged it'll be the upstream to here. Signed-off-by: Matt Ray --- charts/prometheus-opencost-exporter/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-opencost-exporter/README.md b/charts/prometheus-opencost-exporter/README.md index a3f731ab3a12..c4e132f3e5aa 100644 --- a/charts/prometheus-opencost-exporter/README.md +++ b/charts/prometheus-opencost-exporter/README.md @@ -2,7 +2,9 @@ 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. +This chart bootstraps a Prometheus [OpenCost exporter](https://www.opencost.io/docs/integrations/opencost-exporter) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +The original source for this Helm chart is https://github.com/opencost/opencost-helm-chart. ## Prerequisites From 2ea9c29a3d2d91d34facbf5895f72673872b3854 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Sat, 18 Nov 2023 08:51:54 +1100 Subject: [PATCH 8/9] Updating the `home` field based on feedback and version bump Signed-off-by: Matt Ray --- charts/prometheus-opencost-exporter/Chart.yaml | 4 ++-- charts/prometheus-opencost-exporter/values.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/prometheus-opencost-exporter/Chart.yaml b/charts/prometheus-opencost-exporter/Chart.yaml index f98d3fca66ac..55221ff89400 100644 --- a/charts/prometheus-opencost-exporter/Chart.yaml +++ b/charts/prometheus-opencost-exporter/Chart.yaml @@ -1,7 +1,7 @@ -appVersion: 1.106.3 +appVersion: 1.107.1 version: 0.1.0 description: Prometheus OpenCost Exporter -home: https://github.com/opencost/opencost-helm-chart +home: https://github.com/opencost/opencost name: prometheus-opencost-exporter sources: - https://github.com/prometheus-community/opencost_exporter diff --git a/charts/prometheus-opencost-exporter/values.yaml b/charts/prometheus-opencost-exporter/values.yaml index 485373cb551c..fb5a9bf7ff31 100644 --- a/charts/prometheus-opencost-exporter/values.yaml +++ b/charts/prometheus-opencost-exporter/values.yaml @@ -146,6 +146,7 @@ opencost: regionNetworkEgress: 0.01 internetNetworkEgress: 0.12 + # OpenCost uses Prometheus for persistent storage prometheus: # -- Secret name that contains credentials for Prometheus secret_name: ~ From 6a6e2db112c823e7b0a8db2e43aaf900c495a795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Thu, 7 Dec 2023 15:26:23 +0100 Subject: [PATCH 9/9] fix url MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- charts/prometheus-opencost-exporter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/prometheus-opencost-exporter/README.md b/charts/prometheus-opencost-exporter/README.md index c4e132f3e5aa..168a124b61da 100644 --- a/charts/prometheus-opencost-exporter/README.md +++ b/charts/prometheus-opencost-exporter/README.md @@ -4,7 +4,7 @@ Prometheus exporter for [OpenCost](https://www.opencost.io) Kubernetes cost moni This chart bootstraps a Prometheus [OpenCost exporter](https://www.opencost.io/docs/integrations/opencost-exporter) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. -The original source for this Helm chart is https://github.com/opencost/opencost-helm-chart. +The original source for this Helm chart is . ## Prerequisites