-
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 miscellaneous-policies-cel-part-3
- Loading branch information
Showing
49 changed files
with
1,616 additions
and
480 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
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
4 changes: 4 additions & 0 deletions
4
cleanup/cleanup-bare-pods/.chainsaw-test/chainsaw-step-02-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,4 @@ | ||
apiVersion: kyverno.io/v2beta1 | ||
kind: ClusterCleanupPolicy | ||
metadata: | ||
name: clean-bare-pods |
38 changes: 38 additions & 0 deletions
38
cleanup/cleanup-bare-pods/.chainsaw-test/chainsaw-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,38 @@ | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
name: cleanup-bare-pods | ||
spec: | ||
steps: | ||
- name: apply cluster role | ||
try: | ||
- apply: | ||
file: cluster-role.yaml | ||
- name: create a bare pod | ||
try: | ||
- apply: | ||
file: pod.yaml | ||
- assert: | ||
file: pod.yaml | ||
- name: apply cleanup policy | ||
try: | ||
- apply: | ||
file: ../cleanup-bare-pods.yaml | ||
- patch: | ||
resource: | ||
apiVersion: kyverno.io/v2beta1 | ||
kind: ClusterCleanupPolicy | ||
metadata: | ||
name: clean-bare-pods | ||
spec: | ||
schedule: "*/1 * * * *" | ||
- assert: | ||
file: chainsaw-step-02-assert-1.yaml | ||
- name: wait for scheduled deletion | ||
try: | ||
- sleep: | ||
duration: 1m30s | ||
- name: check for bare pod | ||
try: | ||
- error: | ||
file: pod.yaml |
15 changes: 9 additions & 6 deletions
15
...ainsaw-test/chainsaw-step-01-apply-1.yaml → ...are-pods/.chainsaw-test/cluster-role.yaml
100755 → 100644
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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
namespace: kyverno | ||
labels: | ||
app.kubernetes.io/component: background-controller | ||
app.kubernetes.io/component: cleanup-controller | ||
app.kubernetes.io/instance: kyverno | ||
app.kubernetes.io/part-of: kyverno | ||
name: kyverno:background-controller:k10-goldbackuppolicy | ||
name: kyverno:cleanup-controller:barepods | ||
rules: | ||
- apiGroups: | ||
- config.kio.kasten.io | ||
- "" | ||
resources: | ||
- policies | ||
- pods | ||
verbs: | ||
- create | ||
- update | ||
- get | ||
- watch | ||
- list | ||
- delete | ||
|
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,8 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: bare-pod | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.1 |
13 changes: 0 additions & 13 deletions
13
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-01-assert-1.yaml
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-1.yaml
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-2.yaml
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-3.yaml
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-4.yaml
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-5.yaml
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-6.yaml
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-7.yaml
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-step-03-apply-8.yaml
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
kasten/k10-generate-gold-backup-policy/.chainsaw-test/chainsaw-test.yaml
This file was deleted.
Oops, something went wrong.
65 changes: 0 additions & 65 deletions
65
kasten/k10-generate-gold-backup-policy/.chainsaw-test/generated-policy.yaml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.