cancel
Showing results for 
Search instead for 
Did you mean: 

How to "attach" config of scaling policy for autoscaler in mta.yaml

alugunov
Explorer
1,457

Hello,

I am trying to deploy our application with autoscaler service and use JSON file with policy configuration to create a policy during deployment. I tried different configuration options in mta.yaml - but no success. Either policy is not created or deployment failed with error: "can not update default policy....."

So, this is a snap from mta.yaml (resources part)

- name: autoscaler-XXX

type: org.cloudfoundry.managed-service

parameters:

service: autoscaler

service-plan: standard

config-path: ./autoscaler.json

If I use "config-path" - nothing happens - deployment is successfully, but policy is not applied. After deployment I have to create policy manually.

If I use "path" - deployment failed with message above.

Do you have any hints for autoscaler?

Google also didn't find answer....

best regards,

Andrey

View Entire Topic
mariusobert
Developer Advocate
Developer Advocate
0 Kudos

I'm not familiar with this specific service but generally speaking, you need to use "path" under "parameters" (Look here for the entire sample).

The text editor screws up the formatting here, so I can't see if you handle the whitespaces correctly.

Also, I'd recommend removing the entire service instance and recreate it to avoid weird update issues.

alugunov
Explorer
0 Kudos

Hi Marius,

thanks for answer. mta.yaml is correctly formatted, I just copy pasted as text, here is also screen shot

If I deploy from "scratch" - everything is fine, but scaling policy from file autoscaler.json is not applied (problem #1).

If I do update deployment - it is failed with error:

Controller operation failed: 502 Updating service "app-autoscaler" failed: Bad Gateway: CF-ServiceBrokerRequestRejected(10001): Service broker error: Service broker autoscaler-broker failed with: {"code":"Unprocessable Entity","message":"Failed to update service instance: Only default_policy updates allowed"}

This is a problem #2. Then I have to unbind autoscaler service, delete it and deploy agian from "scratch".

best regards,

Andrey

mariusobert
Developer Advocate
Developer Advocate
0 Kudos

I guess it's not applied because you use "config-path". I don't think this can work - it should just be "path"

KrishmaBhatia
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

Is it possible to add auto-scaling service and auto-scaling policies for API/Job having manifest.yml file and not mta.yaml file? If yes,any git reference would be helpful.

Thanks in advance!

Regards,

Krishma

silvestre
Product and Topic Expert
Product and Topic Expert