Skip to content

Commit f47dd48

Browse files
author
Tomasz Tarczynski
committed
Add a CRD example
1 parent f63018f commit f47dd48

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#create-a-customresourcedefinition
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
# name must match the spec fields below, and be in the form: <plural>.<group>
6+
name: crontabs.stable.example.com
7+
spec:
8+
# group name to use for REST API: /apis/<group>/<version>
9+
group: stable.example.com
10+
# list of versions supported by this CustomResourceDefinition
11+
versions:
12+
- name: v1
13+
# Each version can be enabled/disabled by Served flag.
14+
served: true
15+
# One and only one version must be marked as the storage version.
16+
storage: true
17+
schema:
18+
openAPIV3Schema:
19+
type: object
20+
properties:
21+
spec:
22+
type: object
23+
properties:
24+
cronSpec:
25+
type: string
26+
image:
27+
type: string
28+
replicas:
29+
type: integer
30+
# either Namespaced or Cluster
31+
scope: Namespaced
32+
names:
33+
# plural name to be used in the URL: /apis/<group>/<version>/<plural>
34+
plural: crontabs
35+
# singular name to be used as an alias on the CLI and for display
36+
singular: crontab
37+
# kind is normally the CamelCased singular type. Your resource manifests use this.
38+
kind: CronTab
39+
# shortNames allow shorter string to match your resource on the CLI
40+
shortNames:
41+
- ct

0 commit comments

Comments
 (0)