Skip to content

Commit

Permalink
Add explanations for validations.keda.sh/hpa-ownership (#1358)
Browse files Browse the repository at this point in the history
Signed-off-by: June Han <sorrowitsch@gmail.com>
Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
  • Loading branch information
junekhan and zroubalik committed Apr 15, 2024
1 parent 09f2857 commit 3c47301
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions content/docs/2.14/concepts/scaling-deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ kind: ScaledObject
metadata:
name: {scaled-object-name}
annotations:
scaledobject.keda.sh/transfer-hpa-ownership: "true" # Optional. Use to transfer an existing HPA ownership to this ScaledObject
autoscaling.keda.sh/paused-replicas: "0" # Optional. Use to pause autoscaling of objects
scaledobject.keda.sh/transfer-hpa-ownership: "true" # Optional. Use to transfer an existing HPA ownership to this ScaledObject
validations.keda.sh/hpa-ownership: "true" # Optional. Use to disable HPA ownership validation on this ScaledObject
autoscaling.keda.sh/paused: "true" # Optional. Use to pause autoscaling of objects explicitly
spec:
scaleTargetRef:
Expand Down Expand Up @@ -413,6 +413,15 @@ spec:

> ⚠️ **NOTE:** You need to specify a custom HPA name in your ScaledObject matching the existing HPA name you want it to manage.
## Disable validations on an existing HPA

You are allowed to disable admission webhooks validations with the following snippet. It grants you better flexibility but also brings vulnerabilities. Do it **at your own risk**.

```yaml
metadata:
annotations:
validations.keda.sh/hpa-ownership: "true"
```

## Long-running executions

Expand Down
2 changes: 2 additions & 0 deletions content/docs/2.14/operate/admission-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ weight = 100
## Validation Enforcement

By default, the admission webhooks are registered with `failurePolicy: Ignore`, this won't block the resources creation/update when the admission controller is not available. To ensure that the validation is always required and perform validation, setting `failurePolicy` to `Fail` is required.

In particular, the admission webhooks for HPA ownership validation can be skipped by setting the annotation `validations.keda.sh/hpa-ownership` to `"false"`. Be cautious when doing so as it exposes the system to potential risks.

0 comments on commit 3c47301

Please sign in to comment.