Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Create HPAv2 through stack.yml #688

Open
haozibi opened this issue Sep 10, 2019 · 3 comments
Open

[Feature request] Create HPAv2 through stack.yml #688

haozibi opened this issue Sep 10, 2019 · 3 comments

Comments

@haozibi
Copy link

haozibi commented Sep 10, 2019

Hello @alexellis , I want to ask some questions about HPAv2.

I have changed the auto-scaling to HPAv2 by https://docs.openfaas.com/tutorials/kubernetes-hpa/ and it works fine.

But there are some questions about creating the HPAv2 rule, can I add the HPAv2 rule using faas-cli or function yaml instead of kubectl. Because I have to deploy more functions, and I don't have permission to use kubectl

this is my function yaml

version: 1.0
provider:
  name: openfaas
  gateway: http://127.0.0.1:9090
functions:
  hpa-002:
    lang: go
    handler: ./hpa-002
    image: hpa-002:latest
    requests:
      memory: 50Mi
      cpu: 200m
    limits:
      memory: 500Mi
      cpu: 3000m
    environment:
      write_debug: true
      read_timeout: 90s
      write_timeout: 90s

Expected Behaviour

Add HPAv2 rule by faas-cli or function yaml

Current Behaviour

Add HPAv2 rule by kubectl

kubectl autoscale deployment -n openfaas-fn \
  nodeinfo \
  --cpu-percent=50 \
  --min=1 \
  --max=10

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ):

  • Docker version ( Full output from: docker version ):

  • Are you using Docker Swarm (FaaS-swarm ) or Kubernetes (FaaS-netes)?

  • Operating System and version (e.g. Linux, Windows, MacOS):

  • Link to your project or a code example to reproduce issue:

@alexellis
Copy link
Member

/set title: [Feature request] Create HPAv2 through stack.yml

@derek derek bot changed the title about create HPAv2 rule [Feature request] Create HPAv2 through stack.yml Sep 10, 2019
@sqaisar
Copy link

sqaisar commented Jun 16, 2022

is there any update to this? We also want to use kubernetes HPAv2 to scale through stack.yml in openfaas functions deployment

@welteki
Copy link
Member

welteki commented Jun 17, 2022

Hi, @sqaisar

Since this issue was opened we did create a new auto-scaling engine for OpenFaas Pro.

It supports scaling to zero and has multiple scaling modes like capacity, rps and cpu based scaling.

The scaling rules are configured by setting labels on the function which can be done through the function yaml file or using the faas-cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants