mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
- Change in namespace for test-generate example - Change cloneResource to cloneSourceResource - Add support for namespaced Policy and fix log messages - Add test-generate in Makefile and an example of namespaced Policy - Fix namespaced policy issue and add comments - Refactor according to new generate controller - Add json tag to GeneratedResource field of RuleResponse struct Signed-off-by: Shubham Nazare <shubham4443@gmail.com> Co-authored-by: Prateek Pandey <prateek.pandey@nirmata.com> Co-authored-by: Vyankatesh Kudtarkar <vyankateshkd@gmail.com>
23 lines
No EOL
546 B
YAML
23 lines
No EOL
546 B
YAML
apiVersion: kyverno.io/v1
|
|
kind: Policy
|
|
metadata:
|
|
name: create-default-pdb
|
|
namespace: hello-world
|
|
spec:
|
|
rules:
|
|
- name: create-default-pdb
|
|
match:
|
|
resources:
|
|
kinds:
|
|
- Deployment
|
|
generate:
|
|
apiVersion: policy/v1
|
|
kind: PodDisruptionBudget
|
|
name: "{{request.object.metadata.name}}-default-pdb"
|
|
namespace: "{{request.object.metadata.namespace}}"
|
|
data:
|
|
spec:
|
|
minAvailable: 1
|
|
selector:
|
|
matchLabels:
|
|
"{{request.object.metadata.labels}}" |