Parameters

The parent key for all of the following parameters is appuio_reporting.

namespace

type

string

default

${_instance}

The namespace in which to deploy this component.

namespaceMetadata

type

dictionary

default
namespaceMetadata:
  labels:
    openshift.io/cluster-monitoring: 'true'

The namespace metadata to apply to the namespace created by this component.

images

type

dictionary

default

See class/defaults.yml.

Dictionary containing the container images used by this component.

images.reporting

type

dictionary

The image used for managing data in the reporting database.

development_mode

type

boolean

default

false

This parameter allows to enable development mode for the component. The component prevents certain configurations if development is disabled.

schedules_suspend

type

dictionary

default
backfill: false
check_missing: false
invoice: false

This parameter allows users to selectively suspend one or more of the periodic jobs. It is only available if development_mode is set to true.

A suspended CronJob still exists on the cluster, but no new jobs are created based on the CronJob’s schedule.

Never use this parameter to disable CronJobs because they trigger alerts. Instead investigate why the alerts are triggered, and resolve the actual cause, such as missing data in the billing database.

By disabling one or more of the periodic jobs, you’ll most likely break the usage-based billing for the APPUiO instance. Breaking the usage-based billing will lead to lost income for the APPUiO instance.

override_sales_order_id

type

string

default

null

If set, this parameter causes all metered billing records sent to Odoo to have the same static sales_order_id, which is set to the value of this parameter. This is only available if development_mode is set to true.

Setting this parameter will very likely result in faulty billing data. It should not be set against a productive system. Its purpose is to allow testing of the reporting process against a test system, in which the correct sales orders may not exist.

extra_volumes

type

dictionary

default
extra_volumes: {}

Mount additional volumes to the pods.

Example

extra_volumes:
  dbsecret:
    mount_spec:
      readOnly: true
      mountPath: /secrets/database
    volume_spec:
      secret:
        secretName: reporting-db-prod-cred
        defaultMode: 0600

prometheus.url

type

string

default

null

URL used to connect with the Prometheus/Thanos Instance.

prometheus.org_id

type

string

default

null

If set, this value is sent as the X-Scope-OrgID header in all requests to Prometheus.

This parameter can be overridden for each individual rule by setting the prometheus_org_id parameter on the rule.

odoo.metered_billing_endpoint

type

string

default

null

URL of the REST API to which to send metered billing records.

odoo.oauth

type

dictionary

default
token_endpoint: null
client_id: null
client_secret: null

Configuration of the OAuth client used to connect to the metered billing REST API.

rules

type

dictionary

default

See class/defaults.yml.

example
cluster_id_to_name_map:
  c-cluster1: "My Cluster"
  c-other-cluster: "My Other Cluster"

A dictionary mapping cluster IDs to a more human friendly name. Use this within rules by referencing it like ${appuio_reporting:cluster_d_to_name_map:c-cluster1}.

rules

type

dictionary

default

See class/defaults.yml.

example
rule_appuio_managed_vcpu: (1)
  enabled: true
  products: (2)
    - product_id: 'openshift-worker-vcpu-cloudscale-besteffort' (3)
      params: (4)
        vshn_service_level: best-effort
        cloud_provider: cloudscale
    - product_id: 'openshift-worker-vcpu-cloudscale-guaranteedavailability'
      params:
        vshn_service_level: guaranteed-availability
        cloud_provider: cloudscale
  instance_id_pattern: '%(cluster_id)s' (5)
  item_description_pattern: 'All Compute Resources' (6)
  item_group_description_pattern: 'APPUiO Managed OpenShift - Cluster: %(cluster_id)s' (7)
  unit_id: 'uom_00000' (8)
  query_pattern: | (9)
    max_over_time(
      sum by(cluster_id, vshn_service_level, tenant_id, role, cloud_provider, sales_order_id) (
        node_cpu_info{cloud_provider="%(cloud_provider)s", vshn_service_level="%(vshn_service_level)s"}
      )[59m:1m]
    )
  prometheus_org_id: my-prom-org (10)
1 Multiple rules can be defined in the dictionary, with the rule name serving as key.
2 All products whose corresponding queries can be generated from this rule should be listed here.
3 Odoo ID of the product for which usage is being queried.
4 Dictionary of arbitrary parameters describing the product. These will be applied to the query_pattern.
5 The labels of the query result are applied to this pattern to generate the instance ID.
6 (Optional) The labels of the query result are applied to this pattern to generate the human readable item description.
7 (Optional) The labels of the query result are applied to this pattern to generate the human readable item group description.
8 Odoo ID of the unit of measurement used.
9 The product params are applied to this pattern to generate one query for each product.
10 (Optional) If set, the value of the X-Scope-OrgID header used for Prometheus queries from this rule. Overrides the prometheus.org_id parameter.

Dictionary containing rules by which to generate Prometheus queries. A rule corresponds to a single query template, from which queries for multiple products may be generated.

For more information on the individual parameters and how they are used, refer to Metered Billing Data Flow.

In place of instance_id_pattern, item_description_pattern and item_group_description_pattern, it is also possible to specify instance_id_jsonnet, item_description_jsonnet or item_group_description_jsonnet, respectively. These parameters contain a jsonnet snippet which should evaluate to a string containing the parameter in question. The jsonnet is evaluated with an external variable named labels containing all query result labels as a dictionary. It can be accessed in the snippet e.g. with local labels = std.extVar("labels");.

The jsonnet parameter takes precedence over the pattern parameter if both are specified.

Note that there is no jsonnet variant for the query_pattern parameter.

CronJobs are spread across the hour to allow for a more even load on the cluster and Prometheus.

network_policies.target_namespaces

type

dictionary

default

{}

example
appuio-reporting-database: true
appuio-thanos: true

Injects a network policy into the target namespace given by the key, allowing communication to the namespace.

This is a workaround and the parameter will disappear once we’ve a more native way to manage network policies with Project Syn.

monitoring.enabled

type

boolean

default

true

The component creates Prometheus and Alertmanager objects if enabled.

monitoring.alerts

type

dictionary

example
APPUiOReportingDidSomething:
  enabled: false
  rule:
    annotations:
      description: APPUiOReporting did something.
      message: APPUiOReporting did something.
      runbook: https://hub.syn.tools/appuio-reporting/runbooks/APPUiOReportingDidSomething.html
    expr: |
      appuio_reporting_doing_something > 1
    for: 10m
    labels:
      severity: warning

Alerts monitoring the reporting cron jobs.