Kubespec Logo kubespec.dev

apiextensions.k8s.io/v1

Cluster-scoped Resource

CustomResourceDefinition

        CustomResourceDefinition represents a resource that should be exposed on the API server.  Its name MUST be in the format <.spec.name>.<.spec.group>.
      

Click on Property Name to show the description, and Pink Types to expand schema.

Required properties are marked with *

Change History

Kubernetes v1.36

Kubernetes v1.35

+2

Kubernetes v1.34

Kubernetes v1.33

Kubernetes v1.32

~1

Kubernetes v1.31

~1

Kubernetes v1.30

+1

Kubernetes v1.29

+1~1

Kubernetes v1.28

+2

Kubernetes v1.27

+1~9

Kubernetes v1.26

~1

Kubernetes v1.25

-1

Kubernetes v1.24

~5

Kubernetes v1.23

+1

Kubernetes v1.22

+1~1

Kubernetes v1.21

Kubernetes v1.20

Kubernetes v1.19

+2~1

Kubernetes v1.18

~1

Kubernetes v1.17

+1~4

Kubernetes v1.16

Kubernetes v1.15

Kubernetes v1.14

Kubernetes v1.13

Kubernetes v1.12

Kubernetes v1.11

Examples

There are 2 examples of CustomResourceDefinition that you can use as a starting point to create your own.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
# name must match the spec fields below, and be in the form: <plural>.<group>
name: crontabs.stable.example.com
spec:
# group name to use for REST API: /apis/<group>/<version>
group: stable.example.com
# list of versions supported by this CustomResourceDefinition
versions:
- name: v1
# Each version can be enabled/disabled by Served flag.
served: true
# One and only one version must be marked as the storage version.
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
cronSpec:
type: string
image:
type: string
replicas:
type: integer
# either Namespaced or Cluster
scope: Namespaced
names:
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
plural: crontabs
# singular name to be used as an alias on the CLI and for display
singular: crontab
# kind is normally the CamelCased singular type. Your resource manifests use this.
kind: CronTab
# shortNames allow shorter string to match your resource on the CLI
shortNames:
- ct

Other useful resources