From 9712efc3a1f1e0a53ec6adcdf64b3de0b76fd804 Mon Sep 17 00:00:00 2001 From: Forherlong <541479561@qq.com> Date: Wed, 31 Aug 2022 11:23:25 +0800 Subject: [PATCH] CRD sample --- resourcedefinition.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 resourcedefinition.yaml diff --git a/resourcedefinition.yaml b/resourcedefinition.yaml new file mode 100644 index 0000000000..75007437c6 --- /dev/null +++ b/resourcedefinition.yaml @@ -0,0 +1,40 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + # name must match the spec fields below, and be in the form: . + name: crontabs.stable.example.com +spec: + # group name to use for REST API: /apis// + 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/// + 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