kyma icon indicating copy to clipboard operation
kyma copied to clipboard

Implement scale sub-resource

Open pPrecel opened this issue 3 years ago • 5 comments

Description

Changes proposed in this pull request:

  • implement scale sub-resource to enable scaling functions using Kubernetes-based scalers (like HPA)

Related issue(s)

https://github.com/kyma-project/kyma/issues/12838

pPrecel avatar Jun 27 '22 20:06 pPrecel

🥰 Documentation preview ready! 🥰

Name Link
Latest commit db2c42104e09b08318dac735049873bba6939948
Latest deploy log https://app.netlify.com/sites/kyma-project-docs-preview/deploys/62ff537eac90a70008af35bf
Deploy Preview https://deploy-preview-14704--kyma-project-docs-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 27 '22 21:06 netlify[bot]

Merge this PR after this one: https://github.com/kyma-project/kyma/pull/14976

pPrecel avatar Aug 01 '22 09:08 pPrecel

/retest

pPrecel avatar Aug 01 '22 10:08 pPrecel

To test this functionality create HPA for the function by applying HPA for example:

apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: <func_name>
spec:
  maxReplicas: 10
  minReplicas: 5
  scaleTargetRef:
    apiVersion: serverless.kyma-project.io/v1alpha2
    kind: Function
    name: demo
  targetCPUUtilizationPercentage: 50

or use kubectl to do that:

kubectl autoscale function <func_name> --cpu-percent=50 --min=5 --max=10

of course you can use KEDA ScaledObject or any Kubernetes based scaler

example function:

apiVersion: serverless.kyma-project.io/v1alpha2
kind: Function
metadata:
  name: demo
  labels:
    foo: bar
spec:
  runtime: nodejs14
  source:
    inline:
      dependencies: ""
      source: |
        module.exports = {
            main: function(event, context) {
              return 'Hello World'
            }
          }
  replicas: 2

pPrecel avatar Aug 01 '22 10:08 pPrecel

/retest

pPrecel avatar Aug 18 '22 07:08 pPrecel

/retest

pPrecel avatar Aug 19 '22 07:08 pPrecel

/retest

dbadura avatar Aug 19 '22 09:08 dbadura

/test pre-main-kyma-integration-k3d-central-app-connectivity-compass

dbadura avatar Aug 19 '22 09:08 dbadura

/test pre-main-kyma-gke-external-registry

dbadura avatar Aug 19 '22 11:08 dbadura

/retest

dbadura avatar Aug 19 '22 11:08 dbadura

@pPrecel: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pre-main-test-infra-pjtester-v2 63d354d38bc5551c50d14c0057e040d5a408f5ea link true /test pre-main-test-infra-pjtester-v2
pre-main-kyma-skr-eventing a1cfa5abf47ce180d8da02d6a85b3812dfa59a3b link false /test pre-main-kyma-skr-eventing
pre-main-kyma-integration-k3d-app-conn-validator 47d019eee338a2e294c1658a5e812b574c38b9a6 link false /test pre-main-kyma-integration-k3d-app-conn-validator
pre-main-kyma-integration-k3d-app-gateway 47d019eee338a2e294c1658a5e812b574c38b9a6 link false /test pre-main-kyma-integration-k3d-app-gateway
pre-main-kyma-integration-k3d-central-app-connectivity-compass 47d019eee338a2e294c1658a5e812b574c38b9a6 link false /test pre-main-kyma-integration-k3d-central-app-connectivity-compass

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

kyma-bot avatar Aug 19 '22 12:08 kyma-bot