cancel
Showing results for 
Search instead for 
Did you mean: 

How to attach autoscaling service and its scaling policy in manifest.yaml file?

KrishmaBhatia
Product and Topic Expert
Product and Topic Expert
1,022

Hello,

I am trying to deploy an API or job with the autoscale service, which has its policies defined in a JSON file, to create an autoscaling policy during deployment in SAP CF. I tried different configuration options in manifest.yaml - but no success.

Do you have any idea how to configure the autoscaler service and define its policies in the manifest.yaml project (not the mta.yaml project)? If yes, any git repo/blog reference having a manifest.yaml with a policy.json file would be helpful.

Regards,

Krishma

View Entire Topic
silvestre
Product and Topic Expert
Product and Topic Expert

Hi Krishma,

the scaling policy is set via binding parameters. With the current cf CLI version 8, it is possible to provide binding parameters in the CF manifest.yaml, e.g.

applications:
- name: your-app
  buildpacks:
  - nodejs_buildpack
  services:
    - name: your-autoscaler-service
      parameters:
        instance_min_count: 1
        instance_max_count: 3
        scaling_rules:
          - metric_type: "throughput"
            breach_duration_secs: 61
            cool_down_secs: 61
            threshold: 100
            operator: ">="
            adjustment: "+1"
          - metric_type: "throughput"
breach_duration_secs: 300 cool_down_secs: 300 threshold: 1 operator: "<=" adjustment: "-1"

Best regards,

Silvestre

KrishmaBhatia
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Silvestre,

I tried the above-mentioned way but it is failing while deploying stating "For application 'jobname': Service instance 'my-autoscaler-service' not found".I have mentioned it in the manifest.yaml as follows:-

---applications: - name: jobname host: hostname memory: 1G buildpack: https://github.com/cloudfoundry/java-buildpack.git

path: target/jarname.jar routes: - route: routename-((SPACE_NAME))-((ORG_NAME)).((HOST)) services: - name: my-autoscaler-service parameters: instance_min_count: 1 instance_max_count: 3 scaling_rules: - metric_type: "throughput" breach_duration_secs: 61 cool_down_secs: 61 threshold: 100 operator: ">=" adjustment: "+2" - metric_type: "throughput" breach_duration_secs: 300 cool_down_secs: 300 threshold: 1 operator: "<=" adjustment: "-2" - destinationname - databasename - por-logging-servicename - por-xsuaa-name - por-jobscheduler-name

Do I need to first create "my-autoscaler-service" service instance in BTP cockpit instances and subscriptions tab?

Regards,

Krishma

silvestre
Product and Topic Expert
Product and Topic Expert

Yes, creating service instances is not supported in CF manifests so you need to create service instances such as the one of Application Autoscaler using other means, e.g., the cockpit or the CLI (cf create-service) beforehand - but it's a one-time action

KrishmaBhatia
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thanks Silvestre! It worked hence closing it.

Regards,

Krishma