From f47dd488ba21d5020eec3fd701301570024e540c Mon Sep 17 00:00:00 2001 From: Tomasz Tarczynski Date: Wed, 1 Jun 2022 15:44:11 +0200 Subject: [PATCH 1/2] Add a CRD example --- .../custom-resource-definition.yaml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 CustomResourceDefinition/custom-resource-definition.yaml diff --git a/CustomResourceDefinition/custom-resource-definition.yaml b/CustomResourceDefinition/custom-resource-definition.yaml new file mode 100644 index 0000000..8f0659d --- /dev/null +++ b/CustomResourceDefinition/custom-resource-definition.yaml @@ -0,0 +1,41 @@ +# https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#create-a-customresourcedefinition +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 From 03d3d0d3bbd5a51e333b088e8cbb7ce4a0ad6bff Mon Sep 17 00:00:00 2001 From: Tomasz Tarczynski Date: Wed, 1 Jun 2022 15:50:44 +0200 Subject: [PATCH 2/2] fix yamllint offences --- CustomResourceDefinition/custom-resource-definition.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CustomResourceDefinition/custom-resource-definition.yaml b/CustomResourceDefinition/custom-resource-definition.yaml index 8f0659d..d484e55 100644 --- a/CustomResourceDefinition/custom-resource-definition.yaml +++ b/CustomResourceDefinition/custom-resource-definition.yaml @@ -1,3 +1,4 @@ +--- # https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#create-a-customresourcedefinition apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -38,4 +39,4 @@ spec: kind: CronTab # shortNames allow shorter string to match your resource on the CLI shortNames: - - ct + - ct