Created
August 21, 2024 21:26
-
-
Save romilbhardwaj/ce7780bd2c0450ed4a9225e217aeca63 to your computer and use it in GitHub Desktop.
Kyverno Policy for removing smarter-devices/fuse resource when running on DWS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: kyverno.io/v1 | |
kind: ClusterPolicy | |
metadata: | |
name: mutate-dws-pod-template | |
annotations: | |
policies.kyverno.io/title: Remove incompatible resources from PodTemplates | |
policies.kyverno.io/category: Other | |
policies.kyverno.io/severity: low | |
kyverno.io/kyverno-version: 1.10.1 | |
policies.kyverno.io/minversion: 1.6.0 | |
kyverno.io/kubernetes-version: "1.23" | |
policies.kyverno.io/subject: PodTemplate | |
policies.kyverno.io/description: >- | |
Removes unsupported resource requests from PodTemplate manifests to allow submission to DWS queue. | |
spec: | |
mutateExistingOnPolicyUpdate: false | |
background: false | |
failurePolicy: Ignore | |
rules: | |
- name: mutate-remove-unsupported-resources | |
match: | |
resources: | |
kinds: | |
- PodTemplate | |
namespaceSelector: | |
matchExpressions: | |
- key: role | |
operator: In | |
values: | |
- kueue-jobs | |
mutate: | |
foreach: | |
- list: "request.object.template.spec.containers" | |
patchesJson6902: |- | |
- path: /template/spec/containers/{{elementIndex}}/resources/requests/smarter-devices~1fuse | |
op: remove | |
- path: /template/spec/containers/{{elementIndex}}/resources/limits/smarter-devices~1fuse | |
op: remove | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment