Kubernetes Fundamentals : kind vs plural in customer resource definition file of kubernetes

Rambabu Yerajana
2 min readMar 5, 2023

In Kubernetes, the “kind” field in a resource definition file specifies the type of Kubernetes resource being defined, such as a Pod, Service, Deployment, or ConfigMap.

On the other hand, the “plural” field specifies the plural form of the resource’s name. This is used in the Kubernetes API to create, update, and delete multiple instances of the resource at once. For example, if you define a resource called “foo” and set the plural field to “foos”, you can create multiple instances of the “foo” resource at once by using the “foos” endpoint in the Kubernetes API.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: books.sample.com
spec:
group: sample.com
version: v1
scope: Namespaced
names:
plural: books
singular: book
kind: Book

In this YAML file, the “kind” field is set to “Book”, indicating that this is the kind of resource being defined. The “plural” field is set to “books”, which is the plural form of the resource name. The “singular” field is set to “book”, which is the singular form of the resource name.

After creating this resource definition file and applying it to your Kubernetes cluster, you can create instances of the “Book” resource by sending requests to the Kubernetes API using the “books” endpoint. For example, you could create a new “Book” instance by sending a POST request to:

POST /apis/sample.com/v1/namespaces/{namespace}/books

This request would create a new “Book” resource in the specified namespace. You could also retrieve a list of all “Book” instances in a namespace by sending a GET request to:

GET /apis/sample.com/v1/namespaces/{namespace}/books

This request would return a list of all “Book” instances in the specified namespace.

So, to summarize, the “kind” field specifies the type of the resource, while the “plural” field specifies the plural form of the resource’s name for use in the Kubernetes API.

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