CR vs CRD: matching parameters

Rambabu Yerajana
2 min readJan 2, 2024
  1. apiVersion and kind:

Match the apiVersion and kind fields in the CR with the values specified in the corresponding CRD.
For example:
CR apiVersion: example.com/v1 should match CRD spec.group: example.com and spec.names.kind: ABCApplication.

2. Metadata:

Check that the metadata in the CR, including the name, aligns with any naming constraints or patterns specified in the CRD.

3. Spec:

Verify that the structure of the spec section in the CR conforms to the schema defined in the CRD.
In the example, check that the replicas, storage, environmentVariables, and image properties are present and have the correct data types and formats as specified in the CRD.

4. Replicas:

Ensure that the replicas field in the CR is specified and meets any constraints defined in the CRD (e.g., minimum value).

5. Storage:

If the CR includes storage configurations, such as a persistentVolumeClaim, ensure that the structure matches the expectations defined in the CRD. Check accessModes and resources for correctness.

6. Environment Variables:

If the CR includes environment variables, verify that the environmentVariables array is present, and each entry has the expected name and value properties as defined in the CRD.

7. Image:

Confirm that the image field in the CR specifies the container image to be used and adheres to any naming conventions or constraints outlined in the CRD.

8. Validation:

Ensure that the values provided in the CR adhere to any validation rules defined in the CRD. For example, if the CRD specifies a minimum value for replicas, ensure that the CR meets or exceeds that minimum.

9. Namespace (if applicable):

If the CRD is namespaced (spec.scope: Namespaced), ensure that the CR is created in the correct namespace, and the CRD supports the namespace.
AdditionalPrinterColumns (if applicable):

10. If the CRD includes additional printer columns, ensure that the values specified in the CR align with the expected output format.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response