Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COST-2315, COST-2316, COST-3451, COST-3463] Operator docs updates #174

Merged
merged 7 commits into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions docs/csv-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ The Koku Metrics Operator (`koku-metrics-operator`) collects the metrics require
* Packaging the CSV report files into tarballs.

#### Additional Capabilities:
* Resource Optimization metrics collection (the default is to not collect these metrics).
* The operator can be configured to gather all previous data within the configured retention period or a maximum of 90 days. The default data collection period is the 14 previous days. This setting is only applicable to newly created KokuMetricsConfigs.
* The operator can be configured to automatically upload the packaged reports to cost management through Red Hat Insights Ingress service.
* The operator can create a source in console.redhat.com. A source is required for cost management to process the uploaded packages.
* PersistentVolumeClaim (PVC) configuration: The KokuMetricsConfig CR can accept a PVC definition and the operator will create and mount the PVC. If one is not provided, a default PVC will be created.
* Restricted network installation: this operator can function on a restricted network. In this mode, the operator stores the packaged reports for manual retrieval.

## New in v2.0.0:
* Adds metrics and report generation for resource optimization. This feature will collect additional usage metrics and create a new report in the payload. These metrics are disabled by default, but can be enabled by setting `disable_metrics_collection_resource_optimization` to `false`.
* Collect all available Prometheus data upon CR creation. This feature only applies to newly created KokuMetricsConfigs. The operator will check the monitoring stack configuration in the `openshift-monitoring` namespace. The operator will use the `retention` period set in the `cluster-monitoring-config` ConfigMap if defined, up to a maximum of 90 days. Otherwise it will fall back to collecting 14 days of data, if available. This data collection may be disabled by setting `collect_previous_data` to `false`. Turning this feature off results in the operator collecting metrics from the time the KokuMetricsConfig is created, forward.

## Limitations and Pre-Requisites
#### Limitations (Potential for metrics data loss)
* A source **must** exist in console.redhat.com for an uploaded payload to be processed by cost management. The operator sends the payload to the Red Hat Insights Ingress service which usually returns successfully, but the operator does not currently confirm with cost management that the payload was processed. After Ingress accepts the uploaded payload, the payload is removed from the operator and is gone forever. If the data within the payload is not processed, a gap will be introduced in the usage metrics.
Expand Down Expand Up @@ -48,6 +54,28 @@ To use the default specification, the follow assumptions must be met:

If these assumptions are not met, the operator will not deploy correctly. In these cases, storage must be manually configured. After configuring storage, a valid PVC template should be supplied in the `volume_claim_template` spec of the KokuMetricsConfig CR.

## Configurable parameters:
* `authentication`:
* `type: token` -> The authentication method for connecting to `console.redhat.com`. The default and preferred method is `token`. `basic` is used when the openshift-config pull-secret does not contain a token for `cloud.redhat.com`.
* `secret_name` -> The Secret used by the operator when the authentication type is `basic`. This parameter is required **only if** the authentication type is `basic`.
* `packaging`:
* `max_reports_to_store: 30` -> The number of reports to store when configured in air-gapped mode. The default is 30, with a minimum of 1 and no maximum. When the operator is not configured in air-gapped mode, this parameter has no effect. Reports are removed as soon as they are uploaded.
* `max_size: 100` -> The maximum size for packaged files in Megabytes prior to compression. The default is 100, with a minimum of 1 and maximum of 100.
* `prometheus_config`:
* `collect_previous_data: true` -> Toggle for collecting all available data in Prometheus **upon KokuMetricsConfig creation** (This parameter will start to appear in KokuMetricsConfigs that were created prior to v2.0.0 but will not have any effect unless the KokuMetricsConfig is deleted and recreated). The default is `true`. The operator will first look for a `retention` period in the `cluster-monitoring-config` ConfigMap in the `openshift-monitoring` namespace and gather data over this time period up to a maximum of 90 days. If this configuration is not set, the default is 14 days. (New in v2.0.0)
* `disable_metrics_collection_cost_management: false` -> Toggle for disabling the collection of metrics for Cost Management. The default is false. (New in v2.0.0)
* `disable_metrics_collection_resource_optimization: true` -> Toggle for disabling the collection of metrics for Resource Optimization. The default is true. (New in v2.0.0)
* `context_timeout: 120` -> The time in seconds before Prometheus queries timeout due to exceeding context timeout. The default is 120, with a minimum of 10 and maximum of 180.
* `source`:
* `name: INSERT_SOURCE_NAME` -> The name of the Source the operator will create in `console.redhat.com`. The default is `INSERT_SOURCE_NAME` which is a placeholder.
* `create_source: false` -> Toggle for whether or not the operator will create the Source in `console.redhat.com`. The default is False. This parameter should be switched to True when a Source does not already exist in `console.redhat.com` for this cluster.
* `check_cycle: 1440` -> The time in minutes to wait between checking if a Source exists for this cluster. The default is 1440 minutes (24 hrs).
* `upload`:
* `upload_cycle: 360` -> The time in minutes between payload uploads. The default is 360 (6 hours).
* `upload_toggle: true` -> Toggle to turn upload on or off -> true means upload, false means do not upload (false == air-gapped mode). The default is `true`.
* `upload_wait` -> The amount of time (in seconds) to pause before uploading a payload. The default is a random number between 0 and 35. This is used to decrease service load, but may be set to `0` if desired.
* `volume_claim_template` -> see the "Storage configuration prerequisite" section above.

## Configure the koku-metrics-operator
**Note** There are separate instructions for configuring the `koku-metrics-operator` to run in a restricted network.
##### Configure authentication
Expand Down Expand Up @@ -136,7 +164,7 @@ Configure the koku-metrics-operator by creating a `KokuMetricsConfig`.

```
upload:
upload_cycle: 360,
upload_cycle: 360
upload_toggle: false
```

Expand Down Expand Up @@ -205,6 +233,6 @@ Create source:
## Upload the reports to cost managment
Uploading reports to cost managment is done through curl:

$ curl -vvvv -F "file=@FILE_NAME.tar.gz;type=application/vnd.redhat.hccm.tar+tgz" https://cloud.redhat.com/api/ingress/v1/upload -u USERNAME:PASS
$ curl -vvvv -F "file=@FILE_NAME.tar.gz;type=application/vnd.redhat.hccm.tar+tgz" https://console.redhat.com/api/ingress/v1/upload -u USERNAME:PASS

where `USERNAME` and `PASS` correspond to the user credentials for [console.redhat.com](https://console.redhat.com), and `FILE_NAME` is the name of the report to upload.