-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into convert-best-practices-to-cel
- Loading branch information
Showing
141 changed files
with
3,157 additions
and
172 deletions.
There are no files selected for viewing
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
21 changes: 0 additions & 21 deletions
21
kasten/k10-data-protection-by-label/.kyverno-test/kyverno-test.yaml
This file was deleted.
Oops, something went wrong.
60 changes: 0 additions & 60 deletions
60
kasten/k10-data-protection-by-label/.kyverno-test/nginx-deployment.yaml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
kasten/k10-data-protection-by-label/k10-data-protection-by-label.yaml
This file was deleted.
Oops, something went wrong.
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
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
6 changes: 6 additions & 0 deletions
6
kasten/kasten-data-protection-by-label/.chainsaw-test/chainsaw-step-01-assert-1.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: kasten-data-protection-by-label | ||
status: | ||
ready: true |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
33 changes: 33 additions & 0 deletions
33
kasten/kasten-data-protection-by-label/.kyverno-test/kyverno-test.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: cli.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
name: kyverno_data_protection_tests | ||
policies: | ||
- ../kasten-data-protection-by-label.yaml | ||
resources: | ||
- nginx-deployment.yaml | ||
results: | ||
- kind: Deployment | ||
policy: kasten-data-protection-by-label | ||
resources: | ||
- nginx-deployment-invalid | ||
result: fail | ||
rule: kasten-data-protection-by-label | ||
- kind: Deployment | ||
policy: kasten-data-protection-by-label | ||
resources: | ||
- nginx-deployment-pass | ||
result: pass | ||
rule: kasten-data-protection-by-label | ||
- kind: Deployment | ||
policy: kasten-data-protection-by-label | ||
resources: | ||
- nginx-deployment-none | ||
result: pass | ||
rule: kasten-data-protection-by-label | ||
- kind: Deployment | ||
policy: kasten-data-protection-by-label | ||
resources: | ||
- nginx-deployment-skipped | ||
result: skip | ||
rule: kasten-data-protection-by-label |
100 changes: 100 additions & 0 deletions
100
kasten/kasten-data-protection-by-label/.kyverno-test/nginx-deployment.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment-pass | ||
namespace: nginx | ||
labels: | ||
app: nginx | ||
purpose: production | ||
dataprotection: kasten-example | ||
immutable: enabled | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment-none | ||
namespace: nginx | ||
labels: | ||
app: nginx | ||
purpose: production | ||
dataprotection: none | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment-invalid | ||
namespace: nginx | ||
labels: | ||
app: nginx | ||
purpose: production | ||
dataprotection: invalid | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment-skipped | ||
namespace: nginx | ||
labels: | ||
app: nginx | ||
purpose: test | ||
dataprotection: kasten-example | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 |
25 changes: 25 additions & 0 deletions
25
kasten/kasten-data-protection-by-label/artifacthub-pkg.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: kasten-data-protection-by-label | ||
version: 1.0.1 | ||
displayName: Check Data Protection By Label | ||
createdAt: "2023-05-07T00:00:00.000Z" | ||
description: >- | ||
Check the 'dataprotection' label for production Deployments and StatefulSet workloads. | ||
Use in combination with 'kasten-generate-example-backup-policy' policy to generate a Kasten policy for the workload namespace, if it doesn't already exist. | ||
install: |- | ||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/kyverno/policies/main/kasten/kasten-data-protection-by-label/kasten-data-protection-by-label.yaml | ||
``` | ||
keywords: | ||
- kyverno | ||
- Veeam Kasten | ||
readme: | | ||
Check the 'dataprotection' label for production Deployments and StatefulSet workloads. | ||
Use in combination with 'kasten-generate-example-backup-policy' policy to generate a Kasten policy for the workload namespace, if it doesn't already exist. | ||
Refer to the documentation for more details on Kyverno annotations: https://artifacthub.io/docs/topics/annotations/kyverno/ | ||
annotations: | ||
kyverno/category: "Veeam Kasten" | ||
kyverno/kubernetesVersion: "1.24-1.30" | ||
kyverno/subject: "Deployment, StatefulSet" | ||
digest: 8751cca18f18d7a2cd1b923e84b805580af363b1aff8766fc4f3f231d6026601 |
Oops, something went wrong.