Kubernetes: Custom Resource Definitions

A custom resource definition also known as CRD allows us to create custom resources. It is a way of extending the Kubernetes API and create resources for our own purposes.it is one of the ways to create custom resources other than using Aggregated APIs. Custom Resources Definition is currently under apiextensions.k8s.io/v1beta1.It is limited to only the existing functionality of the API. We can either have a custom resources scoped under a Cluster or Namespaced. Below is an example of how to create a Custom Resource Definition and the custom resource .

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
  name: networks.alphatribe.com
  group: alphatribe.com
  version: v1
  scope: Cluster
    plural: networks
    singular: network
    - net
    kind: Network
apiVersion: networks.alphatribe.com/v1
kind: Network
  name: dev
  subnet: ""
  bandwidthMb: 100
  enableARP: true

Leave a Reply

Your email address will not be published. Required fields are marked *