2019-02-06 12:52:09 +00:00
|
|
|
apiVersion: apiextensions.k8s.io/v1beta1
|
|
|
|
kind: CustomResourceDefinition
|
|
|
|
metadata:
|
2019-05-22 01:36:24 +00:00
|
|
|
name: policies.kyverno.io
|
2019-02-06 12:52:09 +00:00
|
|
|
spec:
|
2019-05-22 01:36:24 +00:00
|
|
|
group: kyverno.io
|
2019-02-12 17:01:25 +00:00
|
|
|
versions:
|
|
|
|
- name: v1alpha1
|
|
|
|
served: true
|
|
|
|
storage: true
|
2019-02-14 14:36:55 +00:00
|
|
|
scope: Cluster
|
2019-02-06 12:52:09 +00:00
|
|
|
names:
|
|
|
|
kind: Policy
|
|
|
|
plural: policies
|
|
|
|
singular: policy
|
2019-03-07 15:57:43 +00:00
|
|
|
subresources:
|
|
|
|
status: {}
|
2019-03-12 12:42:24 +00:00
|
|
|
validation:
|
2019-03-14 12:00:57 +00:00
|
|
|
openAPIV3Schema:
|
|
|
|
properties:
|
|
|
|
spec:
|
|
|
|
required:
|
|
|
|
- rules
|
2019-07-15 22:30:28 +00:00
|
|
|
# set as required, as we cannot set default yet. check below for more details
|
|
|
|
- mode
|
2019-03-14 12:00:57 +00:00
|
|
|
properties:
|
2019-07-15 22:30:28 +00:00
|
|
|
mode:
|
|
|
|
type: string
|
|
|
|
# default can only be set if CustomResourceDefaulting feature gate is enabled
|
|
|
|
# default: blockChanges
|
|
|
|
enum:
|
|
|
|
- blockChanges
|
|
|
|
- reportViolation
|
2019-03-14 12:00:57 +00:00
|
|
|
rules:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: object
|
|
|
|
required:
|
2019-05-13 13:08:02 +00:00
|
|
|
- name
|
2019-03-14 12:00:57 +00:00
|
|
|
- resource
|
2019-05-21 21:37:54 +00:00
|
|
|
properties:
|
2019-05-13 13:08:02 +00:00
|
|
|
name:
|
|
|
|
type: string
|
2019-03-14 12:00:57 +00:00
|
|
|
resource:
|
|
|
|
type: object
|
|
|
|
required:
|
2019-05-21 22:43:43 +00:00
|
|
|
- kinds
|
2019-05-21 21:37:54 +00:00
|
|
|
properties:
|
2019-05-21 22:43:43 +00:00
|
|
|
kinds:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
2019-03-14 12:00:57 +00:00
|
|
|
name:
|
|
|
|
type: string
|
2019-07-01 22:21:50 +00:00
|
|
|
namespace:
|
|
|
|
type: string
|
2019-03-14 12:00:57 +00:00
|
|
|
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
|
2019-05-13 13:08:02 +00:00
|
|
|
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
|
|
|
|
required:
|
|
|
|
- pattern
|
|
|
|
properties:
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
pattern:
|
|
|
|
AnyValue: {}
|
|
|
|
generate:
|
2019-05-21 21:37:54 +00:00
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- kind
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
kind:
|
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
2019-06-01 01:45:23 +00:00
|
|
|
clone:
|
2019-05-21 21:37:54 +00:00
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- namespace
|
|
|
|
- name
|
|
|
|
properties:
|
|
|
|
namespace:
|
2019-03-14 12:00:57 +00:00
|
|
|
type: string
|
2019-05-21 21:37:54 +00:00
|
|
|
name:
|
2019-03-14 12:00:57 +00:00
|
|
|
type: string
|
2019-05-21 21:37:54 +00:00
|
|
|
data:
|
2019-06-01 00:59:36 +00:00
|
|
|
AnyValue: {}
|
2019-03-21 13:57:30 +00:00
|
|
|
---
|
2019-05-22 01:36:24 +00:00
|
|
|
kind: Namespace
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
name: "kyverno"
|
|
|
|
---
|
2019-03-21 13:57:30 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2019-05-22 01:36:24 +00:00
|
|
|
namespace: kyverno
|
|
|
|
name: kyverno-svc
|
2019-03-21 13:57:30 +00:00
|
|
|
labels:
|
2019-05-22 01:36:24 +00:00
|
|
|
app: kyverno
|
2019-03-21 13:57:30 +00:00
|
|
|
spec:
|
|
|
|
ports:
|
|
|
|
- port: 443
|
|
|
|
targetPort: 443
|
|
|
|
selector:
|
2019-05-22 01:36:24 +00:00
|
|
|
app: kyverno
|
2019-03-21 15:25:36 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
2019-05-22 01:36:24 +00:00
|
|
|
name: kyverno-service-account
|
|
|
|
namespace: kyverno
|
2019-03-21 13:57:30 +00:00
|
|
|
---
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
|
|
|
metadata:
|
2019-05-22 01:36:24 +00:00
|
|
|
name: kyverno-admin
|
2019-03-21 13:57:30 +00:00
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: cluster-admin
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
2019-05-22 01:36:24 +00:00
|
|
|
name: kyverno-service-account
|
|
|
|
namespace: kyverno
|
2019-03-21 13:57:30 +00:00
|
|
|
---
|
|
|
|
apiVersion: extensions/v1beta1
|
2019-03-21 15:25:36 +00:00
|
|
|
kind: Deployment
|
2019-03-21 13:57:30 +00:00
|
|
|
metadata:
|
2019-05-22 01:36:24 +00:00
|
|
|
namespace: kyverno
|
2019-06-27 18:38:34 +00:00
|
|
|
name: kyverno
|
2019-03-21 13:57:30 +00:00
|
|
|
labels:
|
2019-05-22 01:36:24 +00:00
|
|
|
app: kyverno
|
2019-03-21 13:57:30 +00:00
|
|
|
spec:
|
2019-03-21 15:25:36 +00:00
|
|
|
replicas: 1
|
2019-03-21 13:57:30 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2019-05-22 01:36:24 +00:00
|
|
|
app: kyverno
|
2019-03-21 13:57:30 +00:00
|
|
|
spec:
|
2019-05-22 01:36:24 +00:00
|
|
|
serviceAccountName: kyverno-service-account
|
2019-03-21 13:57:30 +00:00
|
|
|
containers:
|
2019-05-22 01:36:24 +00:00
|
|
|
- name: kyverno
|
2019-07-15 22:30:28 +00:00
|
|
|
image: nirmata/kyverno:dev-testing
|
2019-06-19 21:05:23 +00:00
|
|
|
args: ["--filterKind","Nodes,Events,APIService,SubjectAccessReview"]
|
2019-03-21 15:25:36 +00:00
|
|
|
ports:
|
|
|
|
- containerPort: 443
|
|
|
|
securityContext:
|
|
|
|
privileged: true
|
2019-05-23 04:41:24 +00:00
|
|
|
|