mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
remove duplicate crd changes
This commit is contained in:
parent
9d6d0eecb0
commit
d96f3e6c89
12 changed files with 2270 additions and 1242 deletions
8
Makefile
8
Makefile
|
@ -115,5 +115,13 @@ code-cov-report: $(CODE_COVERAGE_FILE_TXT)
|
||||||
go tool cover -html=coverage.txt
|
go tool cover -html=coverage.txt
|
||||||
if [ -a $(CODE_COVERAGE_FILE_HTML) ]; then open $(CODE_COVERAGE_FILE_HTML); fi;
|
if [ -a $(CODE_COVERAGE_FILE_HTML) ]; then open $(CODE_COVERAGE_FILE_HTML); fi;
|
||||||
|
|
||||||
|
# godownloader create downloading script for kyverno-cli
|
||||||
godownloader:
|
godownloader:
|
||||||
godownloader .goreleaser.yml --repo nirmata/kyverno -o ./scripts/install-cli.sh --source="raw"
|
godownloader .goreleaser.yml --repo nirmata/kyverno -o ./scripts/install-cli.sh --source="raw"
|
||||||
|
|
||||||
|
# kustomize-crd will create install.yaml
|
||||||
|
kustomize-crd:
|
||||||
|
# Create CRD
|
||||||
|
kustomize build ./definitions/crds > ./charts/kyverno/crds/crds.yaml
|
||||||
|
kustomize build ./definitions > ./definitions/install.yaml
|
||||||
|
kustomize build ./definitions/debug > ./definitions/install_debug.yaml
|
|
@ -4,461 +4,377 @@ metadata:
|
||||||
name: clusterpolicies.kyverno.io
|
name: clusterpolicies.kyverno.io
|
||||||
spec:
|
spec:
|
||||||
group: kyverno.io
|
group: kyverno.io
|
||||||
versions:
|
|
||||||
- name: v1
|
|
||||||
served: true
|
|
||||||
storage: true
|
|
||||||
scope: Cluster
|
|
||||||
names:
|
names:
|
||||||
kind: ClusterPolicy
|
kind: ClusterPolicy
|
||||||
plural: clusterpolicies
|
plural: clusterpolicies
|
||||||
singular: clusterpolicy
|
|
||||||
shortNames:
|
shortNames:
|
||||||
- cpol
|
- cpol
|
||||||
|
singular: clusterpolicy
|
||||||
|
scope: Cluster
|
||||||
subresources:
|
subresources:
|
||||||
status: {}
|
status: {}
|
||||||
validation:
|
validation:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
properties:
|
properties:
|
||||||
status: {}
|
|
||||||
spec:
|
spec:
|
||||||
required:
|
|
||||||
- rules
|
|
||||||
properties:
|
properties:
|
||||||
# default values to be handled by user
|
|
||||||
validationFailureAction:
|
|
||||||
type: string
|
|
||||||
enum:
|
|
||||||
- enforce # blocks the resorce api-reques if a rule fails.
|
|
||||||
- audit # allows resource creation and reports the failed validation rules as violations. Default
|
|
||||||
background:
|
background:
|
||||||
type: boolean
|
type: boolean
|
||||||
rules:
|
rules:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- match
|
|
||||||
properties:
|
properties:
|
||||||
|
exclude:
|
||||||
|
properties:
|
||||||
|
clusterRoles:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
resources:
|
||||||
|
properties:
|
||||||
|
kinds:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
match:
|
namespaces:
|
||||||
type: object
|
items:
|
||||||
required:
|
type: string
|
||||||
- resources
|
type: array
|
||||||
|
selector:
|
||||||
properties:
|
properties:
|
||||||
|
matchExpressions:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
type: string
|
||||||
|
operator:
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
matchLabels:
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
roles:
|
roles:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
clusterRoles:
|
|
||||||
type: array
|
type: array
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
subjects:
|
subjects:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
properties:
|
||||||
kind:
|
|
||||||
type: string
|
|
||||||
apiGroup:
|
apiGroup:
|
||||||
type: string
|
type: string
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
namespace:
|
namespace:
|
||||||
type: string
|
type: string
|
||||||
resources:
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
type: object
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
generate:
|
||||||
|
properties:
|
||||||
|
clone:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- namespace
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
data:
|
||||||
|
AnyValue: {}
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
match:
|
||||||
|
properties:
|
||||||
|
clusterRoles:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
resources:
|
||||||
minProperties: 1
|
minProperties: 1
|
||||||
properties:
|
properties:
|
||||||
kinds:
|
kinds:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
type: array
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
namespaces:
|
namespaces:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
type: array
|
||||||
selector:
|
selector:
|
||||||
properties:
|
properties:
|
||||||
matchLabels:
|
|
||||||
type: object
|
|
||||||
additionalProperties:
|
|
||||||
type: string
|
|
||||||
matchExpressions:
|
matchExpressions:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- key
|
|
||||||
- operator
|
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
exclude:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
roles:
|
|
||||||
type: array
|
type: array
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
clusterRoles:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
subjects:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
- kind
|
- key
|
||||||
- name
|
- operator
|
||||||
properties:
|
type: object
|
||||||
kind:
|
type: array
|
||||||
|
matchLabels:
|
||||||
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
roles:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
subjects:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
apiGroup:
|
apiGroup:
|
||||||
type: string
|
type: string
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
namespace:
|
namespace:
|
||||||
type: string
|
type: string
|
||||||
resources:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
kinds:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
namespaces:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
selector:
|
|
||||||
properties:
|
|
||||||
matchLabels:
|
|
||||||
type: object
|
|
||||||
additionalProperties:
|
|
||||||
type: string
|
|
||||||
matchExpressions:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
- key
|
- kind
|
||||||
- operator
|
- name
|
||||||
properties:
|
|
||||||
key:
|
|
||||||
type: string
|
|
||||||
operator:
|
|
||||||
type: string
|
|
||||||
values:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
preconditions:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
type: object
|
||||||
|
type: array
|
||||||
required:
|
required:
|
||||||
- key # can be of any type
|
- resources
|
||||||
- operator # typed
|
type: object
|
||||||
- value # can be of any type
|
|
||||||
mutate:
|
mutate:
|
||||||
type: object
|
|
||||||
properties:
|
properties:
|
||||||
overlay:
|
overlay:
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
patches:
|
patches:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- path
|
|
||||||
- op
|
|
||||||
properties:
|
properties:
|
||||||
path:
|
|
||||||
type: string
|
|
||||||
op:
|
op:
|
||||||
type: string
|
|
||||||
enum:
|
enum:
|
||||||
- add
|
- add
|
||||||
- replace
|
- replace
|
||||||
- remove
|
- remove
|
||||||
|
type: string
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
value:
|
value:
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
validate:
|
required:
|
||||||
|
- path
|
||||||
|
- op
|
||||||
type: object
|
type: object
|
||||||
properties:
|
type: array
|
||||||
message:
|
type: object
|
||||||
|
name:
|
||||||
type: string
|
type: string
|
||||||
pattern:
|
preconditions:
|
||||||
AnyValue: {}
|
items:
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- operator
|
||||||
|
- value
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
validate:
|
||||||
|
properties:
|
||||||
anyPattern:
|
anyPattern:
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
deny:
|
deny:
|
||||||
properties:
|
properties:
|
||||||
conditions:
|
conditions:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- key # can be of any type
|
|
||||||
- operator # typed
|
|
||||||
- value # can be of any type
|
|
||||||
properties:
|
properties:
|
||||||
operator:
|
key:
|
||||||
type: string
|
type: string
|
||||||
|
operator:
|
||||||
enum:
|
enum:
|
||||||
- Equal
|
- Equal
|
||||||
- Equals
|
- Equals
|
||||||
- NotEqual
|
- NotEqual
|
||||||
- NotEquals
|
- NotEquals
|
||||||
key:
|
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
type: string
|
type: string
|
||||||
generate:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
- kind
|
- key
|
||||||
- name
|
- operator
|
||||||
properties:
|
- value
|
||||||
kind:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
namespace:
|
|
||||||
type: string
|
|
||||||
clone:
|
|
||||||
type: object
|
type: object
|
||||||
required:
|
type: array
|
||||||
- namespace
|
message:
|
||||||
- name
|
|
||||||
properties:
|
|
||||||
namespace:
|
|
||||||
type: string
|
type: string
|
||||||
name:
|
pattern:
|
||||||
type: string
|
|
||||||
data:
|
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- match
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
validationFailureAction:
|
||||||
|
enum:
|
||||||
|
- enforce
|
||||||
|
- audit
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- rules
|
||||||
|
status: {}
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: clusterpolicyviolations.kyverno.io
|
name: clusterpolicyviolations.kyverno.io
|
||||||
spec:
|
spec:
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- JSONPath: .spec.policy
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
name: Policy
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.kind
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
name: ResourceKind
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.name
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
name: ResourceName
|
||||||
|
type: string
|
||||||
|
- JSONPath: .metadata.creationTimestamp
|
||||||
|
name: Age
|
||||||
|
type: date
|
||||||
group: kyverno.io
|
group: kyverno.io
|
||||||
versions:
|
|
||||||
- name: v1
|
|
||||||
served: true
|
|
||||||
storage: true
|
|
||||||
scope: Cluster
|
|
||||||
names:
|
names:
|
||||||
kind: ClusterPolicyViolation
|
kind: ClusterPolicyViolation
|
||||||
plural: clusterpolicyviolations
|
plural: clusterpolicyviolations
|
||||||
singular: clusterpolicyviolation
|
|
||||||
shortNames:
|
shortNames:
|
||||||
- cpolv
|
- cpolv
|
||||||
|
singular: clusterpolicyviolation
|
||||||
|
scope: Cluster
|
||||||
subresources:
|
subresources:
|
||||||
status: {}
|
status: {}
|
||||||
additionalPrinterColumns:
|
|
||||||
- name: Policy
|
|
||||||
type: string
|
|
||||||
description: The policy that resulted in the violation
|
|
||||||
JSONPath: .spec.policy
|
|
||||||
- name: ResourceKind
|
|
||||||
type: string
|
|
||||||
description: The resource kind that cause the violation
|
|
||||||
JSONPath: .spec.resource.kind
|
|
||||||
- name: ResourceName
|
|
||||||
type: string
|
|
||||||
description: The resource name that caused the violation
|
|
||||||
JSONPath: .spec.resource.name
|
|
||||||
- name: Age
|
|
||||||
type: date
|
|
||||||
JSONPath: .metadata.creationTimestamp
|
|
||||||
validation:
|
validation:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
properties:
|
properties:
|
||||||
spec:
|
spec:
|
||||||
required:
|
|
||||||
- policy
|
|
||||||
- resource
|
|
||||||
- rules
|
|
||||||
properties:
|
properties:
|
||||||
policy:
|
policy:
|
||||||
type: string
|
type: string
|
||||||
resource:
|
resource:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
properties:
|
||||||
kind:
|
kind:
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
rules:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
|
- kind
|
||||||
- name
|
- name
|
||||||
- type
|
type: object
|
||||||
- message
|
rules:
|
||||||
|
items:
|
||||||
properties:
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
message:
|
required:
|
||||||
type: string
|
- name
|
||||||
---
|
- type
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
- message
|
||||||
kind: CustomResourceDefinition
|
type: object
|
||||||
metadata:
|
type: array
|
||||||
name: policyviolations.kyverno.io
|
required:
|
||||||
spec:
|
- policy
|
||||||
group: kyverno.io
|
- resource
|
||||||
|
- rules
|
||||||
versions:
|
versions:
|
||||||
- name: v1
|
- name: v1
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
scope: Namespaced
|
|
||||||
names:
|
|
||||||
kind: PolicyViolation
|
|
||||||
plural: policyviolations
|
|
||||||
singular: policyviolation
|
|
||||||
shortNames:
|
|
||||||
- polv
|
|
||||||
subresources:
|
|
||||||
status: {}
|
|
||||||
additionalPrinterColumns:
|
|
||||||
- name: Policy
|
|
||||||
type: string
|
|
||||||
description: The policy that resulted in the violation
|
|
||||||
JSONPath: .spec.policy
|
|
||||||
- name: ResourceKind
|
|
||||||
type: string
|
|
||||||
description: The resource kind that cause the violation
|
|
||||||
JSONPath: .spec.resource.kind
|
|
||||||
- name: ResourceName
|
|
||||||
type: string
|
|
||||||
description: The resource name that caused the violation
|
|
||||||
JSONPath: .spec.resource.name
|
|
||||||
- name: Age
|
|
||||||
type: date
|
|
||||||
JSONPath: .metadata.creationTimestamp
|
|
||||||
validation:
|
|
||||||
openAPIV3Schema:
|
|
||||||
properties:
|
|
||||||
spec:
|
|
||||||
required:
|
|
||||||
- policy
|
|
||||||
- resource
|
|
||||||
- rules
|
|
||||||
properties:
|
|
||||||
policy:
|
|
||||||
type: string
|
|
||||||
resource:
|
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
|
||||||
kind:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
rules:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- type
|
|
||||||
- message
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: generaterequests.kyverno.io
|
name: generaterequests.kyverno.io
|
||||||
spec:
|
spec:
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- JSONPath: .spec.policy
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
name: Policy
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.kind
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
name: ResourceKind
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.name
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
name: ResourceName
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.namespace
|
||||||
|
description: The resource namespace that caused the violation
|
||||||
|
name: ResourceNamespace
|
||||||
|
type: string
|
||||||
|
- JSONPath: .status.state
|
||||||
|
description: Current state of generate request
|
||||||
|
name: status
|
||||||
|
type: string
|
||||||
|
- JSONPath: .metadata.creationTimestamp
|
||||||
|
name: Age
|
||||||
|
type: date
|
||||||
group: kyverno.io
|
group: kyverno.io
|
||||||
versions:
|
|
||||||
- name: v1
|
|
||||||
served: true
|
|
||||||
storage: true
|
|
||||||
scope: Namespaced
|
|
||||||
names:
|
names:
|
||||||
kind: GenerateRequest
|
kind: GenerateRequest
|
||||||
plural: generaterequests
|
plural: generaterequests
|
||||||
singular: generaterequest
|
|
||||||
shortNames:
|
shortNames:
|
||||||
- gr
|
- gr
|
||||||
|
singular: generaterequest
|
||||||
|
scope: Namespaced
|
||||||
subresources:
|
subresources:
|
||||||
status: {}
|
status: {}
|
||||||
additionalPrinterColumns:
|
|
||||||
- name: Policy
|
|
||||||
type: string
|
|
||||||
description: The policy that resulted in the violation
|
|
||||||
JSONPath: .spec.policy
|
|
||||||
- name: ResourceKind
|
|
||||||
type: string
|
|
||||||
description: The resource kind that cause the violation
|
|
||||||
JSONPath: .spec.resource.kind
|
|
||||||
- name: ResourceName
|
|
||||||
type: string
|
|
||||||
description: The resource name that caused the violation
|
|
||||||
JSONPath: .spec.resource.name
|
|
||||||
- name: ResourceNamespace
|
|
||||||
type: string
|
|
||||||
description: The resource namespace that caused the violation
|
|
||||||
JSONPath: .spec.resource.namespace
|
|
||||||
- name: status
|
|
||||||
type : string
|
|
||||||
description: Current state of generate request
|
|
||||||
JSONPath: .status.state
|
|
||||||
- name: Age
|
|
||||||
type: date
|
|
||||||
JSONPath: .metadata.creationTimestamp
|
|
||||||
validation:
|
validation:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
properties:
|
properties:
|
||||||
spec:
|
spec:
|
||||||
required:
|
|
||||||
- policy
|
|
||||||
- resource
|
|
||||||
properties:
|
properties:
|
||||||
policy:
|
policy:
|
||||||
type: string
|
type: string
|
||||||
resource:
|
resource:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
properties:
|
||||||
kind:
|
kind:
|
||||||
type: string
|
type: string
|
||||||
|
@ -466,3 +382,86 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
namespace:
|
namespace:
|
||||||
type: string
|
type: string
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- policy
|
||||||
|
- resource
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: policyviolations.kyverno.io
|
||||||
|
spec:
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- JSONPath: .spec.policy
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
name: Policy
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.kind
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
name: ResourceKind
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.name
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
name: ResourceName
|
||||||
|
type: string
|
||||||
|
- JSONPath: .metadata.creationTimestamp
|
||||||
|
name: Age
|
||||||
|
type: date
|
||||||
|
group: kyverno.io
|
||||||
|
names:
|
||||||
|
kind: PolicyViolation
|
||||||
|
plural: policyviolations
|
||||||
|
shortNames:
|
||||||
|
- polv
|
||||||
|
singular: policyviolation
|
||||||
|
scope: Namespaced
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
validation:
|
||||||
|
openAPIV3Schema:
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
properties:
|
||||||
|
policy:
|
||||||
|
type: string
|
||||||
|
resource:
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
rules:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- type
|
||||||
|
- message
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- policy
|
||||||
|
- resource
|
||||||
|
- rules
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
|
468
definitions/crds/crds.yaml
Normal file
468
definitions/crds/crds.yaml
Normal file
|
@ -0,0 +1,468 @@
|
||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: clusterpolicies.kyverno.io
|
||||||
|
spec:
|
||||||
|
group: kyverno.io
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
scope: Cluster
|
||||||
|
names:
|
||||||
|
kind: ClusterPolicy
|
||||||
|
plural: clusterpolicies
|
||||||
|
singular: clusterpolicy
|
||||||
|
shortNames:
|
||||||
|
- cpol
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
validation:
|
||||||
|
openAPIV3Schema:
|
||||||
|
properties:
|
||||||
|
status: {}
|
||||||
|
spec:
|
||||||
|
required:
|
||||||
|
- rules
|
||||||
|
properties:
|
||||||
|
# default values to be handled by user
|
||||||
|
validationFailureAction:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- enforce # blocks the resorce api-reques if a rule fails.
|
||||||
|
- audit # allows resource creation and reports the failed validation rules as violations. Default
|
||||||
|
background:
|
||||||
|
type: boolean
|
||||||
|
rules:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- match
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
match:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- resources
|
||||||
|
properties:
|
||||||
|
roles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
clusterRoles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
subjects:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
apiGroup:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
resources:
|
||||||
|
type: object
|
||||||
|
minProperties: 1
|
||||||
|
properties:
|
||||||
|
kinds:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespaces:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
selector:
|
||||||
|
properties:
|
||||||
|
matchLabels:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
matchExpressions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- operator
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
type: string
|
||||||
|
operator:
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
exclude:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
roles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
clusterRoles:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
subjects:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
apiGroup:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
resources:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
kinds:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespaces:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
selector:
|
||||||
|
properties:
|
||||||
|
matchLabels:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
matchExpressions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- operator
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
type: string
|
||||||
|
operator:
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
preconditions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- key # can be of any type
|
||||||
|
- operator # typed
|
||||||
|
- value # can be of any type
|
||||||
|
mutate:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
overlay:
|
||||||
|
AnyValue: {}
|
||||||
|
patches:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- path
|
||||||
|
- op
|
||||||
|
properties:
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
|
op:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- add
|
||||||
|
- replace
|
||||||
|
- remove
|
||||||
|
value:
|
||||||
|
AnyValue: {}
|
||||||
|
validate:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
pattern:
|
||||||
|
AnyValue: {}
|
||||||
|
anyPattern:
|
||||||
|
AnyValue: {}
|
||||||
|
deny:
|
||||||
|
properties:
|
||||||
|
conditions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- key # can be of any type
|
||||||
|
- operator # typed
|
||||||
|
- value # can be of any type
|
||||||
|
properties:
|
||||||
|
operator:
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- Equal
|
||||||
|
- Equals
|
||||||
|
- NotEqual
|
||||||
|
- NotEquals
|
||||||
|
key:
|
||||||
|
type: string
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
generate:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
clone:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- namespace
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
data:
|
||||||
|
AnyValue: {}
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: clusterpolicyviolations.kyverno.io
|
||||||
|
spec:
|
||||||
|
group: kyverno.io
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
scope: Cluster
|
||||||
|
names:
|
||||||
|
kind: ClusterPolicyViolation
|
||||||
|
plural: clusterpolicyviolations
|
||||||
|
singular: clusterpolicyviolation
|
||||||
|
shortNames:
|
||||||
|
- cpolv
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- name: Policy
|
||||||
|
type: string
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
JSONPath: .spec.policy
|
||||||
|
- name: ResourceKind
|
||||||
|
type: string
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
JSONPath: .spec.resource.kind
|
||||||
|
- name: ResourceName
|
||||||
|
type: string
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
JSONPath: .spec.resource.name
|
||||||
|
- name: Age
|
||||||
|
type: date
|
||||||
|
JSONPath: .metadata.creationTimestamp
|
||||||
|
validation:
|
||||||
|
openAPIV3Schema:
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
required:
|
||||||
|
- policy
|
||||||
|
- resource
|
||||||
|
- rules
|
||||||
|
properties:
|
||||||
|
policy:
|
||||||
|
type: string
|
||||||
|
resource:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
rules:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- type
|
||||||
|
- message
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: policyviolations.kyverno.io
|
||||||
|
spec:
|
||||||
|
group: kyverno.io
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
scope: Namespaced
|
||||||
|
names:
|
||||||
|
kind: PolicyViolation
|
||||||
|
plural: policyviolations
|
||||||
|
singular: policyviolation
|
||||||
|
shortNames:
|
||||||
|
- polv
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- name: Policy
|
||||||
|
type: string
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
JSONPath: .spec.policy
|
||||||
|
- name: ResourceKind
|
||||||
|
type: string
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
JSONPath: .spec.resource.kind
|
||||||
|
- name: ResourceName
|
||||||
|
type: string
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
JSONPath: .spec.resource.name
|
||||||
|
- name: Age
|
||||||
|
type: date
|
||||||
|
JSONPath: .metadata.creationTimestamp
|
||||||
|
validation:
|
||||||
|
openAPIV3Schema:
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
required:
|
||||||
|
- policy
|
||||||
|
- resource
|
||||||
|
- rules
|
||||||
|
properties:
|
||||||
|
policy:
|
||||||
|
type: string
|
||||||
|
resource:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
rules:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- type
|
||||||
|
- message
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: generaterequests.kyverno.io
|
||||||
|
spec:
|
||||||
|
group: kyverno.io
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
scope: Namespaced
|
||||||
|
names:
|
||||||
|
kind: GenerateRequest
|
||||||
|
plural: generaterequests
|
||||||
|
singular: generaterequest
|
||||||
|
shortNames:
|
||||||
|
- gr
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- name: Policy
|
||||||
|
type: string
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
JSONPath: .spec.policy
|
||||||
|
- name: ResourceKind
|
||||||
|
type: string
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
JSONPath: .spec.resource.kind
|
||||||
|
- name: ResourceName
|
||||||
|
type: string
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
JSONPath: .spec.resource.name
|
||||||
|
- name: ResourceNamespace
|
||||||
|
type: string
|
||||||
|
description: The resource namespace that caused the violation
|
||||||
|
JSONPath: .spec.resource.namespace
|
||||||
|
- name: status
|
||||||
|
type : string
|
||||||
|
description: Current state of generate request
|
||||||
|
JSONPath: .status.state
|
||||||
|
- name: Age
|
||||||
|
type: date
|
||||||
|
JSONPath: .metadata.creationTimestamp
|
||||||
|
validation:
|
||||||
|
openAPIV3Schema:
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
required:
|
||||||
|
- policy
|
||||||
|
- resource
|
||||||
|
properties:
|
||||||
|
policy:
|
||||||
|
type: string
|
||||||
|
resource:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
5
definitions/crds/kustomization.yaml
Normal file
5
definitions/crds/kustomization.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ./crds.yaml
|
6
definitions/debug/kustomization.yaml
Normal file
6
definitions/debug/kustomization.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ../crds/
|
||||||
|
- ../rbac/
|
File diff suppressed because it is too large
Load diff
|
@ -1,464 +1,385 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: kyverno
|
||||||
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: clusterpolicies.kyverno.io
|
name: clusterpolicies.kyverno.io
|
||||||
spec:
|
spec:
|
||||||
group: kyverno.io
|
group: kyverno.io
|
||||||
versions:
|
|
||||||
- name: v1
|
|
||||||
served: true
|
|
||||||
storage: true
|
|
||||||
scope: Cluster
|
|
||||||
names:
|
names:
|
||||||
kind: ClusterPolicy
|
kind: ClusterPolicy
|
||||||
plural: clusterpolicies
|
plural: clusterpolicies
|
||||||
singular: clusterpolicy
|
|
||||||
shortNames:
|
shortNames:
|
||||||
- cpol
|
- cpol
|
||||||
|
singular: clusterpolicy
|
||||||
|
scope: Cluster
|
||||||
subresources:
|
subresources:
|
||||||
status: {}
|
status: {}
|
||||||
validation:
|
validation:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
properties:
|
properties:
|
||||||
status: {}
|
|
||||||
spec:
|
spec:
|
||||||
required:
|
|
||||||
- rules
|
|
||||||
properties:
|
properties:
|
||||||
# default values to be handled by user
|
|
||||||
validationFailureAction:
|
|
||||||
type: string
|
|
||||||
enum:
|
|
||||||
- enforce # blocks the resorce api-reques if a rule fails.
|
|
||||||
- audit # allows resource creation and reports the failed validation rules as violations. Default
|
|
||||||
background:
|
background:
|
||||||
type: boolean
|
type: boolean
|
||||||
rules:
|
rules:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- match
|
|
||||||
properties:
|
properties:
|
||||||
|
exclude:
|
||||||
|
properties:
|
||||||
|
clusterRoles:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
resources:
|
||||||
|
properties:
|
||||||
|
kinds:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
match:
|
namespaces:
|
||||||
type: object
|
items:
|
||||||
required:
|
type: string
|
||||||
- resources
|
type: array
|
||||||
|
selector:
|
||||||
properties:
|
properties:
|
||||||
|
matchExpressions:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
type: string
|
||||||
|
operator:
|
||||||
|
type: string
|
||||||
|
values:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- operator
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
matchLabels:
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
roles:
|
roles:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
clusterRoles:
|
|
||||||
type: array
|
type: array
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
subjects:
|
subjects:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
properties:
|
||||||
kind:
|
|
||||||
type: string
|
|
||||||
apiGroup:
|
apiGroup:
|
||||||
type: string
|
type: string
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
namespace:
|
namespace:
|
||||||
type: string
|
type: string
|
||||||
resources:
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
type: object
|
type: object
|
||||||
|
type: array
|
||||||
|
type: object
|
||||||
|
generate:
|
||||||
|
properties:
|
||||||
|
clone:
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- namespace
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
data:
|
||||||
|
AnyValue: {}
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
match:
|
||||||
|
properties:
|
||||||
|
clusterRoles:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
resources:
|
||||||
minProperties: 1
|
minProperties: 1
|
||||||
properties:
|
properties:
|
||||||
kinds:
|
kinds:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
type: array
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
namespaces:
|
namespaces:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
|
type: array
|
||||||
selector:
|
selector:
|
||||||
properties:
|
properties:
|
||||||
matchLabels:
|
|
||||||
type: object
|
|
||||||
additionalProperties:
|
|
||||||
type: string
|
|
||||||
matchExpressions:
|
matchExpressions:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- key
|
|
||||||
- operator
|
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
exclude:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
roles:
|
|
||||||
type: array
|
type: array
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
clusterRoles:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
subjects:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
- kind
|
- key
|
||||||
- name
|
- operator
|
||||||
properties:
|
type: object
|
||||||
kind:
|
type: array
|
||||||
|
matchLabels:
|
||||||
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
roles:
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
type: array
|
||||||
|
subjects:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
apiGroup:
|
apiGroup:
|
||||||
type: string
|
type: string
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
namespace:
|
namespace:
|
||||||
type: string
|
type: string
|
||||||
resources:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
kinds:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
namespaces:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
selector:
|
|
||||||
properties:
|
|
||||||
matchLabels:
|
|
||||||
type: object
|
|
||||||
additionalProperties:
|
|
||||||
type: string
|
|
||||||
matchExpressions:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
- key
|
- kind
|
||||||
- operator
|
- name
|
||||||
properties:
|
|
||||||
key:
|
|
||||||
type: string
|
|
||||||
operator:
|
|
||||||
type: string
|
|
||||||
values:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
preconditions:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
type: object
|
||||||
|
type: array
|
||||||
required:
|
required:
|
||||||
- key # can be of any type
|
- resources
|
||||||
- operator # typed
|
type: object
|
||||||
- value # can be of any type
|
|
||||||
mutate:
|
mutate:
|
||||||
type: object
|
|
||||||
properties:
|
properties:
|
||||||
overlay:
|
overlay:
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
patches:
|
patches:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- path
|
|
||||||
- op
|
|
||||||
properties:
|
properties:
|
||||||
path:
|
|
||||||
type: string
|
|
||||||
op:
|
op:
|
||||||
type: string
|
|
||||||
enum:
|
enum:
|
||||||
- add
|
- add
|
||||||
- replace
|
- replace
|
||||||
- remove
|
- remove
|
||||||
|
type: string
|
||||||
|
path:
|
||||||
|
type: string
|
||||||
value:
|
value:
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
validate:
|
required:
|
||||||
|
- path
|
||||||
|
- op
|
||||||
type: object
|
type: object
|
||||||
properties:
|
type: array
|
||||||
message:
|
type: object
|
||||||
|
name:
|
||||||
type: string
|
type: string
|
||||||
pattern:
|
preconditions:
|
||||||
AnyValue: {}
|
items:
|
||||||
|
required:
|
||||||
|
- key
|
||||||
|
- operator
|
||||||
|
- value
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
validate:
|
||||||
|
properties:
|
||||||
anyPattern:
|
anyPattern:
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
deny:
|
deny:
|
||||||
properties:
|
properties:
|
||||||
conditions:
|
conditions:
|
||||||
type: array
|
|
||||||
items:
|
items:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- key # can be of any type
|
|
||||||
- operator # typed
|
|
||||||
- value # can be of any type
|
|
||||||
properties:
|
properties:
|
||||||
operator:
|
key:
|
||||||
type: string
|
type: string
|
||||||
|
operator:
|
||||||
enum:
|
enum:
|
||||||
- Equal
|
- Equal
|
||||||
- Equals
|
- Equals
|
||||||
- NotEqual
|
- NotEqual
|
||||||
- NotEquals
|
- NotEquals
|
||||||
key:
|
|
||||||
type: string
|
type: string
|
||||||
value:
|
value:
|
||||||
type: string
|
type: string
|
||||||
generate:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
- kind
|
- key
|
||||||
- name
|
- operator
|
||||||
properties:
|
- value
|
||||||
kind:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
namespace:
|
|
||||||
type: string
|
|
||||||
clone:
|
|
||||||
type: object
|
type: object
|
||||||
required:
|
type: array
|
||||||
- namespace
|
message:
|
||||||
- name
|
|
||||||
properties:
|
|
||||||
namespace:
|
|
||||||
type: string
|
type: string
|
||||||
name:
|
pattern:
|
||||||
type: string
|
|
||||||
data:
|
|
||||||
AnyValue: {}
|
AnyValue: {}
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- match
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
validationFailureAction:
|
||||||
|
enum:
|
||||||
|
- enforce
|
||||||
|
- audit
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- rules
|
||||||
|
status: {}
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: clusterpolicyviolations.kyverno.io
|
name: clusterpolicyviolations.kyverno.io
|
||||||
spec:
|
spec:
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- JSONPath: .spec.policy
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
name: Policy
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.kind
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
name: ResourceKind
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.name
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
name: ResourceName
|
||||||
|
type: string
|
||||||
|
- JSONPath: .metadata.creationTimestamp
|
||||||
|
name: Age
|
||||||
|
type: date
|
||||||
group: kyverno.io
|
group: kyverno.io
|
||||||
versions:
|
|
||||||
- name: v1
|
|
||||||
served: true
|
|
||||||
storage: true
|
|
||||||
scope: Cluster
|
|
||||||
names:
|
names:
|
||||||
kind: ClusterPolicyViolation
|
kind: ClusterPolicyViolation
|
||||||
plural: clusterpolicyviolations
|
plural: clusterpolicyviolations
|
||||||
singular: clusterpolicyviolation
|
|
||||||
shortNames:
|
shortNames:
|
||||||
- cpolv
|
- cpolv
|
||||||
|
singular: clusterpolicyviolation
|
||||||
|
scope: Cluster
|
||||||
subresources:
|
subresources:
|
||||||
status: {}
|
status: {}
|
||||||
additionalPrinterColumns:
|
|
||||||
- name: Policy
|
|
||||||
type: string
|
|
||||||
description: The policy that resulted in the violation
|
|
||||||
JSONPath: .spec.policy
|
|
||||||
- name: ResourceKind
|
|
||||||
type: string
|
|
||||||
description: The resource kind that cause the violation
|
|
||||||
JSONPath: .spec.resource.kind
|
|
||||||
- name: ResourceName
|
|
||||||
type: string
|
|
||||||
description: The resource name that caused the violation
|
|
||||||
JSONPath: .spec.resource.name
|
|
||||||
- name: Age
|
|
||||||
type: date
|
|
||||||
JSONPath: .metadata.creationTimestamp
|
|
||||||
validation:
|
validation:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
properties:
|
properties:
|
||||||
spec:
|
spec:
|
||||||
required:
|
|
||||||
- policy
|
|
||||||
- resource
|
|
||||||
- rules
|
|
||||||
properties:
|
properties:
|
||||||
policy:
|
policy:
|
||||||
type: string
|
type: string
|
||||||
resource:
|
resource:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
properties:
|
||||||
kind:
|
kind:
|
||||||
type: string
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
rules:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
required:
|
||||||
|
- kind
|
||||||
- name
|
- name
|
||||||
- type
|
type: object
|
||||||
- message
|
rules:
|
||||||
|
items:
|
||||||
properties:
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
message:
|
required:
|
||||||
type: string
|
- name
|
||||||
---
|
- type
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
- message
|
||||||
kind: CustomResourceDefinition
|
type: object
|
||||||
metadata:
|
type: array
|
||||||
name: policyviolations.kyverno.io
|
required:
|
||||||
spec:
|
- policy
|
||||||
group: kyverno.io
|
- resource
|
||||||
|
- rules
|
||||||
versions:
|
versions:
|
||||||
- name: v1
|
- name: v1
|
||||||
served: true
|
served: true
|
||||||
storage: true
|
storage: true
|
||||||
scope: Namespaced
|
|
||||||
names:
|
|
||||||
kind: PolicyViolation
|
|
||||||
plural: policyviolations
|
|
||||||
singular: policyviolation
|
|
||||||
shortNames:
|
|
||||||
- polv
|
|
||||||
subresources:
|
|
||||||
status: {}
|
|
||||||
additionalPrinterColumns:
|
|
||||||
- name: Policy
|
|
||||||
type: string
|
|
||||||
description: The policy that resulted in the violation
|
|
||||||
JSONPath: .spec.policy
|
|
||||||
- name: ResourceKind
|
|
||||||
type: string
|
|
||||||
description: The resource kind that cause the violation
|
|
||||||
JSONPath: .spec.resource.kind
|
|
||||||
- name: ResourceName
|
|
||||||
type: string
|
|
||||||
description: The resource name that caused the violation
|
|
||||||
JSONPath: .spec.resource.name
|
|
||||||
- name: Age
|
|
||||||
type: date
|
|
||||||
JSONPath: .metadata.creationTimestamp
|
|
||||||
validation:
|
|
||||||
openAPIV3Schema:
|
|
||||||
properties:
|
|
||||||
spec:
|
|
||||||
required:
|
|
||||||
- policy
|
|
||||||
- resource
|
|
||||||
- rules
|
|
||||||
properties:
|
|
||||||
policy:
|
|
||||||
type: string
|
|
||||||
resource:
|
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
|
||||||
kind:
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
rules:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- name
|
|
||||||
- type
|
|
||||||
- message
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
type: string
|
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: generaterequests.kyverno.io
|
name: generaterequests.kyverno.io
|
||||||
spec:
|
spec:
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- JSONPath: .spec.policy
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
name: Policy
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.kind
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
name: ResourceKind
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.name
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
name: ResourceName
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.namespace
|
||||||
|
description: The resource namespace that caused the violation
|
||||||
|
name: ResourceNamespace
|
||||||
|
type: string
|
||||||
|
- JSONPath: .status.state
|
||||||
|
description: Current state of generate request
|
||||||
|
name: status
|
||||||
|
type: string
|
||||||
|
- JSONPath: .metadata.creationTimestamp
|
||||||
|
name: Age
|
||||||
|
type: date
|
||||||
group: kyverno.io
|
group: kyverno.io
|
||||||
versions:
|
|
||||||
- name: v1
|
|
||||||
served: true
|
|
||||||
storage: true
|
|
||||||
scope: Namespaced
|
|
||||||
names:
|
names:
|
||||||
kind: GenerateRequest
|
kind: GenerateRequest
|
||||||
plural: generaterequests
|
plural: generaterequests
|
||||||
singular: generaterequest
|
|
||||||
shortNames:
|
shortNames:
|
||||||
- gr
|
- gr
|
||||||
|
singular: generaterequest
|
||||||
|
scope: Namespaced
|
||||||
subresources:
|
subresources:
|
||||||
status: {}
|
status: {}
|
||||||
additionalPrinterColumns:
|
|
||||||
- name: Policy
|
|
||||||
type: string
|
|
||||||
description: The policy that resulted in the violation
|
|
||||||
JSONPath: .spec.policy
|
|
||||||
- name: ResourceKind
|
|
||||||
type: string
|
|
||||||
description: The resource kind that cause the violation
|
|
||||||
JSONPath: .spec.resource.kind
|
|
||||||
- name: ResourceName
|
|
||||||
type: string
|
|
||||||
description: The resource name that caused the violation
|
|
||||||
JSONPath: .spec.resource.name
|
|
||||||
- name: ResourceNamespace
|
|
||||||
type: string
|
|
||||||
description: The resource namespace that caused the violation
|
|
||||||
JSONPath: .spec.resource.namespace
|
|
||||||
- name: status
|
|
||||||
type: string
|
|
||||||
description: Current state of generate request
|
|
||||||
JSONPath: .status.state
|
|
||||||
- name: Age
|
|
||||||
type: date
|
|
||||||
JSONPath: .metadata.creationTimestamp
|
|
||||||
validation:
|
validation:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
properties:
|
properties:
|
||||||
spec:
|
spec:
|
||||||
required:
|
|
||||||
- policy
|
|
||||||
- resource
|
|
||||||
properties:
|
properties:
|
||||||
policy:
|
policy:
|
||||||
type: string
|
type: string
|
||||||
resource:
|
resource:
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- kind
|
|
||||||
- name
|
|
||||||
properties:
|
properties:
|
||||||
kind:
|
kind:
|
||||||
type: string
|
type: string
|
||||||
|
@ -466,12 +387,319 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
namespace:
|
namespace:
|
||||||
type: string
|
type: string
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- policy
|
||||||
|
- resource
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: policyviolations.kyverno.io
|
||||||
|
spec:
|
||||||
|
additionalPrinterColumns:
|
||||||
|
- JSONPath: .spec.policy
|
||||||
|
description: The policy that resulted in the violation
|
||||||
|
name: Policy
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.kind
|
||||||
|
description: The resource kind that cause the violation
|
||||||
|
name: ResourceKind
|
||||||
|
type: string
|
||||||
|
- JSONPath: .spec.resource.name
|
||||||
|
description: The resource name that caused the violation
|
||||||
|
name: ResourceName
|
||||||
|
type: string
|
||||||
|
- JSONPath: .metadata.creationTimestamp
|
||||||
|
name: Age
|
||||||
|
type: date
|
||||||
|
group: kyverno.io
|
||||||
|
names:
|
||||||
|
kind: PolicyViolation
|
||||||
|
plural: policyviolations
|
||||||
|
shortNames:
|
||||||
|
- polv
|
||||||
|
singular: policyviolation
|
||||||
|
scope: Namespaced
|
||||||
|
subresources:
|
||||||
|
status: {}
|
||||||
|
validation:
|
||||||
|
openAPIV3Schema:
|
||||||
|
properties:
|
||||||
|
spec:
|
||||||
|
properties:
|
||||||
|
policy:
|
||||||
|
type: string
|
||||||
|
resource:
|
||||||
|
properties:
|
||||||
|
kind:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- kind
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
rules:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- type
|
||||||
|
- message
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- policy
|
||||||
|
- resource
|
||||||
|
- rules
|
||||||
|
versions:
|
||||||
|
- name: v1
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:customresources
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- clusterpolicies
|
||||||
|
- clusterpolicies/status
|
||||||
|
- clusterpolicyviolations
|
||||||
|
- clusterpolicyviolations/status
|
||||||
|
- policyviolations
|
||||||
|
- policyviolations/status
|
||||||
|
- generaterequests
|
||||||
|
- generaterequests/status
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:generatecontroller
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- namespaces
|
||||||
|
- networkpolicies
|
||||||
|
- secrets
|
||||||
|
- configmaps
|
||||||
|
- resourcequotas
|
||||||
|
- limitranges
|
||||||
|
- clusterroles
|
||||||
|
- rolebindings
|
||||||
|
- clusterrolebindings
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- update
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- namespaces
|
||||||
|
verbs:
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:policycontroller
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- '*'
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- update
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:userinfo
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- rolebindings
|
||||||
|
- clusterrolebindings
|
||||||
|
- configmaps
|
||||||
|
verbs:
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:webhook
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
- mutatingwebhookconfigurations
|
||||||
|
- validatingwebhookconfigurations
|
||||||
|
- certificatesigningrequests
|
||||||
|
- certificatesigningrequests/approval
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- certificates.k8s.io
|
||||||
|
resourceNames:
|
||||||
|
- kubernetes.io/legacy-unknown
|
||||||
|
resources:
|
||||||
|
- certificatesigningrequests
|
||||||
|
- certificatesigningrequests/approval
|
||||||
|
- certificatesigningrequests/status
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- certificates.k8s.io
|
||||||
|
resourceNames:
|
||||||
|
- kubernetes.io/legacy-unknown
|
||||||
|
resources:
|
||||||
|
- signers
|
||||||
|
verbs:
|
||||||
|
- approve
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:policyviolations
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- kyverno.io
|
||||||
|
resources:
|
||||||
|
- policyviolations
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kyverno:customresources
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:customresources
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kyverno:generatecontroller
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:generatecontroller
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kyverno:policycontroller
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:policycontroller
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kyverno:userinfo
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:userinfo
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: kyverno:webhook
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:webhook
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
data:
|
||||||
|
resourceFilters: '[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][*,kyverno,*][Binding,*,*][ReplicaSet,*,*]'
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: init-config
|
name: init-config
|
||||||
namespace: kyverno
|
namespace: kyverno
|
||||||
data:
|
---
|
||||||
# resource types to be skipped by kyverno policy engine
|
apiVersion: v1
|
||||||
resourceFilters: "[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][*,kyverno,*]"
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: kyverno
|
||||||
|
name: kyverno-svc
|
||||||
|
namespace: kyverno
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 443
|
||||||
|
targetPort: 443
|
||||||
|
selector:
|
||||||
|
app: kyverno
|
||||||
|
|
7
definitions/kustomization.yaml
Normal file
7
definitions/kustomization.yaml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ./crds/
|
||||||
|
- ./manifest/
|
||||||
|
- ./rbac/
|
64
definitions/manifest/deployment.yaml
Normal file
64
definitions/manifest/deployment.yaml
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
namespace: kyverno
|
||||||
|
name: kyverno
|
||||||
|
labels:
|
||||||
|
app: kyverno
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: kyverno
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: kyverno
|
||||||
|
spec:
|
||||||
|
serviceAccountName: kyverno-service-account
|
||||||
|
initContainers:
|
||||||
|
- name: kyverno-pre
|
||||||
|
image: nirmata/kyvernopre:v1.1.6
|
||||||
|
containers:
|
||||||
|
- name: kyverno
|
||||||
|
image: nirmata/kyverno:v1.1.6
|
||||||
|
imagePullPolicy: Always
|
||||||
|
args:
|
||||||
|
- "--filterK8Resources=[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][*,kyverno,*][Binding,*,*][ReplicaSet,*,*]"
|
||||||
|
# customize webhook timeout
|
||||||
|
#- "--webhooktimeout=4"
|
||||||
|
# enable profiling
|
||||||
|
# - "--profile"
|
||||||
|
- "-v=2"
|
||||||
|
ports:
|
||||||
|
- containerPort: 443
|
||||||
|
env:
|
||||||
|
- name: INIT_CONFIG
|
||||||
|
value: init-config
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "50Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
limits:
|
||||||
|
memory: "128Mi"
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/liveness
|
||||||
|
port: 443
|
||||||
|
scheme: HTTPS
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 4
|
||||||
|
successThreshold: 1
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health/readiness
|
||||||
|
port: 443
|
||||||
|
scheme: HTTPS
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 4
|
||||||
|
successThreshold: 1
|
5
definitions/manifest/kustomization.yaml
Normal file
5
definitions/manifest/kustomization.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ./deployment.yaml
|
5
definitions/rbac/kustomization.yaml
Normal file
5
definitions/rbac/kustomization.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ./rbac.yaml
|
242
definitions/rbac/rbac.yaml
Normal file
242
definitions/rbac/rbac.yaml
Normal file
|
@ -0,0 +1,242 @@
|
||||||
|
---
|
||||||
|
kind: Namespace
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: "kyverno"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
namespace: kyverno
|
||||||
|
name: kyverno-svc
|
||||||
|
labels:
|
||||||
|
app: kyverno
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 443
|
||||||
|
targetPort: 443
|
||||||
|
selector:
|
||||||
|
app: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:policyviolations
|
||||||
|
rules:
|
||||||
|
- apiGroups: ["kyverno.io"]
|
||||||
|
resources:
|
||||||
|
- policyviolations
|
||||||
|
verbs: ["get", "list", "watch"]
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: kyverno:webhook
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:webhook
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: kyverno:userinfo
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:userinfo
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: kyverno:customresources
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:customresources
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: kyverno:policycontroller
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:policycontroller
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
metadata:
|
||||||
|
name: kyverno:generatecontroller
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: kyverno:generatecontroller
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: kyverno-service-account
|
||||||
|
namespace: kyverno
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:webhook
|
||||||
|
rules:
|
||||||
|
# Dynamic creation of webhooks, events & certs
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- events
|
||||||
|
- mutatingwebhookconfigurations
|
||||||
|
- validatingwebhookconfigurations
|
||||||
|
- certificatesigningrequests
|
||||||
|
- certificatesigningrequests/approval
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- certificates.k8s.io
|
||||||
|
resources:
|
||||||
|
- certificatesigningrequests
|
||||||
|
- certificatesigningrequests/approval
|
||||||
|
- certificatesigningrequests/status
|
||||||
|
resourceNames:
|
||||||
|
- kubernetes.io/legacy-unknown
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- certificates.k8s.io
|
||||||
|
resources:
|
||||||
|
- signers
|
||||||
|
resourceNames:
|
||||||
|
- kubernetes.io/legacy-unknown
|
||||||
|
verbs:
|
||||||
|
- approve
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:userinfo
|
||||||
|
rules:
|
||||||
|
# get the roleRef for incoming api-request user
|
||||||
|
- apiGroups:
|
||||||
|
- "*"
|
||||||
|
resources:
|
||||||
|
- rolebindings
|
||||||
|
- clusterrolebindings
|
||||||
|
- configmaps
|
||||||
|
verbs:
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:customresources
|
||||||
|
rules:
|
||||||
|
# Kyverno CRs
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- clusterpolicies
|
||||||
|
- clusterpolicies/status
|
||||||
|
- clusterpolicyviolations
|
||||||
|
- clusterpolicyviolations/status
|
||||||
|
- policyviolations
|
||||||
|
- policyviolations/status
|
||||||
|
- generaterequests
|
||||||
|
- generaterequests/status
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- patch
|
||||||
|
- update
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:policycontroller
|
||||||
|
rules:
|
||||||
|
# background processing, identify all existing resources
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- '*'
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- update
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: kyverno:generatecontroller
|
||||||
|
rules:
|
||||||
|
# process generate rules to generate resources
|
||||||
|
- apiGroups:
|
||||||
|
- "*"
|
||||||
|
resources:
|
||||||
|
- namespaces
|
||||||
|
- networkpolicies
|
||||||
|
- secrets
|
||||||
|
- configmaps
|
||||||
|
- resourcequotas
|
||||||
|
- limitranges
|
||||||
|
- clusterroles
|
||||||
|
- rolebindings
|
||||||
|
- clusterrolebindings
|
||||||
|
verbs:
|
||||||
|
- create
|
||||||
|
- update
|
||||||
|
- delete
|
||||||
|
- get
|
||||||
|
# dynamic watches on trigger resources for generate rules
|
||||||
|
# re-evaluate the policy if the resource is updated
|
||||||
|
- apiGroups:
|
||||||
|
- '*'
|
||||||
|
resources:
|
||||||
|
- namespaces
|
||||||
|
verbs:
|
||||||
|
- watch
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: init-config
|
||||||
|
namespace: kyverno
|
||||||
|
data:
|
||||||
|
# resource types to be skipped by kyverno policy engine
|
||||||
|
resourceFilters: "[Event,*,*][*,kube-system,*][*,kube-public,*][*,kube-node-lease,*][Node,*,*][APIService,*,*][TokenReview,*,*][SubjectAccessReview,*,*][*,kyverno,*][Binding,*,*][ReplicaSet,*,*]"
|
Loading…
Add table
Reference in a new issue