Implement scale sub-resource
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
🥰 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Merge this PR after this one: https://github.com/kyma-project/kyma/pull/14976
/retest
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
/retest
/retest
/retest
/test pre-main-kyma-integration-k3d-central-app-connectivity-compass
/test pre-main-kyma-gke-external-registry
/retest
@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.