1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 16:06:56 +00:00
kyverno/docs/dev/api/README.md
Fish-pro 24742b42d4
Optimize the document for readability (#6175)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
2023-01-31 18:16:54 +08:00

50 lines
1.6 KiB
Markdown

# Kyverno API
This document provides guidance on extending and maintaining the [Kyverno API](../../../api/kyverno/)
## Concepts
* https://kubernetes.io/docs/reference/using-api/api-concepts/
* https://kubernetes.io/docs/reference/using-api/
* https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/
## API Groups
All Kyverno resources are currently defined in the `kyverno.io` API group.
## API Versions
This `kyverno.io` has the following versions:
* v1apha1
* v1apha2
* v1beta1
* v1
* v2Beta1
The `v1` version is currently the preferred storage version, but is being deprecated.
The goal is to eventually make v2 the preferred version and remove all v1* versions.
## Adding a new Kind (Resource)
New types should not be added to `v1` but should be introduced as `v2alpha1` and then promoted as they stabilize.
## Adding a new attribute
New attributes can be added to existing resources without impacting compatibility. They do not require a new version.
## Deleting an attribute
Attributes cannot be deleted in a version. They should be marked for deprecation and removed after 3 minor releases.
## Modifying an attribute
Attributes cannot be modified in a version. The existing attribute should be marked for deprecation and a new attribute should be added following version compatibity guidelines.
## Stable References
Within the API, newer versions can reference older stable types, but not the other way around. For example, a `v1` resource should not refer to a `v2alpha1` type. However, a `v2alpha1` type can reference `v1` types.