on 2022 Nov 16 11:15 AM
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
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.gitpath: 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
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
User | Count |
---|---|
78 | |
22 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.