...

Text file src/k8s.io/api/README.md

Documentation: k8s.io/api

     1# api
     2
     3Schema of the external API types that are served by the Kubernetes API server.
     4
     5## Purpose
     6
     7This library is the canonical location of the Kubernetes API definition. Most likely interaction with this repository is as a dependency of client-go.
     8
     9It is published separately to avoid diamond dependency problems for users who
    10depend on more than one of `k8s.io/client-go`, `k8s.io/apimachinery`,
    11`k8s.io/apiserver`...
    12
    13## Recommended Use
    14
    15We recommend using the go types in this repo. You may serialize them directly to
    16JSON.
    17
    18If you want to store or interact with proto-formatted Kubernetes API objects, we
    19recommend using the "official" serialization stack in `k8s.io/apimachinery`.
    20Directly serializing these types to proto will not result in data that matches
    21the wire format or is compatible with other kubernetes ecosystem tools. The
    22reason is that the wire format includes a magic prefix and an envelope proto.
    23Please see:
    24https://kubernetes.io/docs/reference/using-api/api-concepts/#protobuf-encoding
    25
    26For the same reason, we do not recommend embedding these proto objects within
    27your own proto definitions. It is better to store Kubernetes objects as byte
    28arrays, in the wire format, which is self-describing. This permits you to use
    29either JSON or binary (proto) wire formats without code changes. It will be
    30difficult for you to operate on both Custom Resources and built-in types
    31otherwise.
    32
    33## Compatibility
    34
    35Branches track Kubernetes branches and are compatible with that repo.
    36
    37## Where does it come from?
    38
    39`api` is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api. Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here.
    40
    41## Things you should *NOT* do
    42
    431. https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api is synced to k8s.io/api. All changes must be made in the former. The latter is read-only.
    44
    45

View as plain text