cost-management

by tjungbauer

Helm chartv1.0.17Apache-2.0Verified publisher

Setup and configure cost-management Operator

About this chart

cost-management

Description

Setup and configure cost-management Operator

This Helm Chart is installing and configuring the Cost Management operator, using the following workflow:

  1. Create required Namespace
  2. Installing the Compliance operator by applying the Subscription and OperatorGroup object. (In addition, the InstallPlan can be approved if required)
  3. Verifying if the operator is ready to use Install and configure the compliance operator.
  4. Apply a ScanSettingBinding and, optionally, a TailoredProfile.

Dependencies

This chart has the following dependencies:

RepositoryNameVersion
https://charts.stderr.at/helper-operator~1.0.36
https://charts.stderr.at/helper-status-checker~4.0.0
https://charts.stderr.at/tpl~1.0.31

It is best used with a full GitOps approach such as Argo CD does. For example, https://github.com/tjungbauer/openshift-clusterconfig-gitops

Maintainers

NameEmailUrl
tjungbauer[email protected]https://blog.stderr.at/

Sources

Source:

Source code: https://github.com/tjungbauer/helm-charts/tree/main/charts/network-observability

Parameters

:bulb: TIP: See README files of sub Charts for additional possible settings: helper-operator and helper-status-checker.

Values

KeyTypeDefaultDescription
costmgmt.additionalAnnotationsobject{}Additional annotations on the CostManagementMetricsConfig resource
costmgmt.additionalLabelsobject{}Additional labels on the CostManagementMetricsConfig resource
costmgmt.airgappedboolfalseIs the cluster running in an airgapped or disconnected environment, we cannot upload the cost management data. If set to true upload_toggle will be set to false autoamatically.
costmgmt.auth_typestringtokenAuthentication: Valid values are: - "basic" (deprecated) : Enables authentication using user and password from authentication secret. - "service-account" : Enables authentication using client_id and client_secret from the secret containing service account information. - "token" (default): Uses cluster token for authentication. If the cluster is running in airgapped mode, then these settings can be ignored.
costmgmt.clusternamestring"mycluster"The name of the cluster.
costmgmt.enabledboolfalseEnable or disable the configuration of the cost management operator
costmgmt.max_reports_to_storeint30Represents the maximum number of reports to store. The default is 30 reports which corresponds to approximately 7 days worth of data given the other default values.
costmgmt.max_size_MBint100Represents the max file size in megabytes that will be compressed for upload to Ingress. Must be less or euqal 100.
costmgmt.namestringcostmanagementmetricscfgName of the cost manager CRD
costmgmt.promconfig_collect_previous_datastringtrueRepresents whether or not the operator will gather previous data upon CostManagementMetricsConfig creation. This toggle only changes operator behavior when a new CostManagementMetricsConfig is created. When true, the operator will gather all existing Prometheus data for the current month.
costmgmt.promconfig_context_timeint120How long a query to prometheus should run in seconds before timing out.
costmgmt.promconfig_disable_metric_coll_cost_managementstringfalseWhether or not the operator will generate reports for cost-management metrics.
costmgmt.promconfig_disable_metric_coll_resource_optimizationstringfalseWhether or not the operator will generate reports for resource-optimization metrics.
costmgmt.promconfig_service_addressstring"https://thanos-querier.openshift-monitoring.svc:9091"Service addess to prometheus. For development only.
costmgmt.promconfig_skip_tls_verificationstringfalseSkip TLS verification to thanos-querier endpoint.
costmgmt.source_check_cycleint1440The cycle to check the source. @default - 1440
costmgmt.source_create_sourcebooltrueWhether or not the operator will create the source.
costmgmt.sources_pathstring"/api/sources/v1.0/"The path to the sources API.
costmgmt.syncwavestring10Syncwave for the CostManagementMetricsConfig resource
costmgmt.upload_cycleint360Represents the number of minutes between each upload schedule.
costmgmt.upload_togglebooltrueIf false, the operator will not upload to console.redhat.com or check/create sources.
costmgmt.upload_validate_certbooltrueWhether or not the operator will validate the certificate of upload target.
helper-operator.operators.cost-management-operator.enabledboolfalseEnabled yes/no
helper-operator.operators.cost-management-operator.namespace.createbool""Description of the namespace.
helper-operator.operators.cost-management-operator.namespace.namestring"costmanagement-metrics-operator"The Namespace the Operator should be installed in. The cost-management operator should be deployed into costmanagement-metrics-operator Namepsace that must be created.
helper-operator.operators.cost-management-operator.operatorgroup.createboolfalseCreate an Operatorgroup object
helper-operator.operators.cost-management-operator.operatorgroup.notownnamespaceboolfalseMonitor own Namespace. For some Operators no targetNamespaces must be defined
helper-operator.operators.cost-management-operator.subscription.approvalstringAutomaticUpdate behavior of the Operator. Manual/Automatic
helper-operator.operators.cost-management-operator.subscription.channelstringstableChannel of the Subscription
helper-operator.operators.cost-management-operator.subscription.operatorNamestring"empty"Name of the Operator The name for the cost-management operator is costmanagement-metrics-operator
helper-operator.operators.cost-management-operator.subscription.sourcestringredhat-operatorsSource of the Operator
helper-operator.operators.cost-management-operator.subscription.sourceNamespacestringopenshift-marketplaceNamespace of the source
helper-operator.operators.cost-management-operator.syncwavestring0Syncwave for the operator deployment
helper-status-checker.checks[0].namespace.namestring"costmanagement-metrics-operator"
helper-status-checker.checks[0].operatorNamestring"costmanagement-metrics-operator"
helper-status-checker.checks[0].serviceAccount.namestring"sa-costmanagement-metrics"
helper-status-checker.checks[0].syncwaveint3
helper-status-checker.enabledboolfalse

Example values

---
cost-management:
  costmgmt:
    enabled: false
    name: costmanagementmetricscfg
    airgapped: true
    max_reports_to_store: 60
    upload_cycle: 360

# Using sub-chart helper-operator
helper-operator:
  operators:
    cost-management-operator:
      enabled: false
      syncwave: '0'
      namespace:
        name: costmanagement-metrics-operator
        create: true
      subscription:
        channel: stable
        approval: Automatic
        operatorName: costmanagement-metrics-operator
        source: redhat-operators
        sourceNamespace: openshift-marketplace
      operatorgroup:
        create: false
        notownnamespace: false

# Using sub-chart helper-status-checker
helper-status-checker:
  enabled: false

  checks:

    - operatorName: costmanagement-metrics-operator
      namespace:
        name: costmanagement-metrics-operator
      syncwave: 3

      serviceAccount:
        name: "sa-costmanagement-metrics"

Installing the Chart

To install the chart with the release name my-release:

helm install my-release tjungbauer/<chart-name>>

The command deploys the chart on the Kubernetes cluster in the default configuration.

Uninstalling the Chart

To uninstall/delete the my-release deployment:

helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.


Autogenerated from chart metadata using helm-docs v1.14.2

Deploy cost-management with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cost-management on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcost-management is pinned at v1.0.17 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply