-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Provide the capability for 3rd parties to integrate in our validation webhook #4395
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Any thoughts on this @kedacore/keda-maintainers? |
We should have this. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Since no one has commented on this yet; 3rd-party validation can be done with the upcoming feature ValidatingAdmissionPolicy without any changes required on keda part. https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/ |
Good call @pokgak! That configuration worked well for me: apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: "limit-apps-replicas.example.com"
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups: ["apps"]
apiVersions: ["v1"]
operations: ["CREATE", "UPDATE"]
resources: ["deployments", "replicasets"]
validations:
- expression: "object.spec.replicas <= 10"
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: "limit-keda-replicas.example.com"
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups: ["keda.sh"]
apiVersions: ["v1alpha1"]
operations: ["CREATE", "UPDATE"]
resources: ["scaledobjects"]
validations:
- expression: "object.spec.maxReplicaCount <= 10"
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: "limit-apps-replicas-binding.example.com"
spec:
policyName: "limit-apps-replicas.example.com"
validationActions: [Deny]
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: k8s-limitations
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: "limit-keda-replicas-binding.example.com"
spec:
policyName: "limit-keda-replicas.example.com"
validationActions: [Deny]
matchResources:
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: k8s-limitations |
@Tomer20 this is great, could you please contribute this to our documentation? Probably here: https://keda.sh/docs/2.15/operate/admission-webhooks/ |
Sure thing @zroubalik 😄 Here's the PR, any feedback is welcome: kedacore/keda-docs#1471. |
Proposal
Provide the capability for 3rd parties to integrate in our validation webhook so that they integrate their own logic.
This should be done by introducing a new CRD which defines an HTTP/gRPC endpoint that KEDA will call during validation. If the validation endpoint becomes unreachable/non responding, then the status of the new CRD should reflect this but validation will be skipped for a while to avoid it causing KEDA to fail/time out.
Use-Case
Provide the capability for 3rd parties to integrate in our validation webhook so that they integrate their own logic.
This allows platform builders/cluster operators to enforce their own best practices and tie in to our validation process.
Is this a feature you are interested in implementing yourself?
No
Anything else?
No response
The text was updated successfully, but these errors were encountered: