bonny v0.3.3 Bonny.CRD

Represents the spec portion of a Kubernetes CustomResourceDefinition manifest.

The CustomResourceDefinition API resource allows you to define custom resources. Defining a CRD object creates a new custom resource with a name and schema that you specify. The Kubernetes API serves and handles the storage of your custom resource.

Link to this section Summary

Types

t()

CRD Spec

Functions

Gets group version from CRD spec

CRD Kind or plural name

Generates the map equivalent of the Kubernetes CRD YAML manifest

Link to this section Types

Link to this type

t()
t() :: %Bonny.CRD{
  additionalPrinterColumns: [columns_t()],
  group: String.t(),
  names: names_t(),
  scope: :namespaced | :cluster,
  version: String.t()
}

CRD Spec

Link to this section Functions

Link to this function

api_version(crd)
api_version(Bonny.CRD.t()) :: binary()

Gets group version from CRD spec

Examples

iex> Bonny.CRD.api_version(%Bonny.CRD{group: "hello.example.com", version: "v1", scope: :namespaced, names: %{}})
"hello.example.com/v1"

CRD Kind or plural name

Examples

iex> Bonny.CRD.kind(%Bonny.CRD{names: %{plural: "greetings"}, scope: :namespaced, group: "test", version: "v1"})
"greetings"
Link to this function

to_manifest(crd)
to_manifest(Bonny.CRD.t()) :: map()

Generates the map equivalent of the Kubernetes CRD YAML manifest

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  creationTimestamp: null
  name: widgets.example.com
spec:
  group: example.com
  names:
    kind: Widget
    plural: widgets
  scope: Namespaced
  version: v1