Home Explore Blog CI



kubernetes

2nd chunk of `content/en/blog/_posts/2015-04-00-Introducing-Kubernetes-V1Beta3.md`
4c45f27df87cb19c5b278455940c0c4e2cd84da26859442b0000000100000d42
[https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/update-demo/v1beta3](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/update-demo/v1beta3)



To aid the transition, we've also created a conversion [tool](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/cluster_management.md#switching-your-config-files-to-a-new-api-version) and put together a list of important [different API changes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api.md#v1beta3-conversion-tips).  


- The resource `id` is now called `name`.
- `name`, `labels`, `annotations`, and other metadata are now nested in a map called `metadata`
- `desiredState` is now called `spec`, and `currentState` is now called `status`
- `/minions` has been moved to `/nodes`, and the resource has kind `Node`
- The namespace is required (for all namespaced resources) and has moved from a URL parameter to the path:`/api/v1beta3/namespaces/{namespace}/{resource_collection}/{resource_name}`
- The names of all resource collections are now lower cased - instead of `replicationControllers`, use`replicationcontrollers`.
- To watch for changes to a resource, open an HTTP or Websocket connection to the collection URL and provide the`?watch=true` URL parameter along with the desired `resourceVersion` parameter to watch from.
- The container `entrypoint` has been renamed to `command`, and `command` has been renamed to `args`.
- Container, volume, and node resources are expressed as nested maps (e.g., `resources{cpu:1}`) rather than as individual fields, and resource values support [scaling suffixes](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/resources.md#resource-quantities) rather than fixed scales (e.g., milli-cores).
- Restart policy is represented simply as a string (e.g., "Always") rather than as a nested map ("always{}").
- The volume `source` is inlined into `volume` rather than nested.
- Host volumes have been changed to hostDir to hostPath  to better reflect that they can be files or directories



And the most recently generated Swagger specification of the API is here:

[http://kubernetes.io/third\_party/swagger-ui/#!/v1beta3](http://kubernetes.io/third_party/swagger-ui/#!/v1beta3)



More details about our approach to API versioning and the transition can be found here:

[https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api.md](https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api.md)



Another change we discovered is that with the change to the default API version in kubectl, commands that use "-o template" will break unless you specify "--api-version=v1beta1" or update to v1beta3 syntax. An example of such a change can be seen here:

[https://github.com/GoogleCloudPlatform/kubernetes/pull/6377/files](https://github.com/GoogleCloudPlatform/kubernetes/pull/6377/files)



If you use "-o template", I recommend always explicitly specifying the API version rather than relying upon the default. We may add this setting to kubeconfig in the future.



Let us know if you have any questions. As always, we're available on IRC (#google-containers) and github issues.

Title: Kubernetes v1beta3 API Transition Details and Updates
Summary
To assist with the transition to Kubernetes v1beta3 API, a conversion tool and API change list are available. Key changes include renaming 'id' to 'name', nesting metadata, renaming 'desiredState' to 'spec' and 'currentState' to 'status', and moving '/minions' to '/nodes'. Resource collection names are now lowercase, and watching resource changes requires a specific URL parameter. Container attributes like entrypoint and command have been renamed, and resources are expressed as nested maps. The Swagger specification and API versioning approach are also linked. Using '-o template' requires specifying the API version.