Integrating OpenShift Container Platform data into cost management Cost Management Service 1-latest Learn how to add and configure your OpenShift Container Platform integrations Red Hat Customer Content Services

Commands:
describe packagemanifests costmanagement-metrics-operator -n openshift-marketplace
echo -n "<red_hat_service_account_client_id>" | base64
echo -n "<red_hat_service_account_client_secret>" | base64
kind: Secret apiVersion: v1 metadata: name: service-account-auth-secret namespace: costmanagement-metrics-operator data: client_id: <base64_encoded_red_hat_service_account_client_id> client_secret: <base64_encoded_red_hat_service_account_client_secret>
apply -f example.yaml
kind: CostManagementMetricsConfig apiVersion: costmanagement-metrics-cfg.openshift.io/v1beta1 metadata: name: costmanagementmetricscfg-sample-v1beta1 namespace: costmanagement-metrics-operator spec: authentication: type: service-account secret_name: service-account-auth-secret packaging: max_reports_to_store: 30 max_size_MB: 100 prometheus_config: collect_previous_data: true context_timeout: 120 disable_metrics_collection_cost_management: false disable_metrics_collection_resource_optimization: false source: check_cycle: 1440 create_source: false name: '' upload: upload_cycle: 360 upload_toggle: true
kind: CostManagementMetricsConfig apiVersion: costmanagement-metrics-cfg.openshift.io/v1beta1 metadata: name: costmanagementmetricscfg-sample-v1beta1 namespace: costmanagement-metrics-operator spec: authentication: type: service-account secret_name: service-account-auth-secret packaging: max_reports_to_store: 30 max_size_MB: 100 prometheus_config: collect_previous_data: true context_timeout: 120 disable_metrics_collection_cost_management: false disable_metrics_collection_resource_optimization: false source: check_cycle: 1440 create_source: true name: 'cluster2' upload: upload_cycle: 360 upload_toggle: true
create_source: false name: ''
create_source: true name: my-openshift-cost-source
prometheus: last_query_start_time: '2021-01-25T20:59:06Z' last_query_success_time: '2021-01-25T20:59:06Z' prometheus_configured: true prometheus_connected: true service_address: 'https://thanos-querier.openshift-monitoring.svc:9091' skip_tls_verification: false
upload: ingress_path: /api/ingress/v1/upload last_successful_upload_time: '2021-01-25T20:59:35Z' last_upload_status: 202 Accepted last_upload_time: '2021-01-25T20:59:35Z' upload: true upload_cycle: 360 upload_wait: 28 validate_cert: true
service-account-auth-secret
client_id
red_hat_service_account_client_id
client_secret
red_hat_service_account_client_secret
authentication: type: token
authentication: secret_name: service-account-auth-secret #Change this line to match your secret name. type: service-account
kind: Subscription metadata: spec: config: resources: <<<<< limits: cpu: 500m memory: 500Mi requests: cpu: 200m memory: 100Mi
packaging: max_reports_to_store: 30 max_size_MB: 100
upload: upload_cycle: 360
upload: upload_cycle: 360 upload_toggle: false
source: {}
authentication: {}
packaging: last_successful_packaging_time: `current date and time` max_reports_to_store: 30 max_size_MB: 100 number_of_reports_stored: 1 packaged_files: - >- /tmp/costmanagement-metrics-operator-reports/upload/YYYYMMDDTHHMMSS-cost-mgmt.tar.gz
kind: Pod apiVersion: v1 metadata: name: volume-shell namespace: costmanagement-metrics-operator spec: volumes: - name: costmanagement-metrics-operator-reports persistentVolumeClaim: claimName: costmanagement-metrics-operator-data containers: - name: volume-shell image: busybox command: ['sleep', '3600'] volumeMounts: - name: costmanagement-metrics-operator-reports mountPath: /tmp/costmanagement-metrics-operator-reports
oc rsync volume-shell:/tmp/costmanagement-metrics-operator-reports/upload local/path/to/save/folder
oc rsh volume-shell rm /tmp/costmanagement-metrics-operator-reports/upload/*
oc delete -f volume-shell.yaml
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