Home

additionalPrinterColumns

additionalPrinterColumns is a feature of Kubernetes CustomResourceDefinition (CRD) that enables administrators to tailor the tabular output of kubectl get for custom resources. By defining extra columns, users can surface important fields from the resource’s spec or status directly in the listing, improving at-a-glance visibility without inspecting each item individually. The values for these columns are obtained from the resource’s JSON using JSONPath expressions.

In Kubernetes API conventions, the column definitions are defined per version. In modern CRDs (apiextensions.k8s.io/v1), they

Example usage:

apiVersion: apiextensions.k8s.io/v1

kind: CustomResourceDefinition

metadata:

name: foos.example.com

spec:

group: example.com

versions:

- name: v1

served: true

storage: true

additionalPrinterColumns:

- name: Replicas

type: integer

jsonPath: .spec.replicas

- name: Age

type: date

jsonPath: .metadata.creationTimestamp

scope: Namespaced

names:

plural: foos

singular: foo

kind: Foo

Limitations include that these columns are for kubectl display and do not affect resource storage or

appear
under
spec.versions[].additionalPrinterColumns.
Each
entry
is
a
CustomResourceColumnDefinition
and
typically
includes
fields
such
as
name,
type,
jsonPath,
and
optional
description
or
format.
The
jsonPath
selects
the
value
to
render
in
that
column;
the
type
indicates
the
data
type
(for
example
string,
integer,
boolean,
date).
The
resulting
header
in
kubectl
corresponds
to
the
name,
and
the
cell
contents
are
derived
from
the
matching
path
in
each
resource
instance.
If
a
jsonPath
does
not
resolve,
the
column
may
appear
empty
for
that
item.
validation,
and
they
rely
on
consistent
JSONPath
access
to
the
fields.
They
may
not
be
supported
by
all
tools
beyond
kubectl.