Vinyeh's picture
Add pinned source: gatekeeper-library (part 7)
df0899b verified
Raw History Blame Contribute Delete
1.7 kB
apiVersion: templates.gatekeeper.sh/v1
kind: ConstraintTemplate
metadata:
name: verifydeprecatedapi
annotations:
metadata.gatekeeper.sh/title: "Verify deprecated APIs"
metadata.gatekeeper.sh/version: 1.0.0
description: >-
Verifies deprecated Kubernetes APIs to ensure all the API versions are up to date. This template does not apply to audit as audit looks at the resources which are already present in the cluster with non-deprecated API versions.
spec:
crd:
spec:
names:
kind: VerifyDeprecatedAPI
validation:
openAPIV3Schema:
type: object
properties:
kvs:
type: array
description: Deprecated api versions and corresponding kinds
items:
type: object
properties:
deprecatedAPI:
type: string
description: deprecated api
example: flowcontrol.apiserver.k8s.io/v1beta2
kinds:
type: array
items:
type: string
description: impacted list of kinds
example: '["FlowSchema", "PriorityLevelConfiguration"]'
targetAPI:
type: string
description: target api
example: flowcontrol.apiserver.k8s.io/v1beta3
k8sVersion:
type: number
description: kubernetes version
targets:
- target: admission.k8s.gatekeeper.sh
rego: |
{{ file.Read "src/general/verifydeprecatedapi/src.rego" | strings.Indent 8 | strings.TrimSuffix "\n" }}