From d5eaa579b64b6a1a8caba4ffff7588ef53b39538 Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Wed, 20 Dec 2023 10:56:49 +1100 Subject: [PATCH] Configurable ports (#156) * Support for configuring the API_PORT, API_SERVER, and UI_PORT Signed-off-by: Matt Ray * Version bump and README update Signed-off-by: Matt Ray * adding apiPort and uiPort on service object Signed-off-by: Rafael Brito * Set the default release to the appVersion Fixes https://github.com/opencost/opencost-helm-chart/issues/153 Signed-off-by: Matt Ray * Upgrade to 1.108.0 and version bump Signed-off-by: Matt Ray --------- Signed-off-by: Matt Ray Signed-off-by: Rafael Brito Co-authored-by: Rafael Brito --- charts/opencost/Chart.yaml | 4 +- charts/opencost/README.md | 276 +++++++++++----------- charts/opencost/templates/deployment.yaml | 34 ++- charts/opencost/templates/service.yaml | 10 +- charts/opencost/values.yaml | 9 +- 5 files changed, 178 insertions(+), 155 deletions(-) diff --git a/charts/opencost/Chart.yaml b/charts/opencost/Chart.yaml index 6cbc6c5..9ad6bc9 100755 --- a/charts/opencost/Chart.yaml +++ b/charts/opencost/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.107.1 +appVersion: 1.108.0 name: opencost description: OpenCost and OpenCost UI type: application @@ -9,7 +9,7 @@ keywords: - kubecost - opencost - monitoring -version: 1.27.0 +version: 1.28.0 maintainers: - name: mattray url: https://mattray.dev diff --git a/charts/opencost/README.md b/charts/opencost/README.md index 783e382..22ddeae 100644 --- a/charts/opencost/README.md +++ b/charts/opencost/README.md @@ -2,9 +2,9 @@ OpenCost and OpenCost UI -![Version: 1.27.0](https://img.shields.io/badge/Version-1.27.0-informational?style=flat-square) +![Version: 1.28.0](https://img.shields.io/badge/Version-1.28.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) -![AppVersion: 1.107.1](https://img.shields.io/badge/AppVersion-1.107.1-informational?style=flat-square) +![AppVersion: 1.108.0](https://img.shields.io/badge/AppVersion-1.108.0-informational?style=flat-square) ## Maintainers @@ -23,141 +23,143 @@ $ helm install opencost opencost/opencost ## Values -| Key | Type | Default | Description | -| ---------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | -| annotations | object | `{}` | Annotations to add to the all the resources | -| extraVolumes | list | `[]` | A list of volumes to be added to the pod | -| fullnameOverride | string | `""` | Overwrite all resources name created by the chart | -| imagePullSecrets | list | `[]` | List of secret names to use for pulling the images | -| nameOverride | string | `""` | Overwrite the default name of the chart | -| networkPolicies.enabled | bool | `false` | Whether network policies should be created | -| networkPolicies.prometheus.namespace | string | `"prometheus-system"` | Namespace where internal Prometheus is installed | -| networkPolicies.prometheus.port | int | `9090` | Pod port of in-cluster Prometheus | -| networkPolicies.prometheus.labels | object | `{ "app.kubernetes.io/name": "prometheus" }` | Label\(s\) used to identify the server Pod\(s\) relating to the internal Prometheus | -| opencost.affinity | object | `{}` | Affinity settings for pod assignment | -| opencost.customPricing.configPath | string | `"/tmp/custom-config"` | Path for the pricing configuration. | -| opencost.customPricing.configmapName | string | `"custom-pricing-model"` | Customize the configmap name used for custom pricing | -| opencost.customPricing.costModel | object | `{"CPU":1.25,"GPU":0.95,"RAM":0.5,"description":"Modified pricing configuration.","internetNetworkEgress":0.12,"regionNetworkEgress":0.01,"spotCPU":0.006655,"spotRAM":0.000892,"storage":0.25,"zoneNetworkEgress":0.01}` | More information about these values here: https://www.opencost.io/docs/configuration/on-prem#custom-pricing-using-the-opencost-helm-chart | -| opencost.customPricing.createConfigmap | bool | `true` | Configures the pricing model provided in the values file. | -| opencost.customPricing.enabled | bool | `false` | Enables custom pricing configuration | -| opencost.customPricing.provider | string | `"custom"` | Sets the provider type for the custom pricing file. | -| opencost.exporter.aws.access_key_id | string | `""` | AWS secret key id | -| opencost.exporter.aws.secret_access_key | string | `""` | AWS secret access key | -| opencost.exporter.cloudProviderApiKey | string | `""` | The GCP Pricing API requires a key. This is supplied just for evaluation. | -| opencost.exporter.csv_path | string | `""` | | -| opencost.exporter.defaultClusterId | string | `"default-cluster"` | Default cluster ID to use if cluster_id is not set in Prometheus metrics. | -| opencost.exporter.env | list | `[]` | List of additional environment variables to set in the container | -| opencost.exporter.extraArgs | list | `[]` | List of extra arguments for the command, e.g.: log-format=json | -| opencost.exporter.extraEnv | object | `{}` | Any extra environment variables you would like to pass on to the pod | -| opencost.exporter.extraVolumeMounts | list | `[]` | A list of volume mounts to be added to the pod | -| opencost.exporter.image.pullPolicy | string | `"IfNotPresent"` | Exporter container image pull policy | -| opencost.exporter.image.registry | string | `"gcr.io"` | Exporter container image registry | -| opencost.exporter.image.repository | string | `"kubecost1/opencost"` | Exporter container image name | -| opencost.exporter.image.tag | string | `""` (use appVersion in Chart.yaml) | Exporter container image tag | -| opencost.exporter.livenessProbe.enabled | bool | `true` | Whether probe is enabled | -| opencost.exporter.livenessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | -| opencost.exporter.livenessProbe.initialDelaySeconds | int | `120` | Number of seconds before probe is initiated | -| opencost.exporter.livenessProbe.periodSeconds | int | `10` | Probe frequency in seconds | -| opencost.exporter.persistence.accessMode | string | `""` | Access mode for persistent volume | -| opencost.exporter.persistence.annotations | object | `{}` | Annotations for persistent volume | -| opencost.exporter.persistence.enabled | bool | `false` | | -| opencost.exporter.persistence.size | string | `""` | Size for persistent volume | -| opencost.exporter.persistence.storageClass | string | `""` | Storage class for persistent volume | -| opencost.exporter.readinessProbe.enabled | bool | `true` | Whether probe is enabled | -| opencost.exporter.readinessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | -| opencost.exporter.readinessProbe.initialDelaySeconds | int | `120` | Number of seconds before probe is initiated | -| opencost.exporter.readinessProbe.periodSeconds | int | `10` | Probe frequency in seconds | -| opencost.exporter.replicas | int | `1` | Number of OpenCost replicas to run | -| opencost.exporter.resources.limits | object | `{"cpu":"999m","memory":"1Gi"}` | CPU/Memory resource limits | -| opencost.exporter.resources.requests | object | `{"cpu":"10m","memory":"55Mi"}` | CPU/Memory resource requests | -| opencost.exporter.securityContext | object | `{}` | The security options the container should be run with | -| opencost.extraContainers | list | `[]` | extra sidecars to add to the pod. Useful for things like oauth-proxy for the UI | -| opencost.metrics.serviceMonitor.additionalLabels | object | `{}` | Additional labels to add to the ServiceMonitor | -| opencost.metrics.serviceMonitor.enabled | bool | `false` | Create ServiceMonitor resource for scraping metrics using PrometheusOperator | -| opencost.metrics.serviceMonitor.extraEndpoints | list | `[]` | extra Endpoints to add to the ServiceMonitor. Useful for scraping sidecars | -| opencost.metrics.serviceMonitor.honorLabels | bool | `true` | HonorLabels chooses the metric's labels on collisions with target labels | -| opencost.metrics.serviceMonitor.metricRelabelings | list | `[]` | MetricRelabelConfigs to apply to samples before ingestion | -| opencost.metrics.serviceMonitor.namespace | string | `""` | Specify if the ServiceMonitor will be deployed into a different namespace (blank deploys into same namespace as chart) | -| opencost.metrics.serviceMonitor.relabelings | list | `[]` | RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields | -| opencost.metrics.serviceMonitor.scheme | string | `"http"` | HTTP scheme used for scraping. Defaults to `http` | -| opencost.metrics.serviceMonitor.scrapeInterval | string | `"30s"` | Interval at which metrics should be scraped | -| opencost.metrics.serviceMonitor.scrapeTimeout | string | `"10s"` | Timeout after which the scrape is ended | -| opencost.metrics.serviceMonitor.tlsConfig | object | `{}` | TLS configuration for scraping metrics | -| opencost.nodeSelector | object | `{}` | Node labels for pod assignment | -| opencost.prometheus.amp.enabled | bool | `false` | Use Amazon Managed Service for Prometheus (AMP) | -| opencost.prometheus.amp.workspaceId | string | `""` | Workspace ID for AMP | -| opencost.prometheus.bearer_token | string | `""` | Prometheus Bearer token | -| opencost.prometheus.bearer_token_key | string | `"DB_BEARER_TOKEN"` | | -| opencost.prometheus.external.enabled | bool | `false` | Use external Prometheus (eg. Grafana Cloud) | -| opencost.prometheus.external.url | string | `"https://prometheus.example.com/prometheus"` | External Prometheus url | -| opencost.prometheus.internal.enabled | bool | `true` | Use in-cluster Prometheus | -| opencost.prometheus.internal.namespaceName | string | `"prometheus-system"` | Namespace of in-cluster Prometheus | -| opencost.prometheus.internal.serviceName | string | `"prometheus-server"` | Service name of in-cluster Prometheus | -| opencost.prometheus.internal.port | int | `80` | Service port of in-cluster Prometheus | -| opencost.prometheus.password | string | `""` | Prometheus Basic auth password | -| opencost.prometheus.password_key | string | `"DB_BASIC_AUTH_PW"` | Key in the secret that references the password | -| opencost.prometheus.secret_name | string | `nil` | Secret name that contains credentials for Prometheus | -| opencost.prometheus.thanos.enabled | bool | `false` | | -| opencost.prometheus.thanos.external.enabled | bool | `false` | | -| opencost.prometheus.thanos.external.url | string | `"https://thanos-query.example.com/thanos"` | | -| opencost.prometheus.thanos.internal.enabled | bool | `true` | | -| opencost.prometheus.thanos.internal.namespaceName | string | `"opencost"` | | -| opencost.prometheus.thanos.internal.port | int | `10901` | | -| opencost.prometheus.thanos.internal.serviceName | string | `"my-thanos-query"` | | -| opencost.prometheus.thanos.maxSourceResolution | string | `""` | | -| opencost.prometheus.thanos.queryOffset | string | `""` | | -| opencost.prometheus.username | string | `""` | Prometheus Basic auth username | -| opencost.prometheus.username_key | string | `"DB_BASIC_AUTH_USERNAME"` | Key in the secret that references the username | -| opencost.sigV4Proxy.extraEnv | string | `nil` | | -| opencost.sigV4Proxy.host | string | `"aps-workspaces.us-west-2.amazonaws.com"` | | -| opencost.sigV4Proxy.image | string | `"public.ecr.aws/aws-observability/aws-sigv4-proxy:latest"` | | -| opencost.sigV4Proxy.imagePullPolicy | string | `"IfNotPresent"` | | -| opencost.sigV4Proxy.name | string | `"aps"` | | -| opencost.sigV4Proxy.port | int | `8005` | | -| opencost.sigV4Proxy.region | string | `"us-west-2"` | | -| opencost.sigV4Proxy.resources | object | `{}` | | -| opencost.sigV4Proxy.securityContext | object | `{}` | | -| opencost.tolerations | list | `[]` | Toleration labels for pod assignment | -| opencost.topologySpreadConstraints | list | `[]` | Assign custom TopologySpreadConstraints rules | -| opencost.ui.enabled | bool | `true` | Enable OpenCost UI | -| opencost.ui.extraVolumeMounts | list | `[]` | A list of volume mounts to be added to the pod | -| opencost.ui.image.pullPolicy | string | `"IfNotPresent"` | UI container image pull policy | -| opencost.ui.image.registry | string | `"gcr.io"` | UI container image registry | -| opencost.ui.image.repository | string | `"kubecost1/opencost-ui"` | UI container image name | -| opencost.ui.image.tag | string | `""` (use appVersion in Chart.yaml) | UI container image tag | -| opencost.ui.ingress.annotations | object | `{}` | Annotations for Ingress resource | -| opencost.ui.ingress.enabled | bool | `false` | Ingress for OpenCost UI | -| opencost.ui.ingress.hosts | list | See [values.yaml](values.yaml) | A list of host rules used to configure the Ingress | -| opencost.ui.ingress.ingressClassName | string | `""` | Ingress controller which implements the resource | -| opencost.ui.ingress.servicePort | string | `"http-ui"` | Redirect ingress to an extraPort defined on the service such as oauth-proxy | -| opencost.ui.ingress.tls | list | `[]` | Ingress TLS configuration | -| opencost.ui.livenessProbe.enabled | bool | `true` | Whether probe is enabled | -| opencost.ui.livenessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | -| opencost.ui.livenessProbe.initialDelaySeconds | int | `30` | Number of seconds before probe is initiated | -| opencost.ui.livenessProbe.periodSeconds | int | `10` | Probe frequency in seconds | -| opencost.ui.readinessProbe.enabled | bool | `true` | Whether probe is enabled | -| opencost.ui.readinessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | -| opencost.ui.readinessProbe.initialDelaySeconds | int | `30` | Number of seconds before probe is initiated | -| opencost.ui.readinessProbe.periodSeconds | int | `10` | Probe frequency in seconds | -| opencost.ui.resources.limits | object | `{"cpu":"999m","memory":"1Gi"}` | CPU/Memory resource limits | -| opencost.ui.resources.requests | object | `{"cpu":"10m","memory":"55Mi"}` | CPU/Memory resource requests | -| opencost.ui.securityContext | object | `{}` | The security options the container should be run with | -| podAnnotations | object | `{}` | Annotations to add to the OpenCost Pod | -| podLabels | object | `{}` | Labels to add to the OpenCost Pod | -| podSecurityContext | object | `{}` | Holds pod-level security attributes and common container settings | -| priorityClassName | string | `nil` | Pod priority | -| rbac.enabled | bool | `true` | | -| secretAnnotations | object | `{}` | Annotations to add to the Secret | -| service.annotations | object | `{}` | Annotations to add to the service | -| service.enabled | bool | `true` | | -| service.extraPorts | list | `[]` | extra ports. Useful for sidecar pods such as oauth-proxy | -| service.labels | object | `{}` | Labels to add to the service account | -| service.type | string | `"ClusterIP"` | Kubernetes Service type | -| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | -| serviceAccount.automountServiceAccountToken | bool | `true` | Whether pods running as this service account should have an API token automatically mounted | -| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | -| serviceAccount.name | string | `""` | | -| updateStrategy | object | `{"rollingUpdate":{"maxSurge":1,"maxUnavailable":1},"type":"RollingUpdate"}` | Strategy to be used for the Deployment | +| Key | Type | Default | Description | | | | | | +|------------------------------------------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|---|---------------------|------|--------|--------------------| +| annotations | object | `{}` | Annotations to add to the all the resources | | | | | | +| extraVolumes | list | `[]` | A list of volumes to be added to the pod | | | | | | +| fullnameOverride | string | `""` | Overwrite all resources name created by the chart | | | | | | +| imagePullSecrets | list | `[]` | List of secret names to use for pulling the images | | | | | | +| nameOverride | string | `""` | Overwrite the default name of the chart | | | | | | +| networkPolicies.enabled | bool | `false` | Whether network policies should be created | | | | | | +| networkPolicies.prometheus.namespace | string | `"prometheus-system"` | Namespace where internal Prometheus is installed | | | | | | +| networkPolicies.prometheus.port | int | `9090` | Pod port of in-cluster Prometheus | | | | | | +| networkPolicies.prometheus.labels | object | `{ "app.kubernetes.io/name": "prometheus" }` | Label\(s\) used to identify the server Pod\(s\) relating to the internal Prometheus | | | | | | +| opencost.affinity | object | `{}` | Affinity settings for pod assignment | | | | | | +| opencost.customPricing.configPath | string | `"/tmp/custom-config"` | Path for the pricing configuration. | | | | | | +| opencost.customPricing.configmapName | string | `"custom-pricing-model"` | Customize the configmap name used for custom pricing | | | | | | +| opencost.customPricing.costModel | object | `{"CPU":1.25,"GPU":0.95,"RAM":0.5,"description":"Modified pricing configuration.","internetNetworkEgress":0.12,"regionNetworkEgress":0.01,"spotCPU":0.006655,"spotRAM":0.000892,"storage":0.25,"zoneNetworkEgress":0.01}` | More information about these values here: https://www.opencost.io/docs/configuration/on-prem#custom-pricing-using-the-opencost-helm-chart | | | | | | +| opencost.customPricing.createConfigmap | bool | `true` | Configures the pricing model provided in the values file. | | | | | | +| opencost.customPricing.enabled | bool | `false` | Enables custom pricing configuration | | | | | | +| opencost.customPricing.provider | string | `"custom"` | Sets the provider type for the custom pricing file. | | | | | | +| opencost.exporter.apiPort | int | `9003` | API_PORT for the cost-model to listen on | | | | | | +| opencost.exporter.aws.access_key_id | string | `""` | AWS secret key id | | | | | | +| opencost.exporter.aws.secret_access_key | string | `""` | AWS secret access key | | | | | | +| opencost.exporter.cloudProviderApiKey | string | `""` | The GCP Pricing API requires a key. This is supplied just for evaluation. | | | | | | +| opencost.exporter.csv_path | string | `""` | | | | | | | +| opencost.exporter.defaultClusterId | string | `"default-cluster"` | Default cluster ID to use if cluster_id is not set in Prometheus metrics. | | | | | | +| opencost.exporter.env | list | `[]` | List of additional environment variables to set in the container | | | | | | +| opencost.exporter.extraArgs | list | `[]` | List of extra arguments for the command, e.g.: log-format=json | | | | | | +| opencost.exporter.extraEnv | object | `{}` | Any extra environment variables you would like to pass on to the pod | | | | | | +| opencost.exporter.extraVolumeMounts | list | `[]` | A list of volume mounts to be added to the pod | | | | | | +| opencost.exporter.image.pullPolicy | string | `"IfNotPresent"` | Exporter container image pull policy | | | | | | +| opencost.exporter.image.registry | string | `"gcr.io"` | Exporter container image registry | | | | | | +| opencost.exporter.image.repository | string | `"kubecost1/opencost"` | Exporter container image name | | | | | | +| opencost.exporter.image.tag | string | `""` (use appVersion in Chart.yaml) | Exporter container image tag | | | | | | +| opencost.exporter.livenessProbe.enabled | bool | `true` | Whether probe is enabled | | | | | | +| opencost.exporter.livenessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | | | | | | +| opencost.exporter.livenessProbe.initialDelaySeconds | int | `120` | Number of seconds before probe is initiated | | | | | | +| opencost.exporter.livenessProbe.periodSeconds | int | `10` | Probe frequency in seconds | | | | | | +| opencost.exporter.persistence.accessMode | string | `""` | Access mode for persistent volume | | | | | | +| opencost.exporter.persistence.annotations | object | `{}` | Annotations for persistent volume | | | | | | +| opencost.exporter.persistence.enabled | bool | `false` | | | | | | | +| opencost.exporter.persistence.size | string | `""` | Size for persistent volume | | | | | | +| opencost.exporter.persistence.storageClass | string | `""` | Storage class for persistent volume | | | | | | +| opencost.exporter.readinessProbe.enabled | bool | `true` | Whether probe is enabled | | | | | | +| opencost.exporter.readinessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | | | | | | +| opencost.exporter.readinessProbe.initialDelaySeconds | int | `120` | Number of seconds before probe is initiated | | | | | | +| opencost.exporter.readinessProbe.periodSeconds | int | `10` | Probe frequency in seconds | | | | | | +| opencost.exporter.replicas | int | `1` | Number of OpenCost replicas to run | | | | | | +| opencost.exporter.resources.limits | object | `{"cpu":"999m","memory":"1Gi"}` | CPU/Memory resource limits | | | | | | +| opencost.exporter.resources.requests | object | `{"cpu":"10m","memory":"55Mi"}` | CPU/Memory resource requests | | | | | | +| opencost.exporter.securityContext | object | `{}` | The security options the container should be run with | | | | | | +| opencost.extraContainers | list | `[]` | extra sidecars to add to the pod. Useful for things like oauth-proxy for the UI | | | | | | +| opencost.metrics.serviceMonitor.additionalLabels | object | `{}` | Additional labels to add to the ServiceMonitor | | | | | | +| opencost.metrics.serviceMonitor.enabled | bool | `false` | Create ServiceMonitor resource for scraping metrics using PrometheusOperator | | | | | | +| opencost.metrics.serviceMonitor.extraEndpoints | list | `[]` | extra Endpoints to add to the ServiceMonitor. Useful for scraping sidecars | | | | | | +| opencost.metrics.serviceMonitor.honorLabels | bool | `true` | HonorLabels chooses the metric's labels on collisions with target labels | | | | | | +| opencost.metrics.serviceMonitor.metricRelabelings | list | `[]` | MetricRelabelConfigs to apply to samples before ingestion | | | | | | +| opencost.metrics.serviceMonitor.namespace | string | `""` | Specify if the ServiceMonitor will be deployed into a different namespace (blank deploys into same namespace as chart) | | | | | | +| opencost.metrics.serviceMonitor.relabelings | list | `[]` | RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields | | | | | | +| opencost.metrics.serviceMonitor.scheme | string | `"http"` | HTTP scheme used for scraping. Defaults to `http` | | | | | | +| opencost.metrics.serviceMonitor.scrapeInterval | string | `"30s"` | Interval at which metrics should be scraped | | | | | | +| opencost.metrics.serviceMonitor.scrapeTimeout | string | `"10s"` | Timeout after which the scrape is ended | | | | | | +| opencost.metrics.serviceMonitor.tlsConfig | object | `{}` | TLS configuration for scraping metrics | | | | | | +| opencost.nodeSelector | object | `{}` | Node labels for pod assignment | | | | | | +| opencost.prometheus.amp.enabled | bool | `false` | Use Amazon Managed Service for Prometheus (AMP) | | | | | | +| opencost.prometheus.amp.workspaceId | string | `""` | Workspace ID for AMP | | | | | | +| opencost.prometheus.bearer_token | string | `""` | Prometheus Bearer token | | | | | | +| opencost.prometheus.bearer_token_key | string | `"DB_BEARER_TOKEN"` | | | | | | | +| opencost.prometheus.external.enabled | bool | `false` | Use external Prometheus (eg. Grafana Cloud) | | | | | | +| opencost.prometheus.external.url | string | `"https://prometheus.example.com/prometheus"` | External Prometheus url | | | | | | +| opencost.prometheus.internal.enabled | bool | `true` | Use in-cluster Prometheus | | | | | | +| opencost.prometheus.internal.namespaceName | string | `"prometheus-system"` | Namespace of in-cluster Prometheus | | | | | | +| opencost.prometheus.internal.serviceName | string | `"prometheus-server"` | Service name of in-cluster Prometheus | | | | | | +| opencost.prometheus.internal.port | int | `80` | Service port of in-cluster Prometheus | | | | | | +| opencost.prometheus.password | string | `""` | Prometheus Basic auth password | | | | | | +| opencost.prometheus.password_key | string | `"DB_BASIC_AUTH_PW"` | Key in the secret that references the password | | | | | | +| opencost.prometheus.secret_name | string | `nil` | Secret name that contains credentials for Prometheus | | | | | | +| opencost.prometheus.thanos.enabled | bool | `false` | | | | | | | +| opencost.prometheus.thanos.external.enabled | bool | `false` | | | | | | | +| opencost.prometheus.thanos.external.url | string | `"https://thanos-query.example.com/thanos"` | | | | | | | +| opencost.prometheus.thanos.internal.enabled | bool | `true` | | | | | | | +| opencost.prometheus.thanos.internal.namespaceName | string | `"opencost"` | | | | | | | +| opencost.prometheus.thanos.internal.port | int | `10901` | | | | | | | +| opencost.prometheus.thanos.internal.serviceName | string | `"my-thanos-query"` | | | | | | | +| opencost.prometheus.thanos.maxSourceResolution | string | `""` | | | | | | | +| opencost.prometheus.thanos.queryOffset | string | `""` | | | | | | | +| opencost.prometheus.username | string | `""` | Prometheus Basic auth username | | | | | | +| opencost.prometheus.username_key | string | `"DB_BASIC_AUTH_USERNAME"` | Key in the secret that references the username | | | | | | +| opencost.sigV4Proxy.extraEnv | string | `nil` | | | | | | | +| opencost.sigV4Proxy.host | string | `"aps-workspaces.us-west-2.amazonaws.com"` | | | | | | | +| opencost.sigV4Proxy.image | string | `"public.ecr.aws/aws-observability/aws-sigv4-proxy:latest"` | | | | | | | +| opencost.sigV4Proxy.imagePullPolicy | string | `"IfNotPresent"` | | | | | | | +| opencost.sigV4Proxy.name | string | `"aps"` | | | | | | | +| opencost.sigV4Proxy.port | int | `8005` | | | | | | | +| opencost.sigV4Proxy.region | string | `"us-west-2"` | | | | | | | +| opencost.sigV4Proxy.resources | object | `{}` | | | | | | | +| opencost.sigV4Proxy.securityContext | object | `{}` | | | | | | | +| opencost.tolerations | list | `[]` | Toleration labels for pod assignment | | | | | | +| opencost.topologySpreadConstraints | list | `[]` | Assign custom TopologySpreadConstraints rules | | | | | | +| opencost.ui.apiServer | string | `""` | API_SERVER used in the default.nginx.conf if you want to switch for using with Docker | | | | | | +| opencost.ui.extraVolumeMounts | list | `[]` | A list of volume mounts to be added to the pod | | | | | | +| opencost.ui.image.pullPolicy | string | `"IfNotPresent"` | UI container image pull policy | | | | | | +| opencost.ui.image.registry | string | `"gcr.io"` | UI container image registry | | | | | | +| opencost.ui.image.repository | string | `"kubecost1/opencost-ui"` | UI container image name | | | | | | +| opencost.ui.image.tag | string | `""` (use appVersion in Chart.yaml) | UI container image tag | | | | | | +| opencost.ui.ingress.annotations | object | `{}` | Annotations for Ingress resource | | | | | | +| opencost.ui.ingress.enabled | bool | `false` | Ingress for OpenCost UI | | | | | | +| opencost.ui.ingress.hosts | list | See [values.yaml](values.yaml) | A list of host rules used to configure the Ingress | | | | | | +| opencost.ui.ingress.ingressClassName | string | `""` | Ingress controller which implements the resource | | | | | | +| opencost.ui.ingress.servicePort | string | `"http-ui"` | Redirect ingress to an extraPort defined on the service such as oauth-proxy | | | | | | +| opencost.ui.ingress.tls | list | `[]` | Ingress TLS configuration | | | | | | +| opencost.ui.livenessProbe.enabled | bool | `true` | Whether probe is enabled | | | | | | +| opencost.ui.livenessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | | | | | | +| opencost.ui.livenessProbe.initialDelaySeconds | int | `30` | Number of seconds before probe is initiated | | | | | | +| opencost.ui.livenessProbe.periodSeconds | int | `10` | Probe frequency in seconds | | | | | | +| opencost.ui.readinessProbe.enabled | bool | `true` | Whether probe is enabled | | | | | | +| opencost.ui.readinessProbe.failureThreshold | int | `3` | Number of failures for probe to be considered failed | | | | | | +| opencost.ui.readinessProbe.initialDelaySeconds | int | `30` | Number of seconds before probe is initiated | | | | | | +| opencost.ui.readinessProbe.periodSeconds | int | `10` | Probe frequency in seconds | | | | | | +| opencost.ui.resources.limits | object | `{"cpu":"999m","memory":"1Gi"}` | CPU/Memory resource limits | | | | | | +| opencost.ui.resources.requests | object | `{"cpu":"10m","memory":"55Mi"}` | CPU/Memory resource requests | | | | | | +| opencost.ui.securityContext | object | `{}` | The security options the container should be run with | | | | | | +| opencost.ui.uiPort | int | `9090` | UI_PORT for the opencost-ui to listen on | | | | | | +| podAnnotations | object | `{}` | Annotations to add to the OpenCost Pod | | | | | | +| podLabels | object | `{}` | Labels to add to the OpenCost Pod | | | | | | +| podSecurityContext | object | `{}` | Holds pod-level security attributes and common container settings | | | | | | +| priorityClassName | string | `nil` | Pod priority | | | | | | +| rbac.enabled | bool | `true` | | | | | | | +| secretAnnotations | object | `{}` | Annotations to add to the Secret | | | | | | +| service.annotations | object | `{}` | Annotations to add to the service | | | | | | +| service.enabled | bool | `true` | | | | | | | +| service.extraPorts | list | `[]` | extra ports. Useful for sidecar pods such as oauth-proxy | | | | | | +| service.labels | object | `{}` | Labels to add to the service account | | | | | | +| service.type | string | `"ClusterIP"` | Kubernetes Service type | | | | | | +| serviceAccount.annotations | object | `{}` | Annotations to add to the service account | | | | | | +| serviceAccount.automountServiceAccountToken | bool | `true` | Whether pods running as this service account should have an API token automatically mounted | | | | | | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | | | | | +| serviceAccount.name | string | `""` | | | | | | | +| updateStrategy | object | `{"rollingUpdate":{"maxSurge":1,"maxUnavailable":1},"type":"RollingUpdate"}` | Strategy to be used for the Deployment | | | | | | --- diff --git a/charts/opencost/templates/deployment.yaml b/charts/opencost/templates/deployment.yaml index 1b91382..d85a339 100644 --- a/charts/opencost/templates/deployment.yaml +++ b/charts/opencost/templates/deployment.yaml @@ -58,14 +58,14 @@ spec: - --{{ . }} {{- end }} ports: - - containerPort: 9003 + - containerPort: {{ .Values.opencost.exporter.apiPort }} name: http resources: {{- toYaml .Values.opencost.exporter.resources | nindent 12 }} {{- if .Values.opencost.exporter.livenessProbe.enabled }} livenessProbe: httpGet: path: /healthz - port: 9003 + port: {{ .Values.opencost.exporter.apiPort }} initialDelaySeconds: {{ .Values.opencost.exporter.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.opencost.exporter.livenessProbe.periodSeconds }} failureThreshold: {{ .Values.opencost.exporter.livenessProbe.failureThreshold }} @@ -74,7 +74,7 @@ spec: readinessProbe: httpGet: path: /healthz - port: 9003 + port: {{ .Values.opencost.exporter.apiPort }} initialDelaySeconds: {{ .Values.opencost.exporter.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.opencost.exporter.readinessProbe.periodSeconds }} failureThreshold: {{ .Values.opencost.exporter.readinessProbe.failureThreshold }} @@ -83,6 +83,10 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} env: + {{- if .Values.opencost.exporter.apiPort }} + - name: API_PORT + value: {{ .Values.opencost.exporter.apiPort | quote }} + {{- end }} - name: PROMETHEUS_SERVER_ENDPOINT value: {{ include "opencost.prometheusServerEndpoint" . | quote }} {{- if .Values.opencost.exporter.cloudProviderApiKey }} @@ -200,18 +204,30 @@ spec: {{- end }} imagePullPolicy: {{ .Values.opencost.ui.image.pullPolicy }} ports: - - containerPort: 9090 + - containerPort: {{ .Values.opencost.ui.uiPort }} name: http-ui - {{- with .Values.opencost.ui.extraEnv }} env: - {{- toYaml . | nindent 12 }} - {{- end }} + {{- with .Values.opencost.ui.extraEnv }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- if .Values.opencost.ui.apiServer }} + - name: API_SERVER + value: {{ .Values.opencost.ui.apiServer | quote }} + {{- end }} + {{- if .Values.opencost.exporter.apiPort }} + - name: API_PORT + value: {{ .Values.opencost.exporter.apiPort | quote }} + {{- end }} + {{- if .Values.opencost.ui.uiPort }} + - name: UI_PORT + value: {{ .Values.opencost.ui.uiPort | quote }} + {{- end }} resources: {{- toYaml .Values.opencost.ui.resources | nindent 12 }} {{- if .Values.opencost.ui.livenessProbe.enabled }} livenessProbe: httpGet: path: /healthz - port: 9090 + port: {{ .Values.opencost.ui.uiPort }} initialDelaySeconds: {{ .Values.opencost.ui.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.opencost.ui.livenessProbe.periodSeconds }} failureThreshold: {{ .Values.opencost.ui.livenessProbe.failureThreshold }} @@ -220,7 +236,7 @@ spec: readinessProbe: httpGet: path: /healthz - port: 9090 + port: {{ .Values.opencost.ui.uiPort }} initialDelaySeconds: {{ .Values.opencost.ui.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.opencost.ui.readinessProbe.periodSeconds }} failureThreshold: {{ .Values.opencost.ui.readinessProbe.failureThreshold }} diff --git a/charts/opencost/templates/service.yaml b/charts/opencost/templates/service.yaml index aa366c1..f07b677 100644 --- a/charts/opencost/templates/service.yaml +++ b/charts/opencost/templates/service.yaml @@ -16,14 +16,14 @@ spec: type: {{ .Values.service.type }} ports: - name: http - port: 9003 - targetPort: 9003 + port: {{ .Values.opencost.exporter.apiPort }} + targetPort: {{ .Values.opencost.exporter.apiPort }} {{- if .Values.opencost.ui.enabled }} - name: http-ui - port: 9090 - targetPort: 9090 + port: {{ .Values.opencost.ui.uiPort }} + targetPort: {{ .Values.opencost.ui.uiPort }} {{- end }} {{- with .Values.service.extraPorts }} {{- toYaml . | nindent 4 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index 29178bb..5beae99 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -77,6 +77,8 @@ rbac: opencost: exporter: + # API_PORT for the cost-model to listen on + apiPort: 9003 # -- 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. @@ -88,7 +90,7 @@ opencost: repository: kubecost1/kubecost-cost-model # -- Exporter container image tag # @default -- `""` (use appVersion in Chart.yaml) - tag: "latest" + tag: "" # -- Exporter container image pull policy pullPolicy: IfNotPresent # -- Override the full image name for development purposes @@ -289,7 +291,7 @@ opencost: repository: kubecost1/opencost-ui # -- UI container image tag # @default -- `""` (use appVersion in Chart.yaml) - tag: "latest" + tag: "" # -- UI container image pull policy pullPolicy: IfNotPresent # -- Override the full image name for development purposes @@ -303,6 +305,9 @@ opencost: limits: cpu: '999m' memory: '1Gi' + # used in the default.nginx.conf if you want to switch for using with Docker + # apiServer: 0.0.0.0 + uiPort: 9090 # Liveness probe configuration livenessProbe: # -- Whether probe is enabled