diff --git a/component/billing.jsonnet b/component/billing.jsonnet index 240816cd2..1f12d54d5 100644 --- a/component/billing.jsonnet +++ b/component/billing.jsonnet @@ -148,7 +148,8 @@ local backfillCJ = function(name, query, sla, type) }, }, }, - failedJobsHistoryLimit: 10, + failedJobsHistoryLimit: 3, + successfulJobsHistoryLimit: 0, }, }; @@ -157,8 +158,8 @@ local generateCloudAndManaged = function(name) // For postgresql we have a missmatch between the label and the name in our definition. local queryName = if name == 'postgres' then name + 'ql' else name; - local managedQuery = 'sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-' + queryName + '",label_appcat_vshn_io_sla="%s", tenant_name!="APPUiO"}[59:1])/60'; - local cloudQuery = 'sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-' + queryName + '",label_appcat_vshn_io_sla="%s", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60'; + local managedQuery = 'sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-' + queryName + '",label_appcat_vshn_io_sla="%s", tenant_name!="APPUiO"}[59m:1m])/60'; + local cloudQuery = 'sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-' + queryName + '",label_appcat_vshn_io_sla="%s", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60'; local permutations = [ { diff --git a/component/main.jsonnet b/component/main.jsonnet index 66428d7ec..68e8eed25 100644 --- a/component/main.jsonnet +++ b/component/main.jsonnet @@ -8,6 +8,7 @@ local slos = import 'slos.libsonnet'; local inv = kap.inventory(); local params = inv.parameters.appcat; local pgParams = params.services.vshn.postgres; +local appuioManaged = inv.parameters.appcat.appuioManaged; local xrdBrowseRole = kube.ClusterRole('appcat:browse') + { metadata+: { @@ -85,7 +86,11 @@ local ns = kube.Namespace(params.namespace) { labels+: { 'openshift.io/cluster-monitoring': 'true', } + params.namespaceLabels, - annotations+: params.namespaceAnnotations, + annotations+: + if !appuioManaged then { + 'resourcequota.appuio.io/organization-objects.jobs': '300', + } + params.namespaceAnnotations + else params.namespaceAnnotations, }, }; diff --git a/tests/golden/billing/appcat/appcat/billing/11_backfill.yaml b/tests/golden/billing/appcat/appcat/billing/11_backfill.yaml index d399897c2..2ca60b2c3 100644 --- a/tests/golden/billing/appcat/appcat/billing/11_backfill.yaml +++ b/tests/golden/billing/appcat/appcat/billing/11_backfill.yaml @@ -11,7 +11,7 @@ metadata: name: appcat-vshn-keycloak-besteffort-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -64,7 +64,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-keycloak",label_appcat_vshn_io_sla="besteffort", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -84,7 +84,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -99,7 +99,7 @@ metadata: name: appcat-vshn-keycloak-guaranteed-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -152,7 +152,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-keycloak",label_appcat_vshn_io_sla="guaranteed", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -172,7 +172,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -187,7 +187,7 @@ metadata: name: appcat-vshn-keycloak-besteffort-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -238,7 +238,7 @@ spec: value: appcat-vshn-keycloak-besteffort - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-keycloak",label_appcat_vshn_io_sla="besteffort", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -258,7 +258,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -273,7 +273,7 @@ metadata: name: appcat-vshn-keycloak-guaranteed-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -324,7 +324,7 @@ spec: value: appcat-vshn-keycloak-guaranteed - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-keycloak",label_appcat_vshn_io_sla="guaranteed", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -344,7 +344,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -359,7 +359,7 @@ metadata: name: appcat-vshn-mariadb-besteffort-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -412,7 +412,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-mariadb",label_appcat_vshn_io_sla="besteffort", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -432,7 +432,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -447,7 +447,7 @@ metadata: name: appcat-vshn-mariadb-guaranteed-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -500,7 +500,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-mariadb",label_appcat_vshn_io_sla="guaranteed", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -520,7 +520,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -535,7 +535,7 @@ metadata: name: appcat-vshn-mariadb-besteffort-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -586,7 +586,7 @@ spec: value: appcat-vshn-mariadb-besteffort - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-mariadb",label_appcat_vshn_io_sla="besteffort", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -606,7 +606,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -621,7 +621,7 @@ metadata: name: appcat-vshn-mariadb-guaranteed-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -672,7 +672,7 @@ spec: value: appcat-vshn-mariadb-guaranteed - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-mariadb",label_appcat_vshn_io_sla="guaranteed", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -692,7 +692,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -707,7 +707,7 @@ metadata: name: appcat-vshn-minio-besteffort-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -760,7 +760,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-minio",label_appcat_vshn_io_sla="besteffort", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -780,7 +780,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -795,7 +795,7 @@ metadata: name: appcat-vshn-minio-guaranteed-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -848,7 +848,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-minio",label_appcat_vshn_io_sla="guaranteed", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -868,7 +868,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -883,7 +883,7 @@ metadata: name: appcat-vshn-minio-besteffort-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -934,7 +934,7 @@ spec: value: appcat-vshn-minio-besteffort - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-minio",label_appcat_vshn_io_sla="besteffort", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -954,7 +954,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -969,7 +969,7 @@ metadata: name: appcat-vshn-minio-guaranteed-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1020,7 +1020,7 @@ spec: value: appcat-vshn-minio-guaranteed - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-minio",label_appcat_vshn_io_sla="guaranteed", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1040,7 +1040,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1055,7 +1055,7 @@ metadata: name: appcat-vshn-nextcloud-besteffort-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1108,7 +1108,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-nextcloud",label_appcat_vshn_io_sla="besteffort", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1128,7 +1128,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1143,7 +1143,7 @@ metadata: name: appcat-vshn-nextcloud-guaranteed-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1196,7 +1196,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-nextcloud",label_appcat_vshn_io_sla="guaranteed", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1216,7 +1216,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1231,7 +1231,7 @@ metadata: name: appcat-vshn-nextcloud-besteffort-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1282,7 +1282,7 @@ spec: value: appcat-vshn-nextcloud-besteffort - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-nextcloud",label_appcat_vshn_io_sla="besteffort", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1302,7 +1302,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1317,7 +1317,7 @@ metadata: name: appcat-vshn-nextcloud-guaranteed-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1368,7 +1368,7 @@ spec: value: appcat-vshn-nextcloud-guaranteed - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-nextcloud",label_appcat_vshn_io_sla="guaranteed", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1388,7 +1388,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1403,7 +1403,7 @@ metadata: name: appcat-vshn-postgres-besteffort-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1456,7 +1456,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-postgresql",label_appcat_vshn_io_sla="besteffort", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1476,7 +1476,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1491,7 +1491,7 @@ metadata: name: appcat-vshn-postgres-guaranteed-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1544,7 +1544,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-postgresql",label_appcat_vshn_io_sla="guaranteed", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1564,7 +1564,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1579,7 +1579,7 @@ metadata: name: appcat-vshn-postgres-besteffort-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1630,7 +1630,7 @@ spec: value: appcat-vshn-postgres-besteffort - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-postgresql",label_appcat_vshn_io_sla="besteffort", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1650,7 +1650,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1665,7 +1665,7 @@ metadata: name: appcat-vshn-postgres-guaranteed-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1716,7 +1716,7 @@ spec: value: appcat-vshn-postgres-guaranteed - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-postgresql",label_appcat_vshn_io_sla="guaranteed", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1736,7 +1736,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1751,7 +1751,7 @@ metadata: name: appcat-vshn-redis-besteffort-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1804,7 +1804,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-redis",label_appcat_vshn_io_sla="besteffort", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1824,7 +1824,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1839,7 +1839,7 @@ metadata: name: appcat-vshn-redis-guaranteed-cloud namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1892,7 +1892,7 @@ spec: value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-redis",label_appcat_vshn_io_sla="guaranteed", tenant_name="APPUiO"} * on(label_appuio_io_organization) group_left(sales_order) label_replace(appuio_control_organization_info{namespace="appuio-control-api-production"}, - "label_appuio_io_organization", "$1", "organization", "(.*)")[59:1])/60 + "label_appuio_io_organization", "$1", "organization", "(.*)")[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1912,7 +1912,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -1927,7 +1927,7 @@ metadata: name: appcat-vshn-redis-besteffort-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -1978,7 +1978,7 @@ spec: value: appcat-vshn-redis-besteffort - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-redis",label_appcat_vshn_io_sla="besteffort", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -1998,7 +1998,7 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 --- apiVersion: batch/v1 kind: CronJob @@ -2013,7 +2013,7 @@ metadata: name: appcat-vshn-redis-guaranteed-managed namespace: syn-appcat spec: - failedJobsHistoryLimit: 10 + failedJobsHistoryLimit: 3 jobTemplate: metadata: annotations: @@ -2064,7 +2064,7 @@ spec: value: appcat-vshn-redis-guaranteed - name: AR_QUERY value: sum_over_time(appcat:metering{label_appuio_io_billing_name="appcat-redis",label_appcat_vshn_io_sla="guaranteed", - tenant_name!="APPUiO"}[59:1])/60 + tenant_name!="APPUiO"}[59m:1m])/60 - name: AR_INSTANCE_JSONNET value: local labels = std.extVar("labels"); "%(cluster_id)s/%(label_appcat_vshn_io_claim_namespace)s/%(label_appcat_vshn_io_claim_name)s" % labels @@ -2084,4 +2084,4 @@ spec: restartPolicy: OnFailure schedule: 30 * * * * startingDeadlineSeconds: 180 - successfulJobsHistoryLimit: 3 + successfulJobsHistoryLimit: 0 diff --git a/tests/golden/cloudscale/appcat/appcat/10_appcat_namespace.yaml b/tests/golden/cloudscale/appcat/appcat/10_appcat_namespace.yaml index f41aa3065..5f0016faa 100644 --- a/tests/golden/cloudscale/appcat/appcat/10_appcat_namespace.yaml +++ b/tests/golden/cloudscale/appcat/appcat/10_appcat_namespace.yaml @@ -3,6 +3,7 @@ kind: Namespace metadata: annotations: openshift.io/node-selector: node-role.kubernetes.io/infra= + resourcequota.appuio.io/organization-objects.jobs: '300' labels: name: syn-appcat openshift.io/cluster-monitoring: 'true' diff --git a/tests/golden/exoscale/appcat/appcat/10_appcat_namespace.yaml b/tests/golden/exoscale/appcat/appcat/10_appcat_namespace.yaml index f41aa3065..5f0016faa 100644 --- a/tests/golden/exoscale/appcat/appcat/10_appcat_namespace.yaml +++ b/tests/golden/exoscale/appcat/appcat/10_appcat_namespace.yaml @@ -3,6 +3,7 @@ kind: Namespace metadata: annotations: openshift.io/node-selector: node-role.kubernetes.io/infra= + resourcequota.appuio.io/organization-objects.jobs: '300' labels: name: syn-appcat openshift.io/cluster-monitoring: 'true' diff --git a/tests/golden/vshn/appcat/appcat/10_appcat_namespace.yaml b/tests/golden/vshn/appcat/appcat/10_appcat_namespace.yaml index f41aa3065..5f0016faa 100644 --- a/tests/golden/vshn/appcat/appcat/10_appcat_namespace.yaml +++ b/tests/golden/vshn/appcat/appcat/10_appcat_namespace.yaml @@ -3,6 +3,7 @@ kind: Namespace metadata: annotations: openshift.io/node-selector: node-role.kubernetes.io/infra= + resourcequota.appuio.io/organization-objects.jobs: '300' labels: name: syn-appcat openshift.io/cluster-monitoring: 'true'