Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CRD creation in K8s v1.22 #53

Closed
renugadevi-2613 opened this issue Oct 20, 2021 · 0 comments · Fixed by #58 or #77
Closed

Support for CRD creation in K8s v1.22 #53

renugadevi-2613 opened this issue Oct 20, 2021 · 0 comments · Fixed by #58 or #77
Labels
good first issue Good for newcomers

Comments

@renugadevi-2613
Copy link
Collaborator

Describe the bug
Configurator current CRD creation is not supported k8s v1.22. The API version apiextensions.k8s.io/v1beta1 of CRDS is removed need to support apiextensions.k8s.io/v1.

Additional context
Add any other context about the problem here.
In k8s v1.22 structural schema is mandatory. So we cannot directly define a CRD schema for customConfigMap as data: object. We need to specify its type. Since we don't have a control over the exact type of the object, we must include x-kubernetes-preserve-unknown-fields: true looks like:

kind: CustomResourceDefinition
metadata:
  name: customconfigmaps.configurator.gopaddle.io
. . .
. . .
schema:
      openAPIV3Schema:
        type: object
        properties:
          apiVersion:
            type: string
          kind:
            type: string
          metadata:
            type: object
          spec:
            type: object
            properties:
              configMapName:
                type: string
              data:
                x-kubernetes-preserve-unknown-fields: true
                type: object
              binaryData:
                x-kubernetes-preserve-unknown-fields: true
                type: object

reference: https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#specifying-a-structural-schema

@renugadevi-2613 renugadevi-2613 added the good first issue Good for newcomers label Oct 20, 2021
juliohm1978 added a commit to juliohm1978/configurator that referenced this issue Oct 21, 2021
Migrate CRDs to `apiextensions.k8s.io/v1`. This keeps the same api version for the current definition (v1alpha1), while making them compatible with Kubernetes 1.22+.
juliohm1978 added a commit to juliohm1978/configurator that referenced this issue Oct 22, 2021
Migrate CRDs to `apiextensions.k8s.io/v1`. This keeps the same api version for the current definition (v1alpha1), while making them compatible with Kubernetes 1.22+.

`apiextensions.k8s.io/v1` was introduced in 1.16, so this should also keep everything backwards compatible with previous installations of Configurator.
https://kubernetes.io/docs/reference/using-api/deprecation-guide/#customresourcedefinition-v122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
1 participant