openfaas / openfaas/faas-cli

[Feature request] Create HPAv2 through stack.yml

Open
#688 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the faas-cli handling for stack.yml and function YAML, then compare it with the Kubernetes HPA tutorial and the shown kubectl autoscale command. Define how HPAv2 settings would be represented and applied through faas-cli; done means a function deployment can create the requested rule without direct kubectl access.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, yaml
Domain
cli, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.