liveBook · Manning

Custom object

As explained in Distributed Machine Learning Patterns

A Kubernetes custom resource is an API object of a user-defined resource type that extends the Kubernetes API.

A custom object extends a Kubernetes installation with a user-defined API type. It lets teams represent specialized work, such as distributed training, using Kubernetes-native objects instead of managing every workload component directly. section 8.3.1

Custom objects support an operator-driven workflow:

  • Register the type dynamically; administrators can add, remove, or update it independently of the cluster. section 8.3.1
  • Create and inspect instances with kubectl, just as with built-in resources such as Pods. section 8.3.1
  • Let a stateful controller continuously monitor submitted objects and turn their specifications into running workloads. section 8.3.1

TFJob for distributed TensorFlow training

The Kubeflow Training Operator defines a TFJob custom object with two worker replicas, an image, a training command, and an OnFailure restart policy. Applying the manifest creates a TFJob; the operator then creates the corresponding worker Pods, which can be inspected with kubectl. section 8.3.1

How Distributed Machine Learning Patterns covers it

How deep it goes
Explains registration, kubectl access, and controller processing, but stops short of controller implementation details.
Examples
Uses a TFJob definition with two workers, TensorFlow containers, restart behavior, kubectl submission, and resulting worker Pods.
What it assumes
Uses Kubernetes clusters, namespaces, Pods, manifests, and kubectl as the surrounding operational vocabulary.
What you can do after
Operate/configure custom objects with kubectl and delegate workload reconciliation to a Kubernetes controller.
How it connects
Connects Kubernetes API, custom resource definitions, controllers, kubectl, Pods, and distributed training.

Also explained in

Compare how 2 books explain custom object →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Distributed Machine Learning Patterns. The section links point to the parts of the book it draws on.