捕鱼大亨网络版 API版本v1beta3简介
在过去的几个月中,我们一直在努力清理API(请参见 //github.com/GoogleCloudPlatform/kubernetes/issues/1519 有关详细信息)。结果是v1beta3,它被视为v1 API的候选发布版本。
我们希望您尽快移至该新API版本。 v1beta1和v1beta2已过时,我们将在引入v1 API后不久在6月底将其删除。
从最新版本v0.15.0开始,v1beta3是主要的默认API。我们更改了默认的kubectl和客户端API版本以及默认的存储版本(这意味着保留在etcd中的对象将在重写时从v1beta1转换为v1beta3)。
您可以看一下v1beta3示例,例如:
//github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/guestbook/v1beta3
//github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/walkthrough/v1beta3
//github.com/GoogleCloudPlatform/kubernetes/tree/master/examples/update-demo/v1beta3
为了帮助过渡,我们还创建了一个转化 工具 并列出重要的清单 不同的API更改.
- The resource
id
is now calledname
. name
,labels
,annotations
, and other metadata are now nested in a map calledmetadata
desiredState
is now calledspec
, andcurrentState
is now calledstatus
/minions
has been moved to/nodes
, and the resource has kindNode
- 命名空间是必需的(对于所有命名空间资源),并且已从URL参数移至路径:
/api/v1beta3/namespaces/{namespace}/{resource_collection}/{resource_name}
- The names of all resource collections are now lower cased - instead of
replicationControllers
, usereplicationcontrollers
. - 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 desiredresourceVersion
parameter to watch from. - The container
entrypoint
has been renamed tocommand
, andcommand
has been renamed toargs
. - Container, volume, and node resources are expressed as nested maps (e.g.,
resources{cpu:1}
) rather than as individual fields, and resource values support 缩放后缀 而不是固定比例(例如,毫核心)。 - 重新启动策略简单地表示为字符串(例如“ Always”),而不是嵌套映射(“ always {}”)。
- The volume
source
is inlined intovolume
rather than nested. - 主机卷已从hostDir更改为hostPath,以更好地反映它们可以是文件还是目录
API的最新生成的Swagger规范位于:
http://sjzrbxc.cn/third_party/swagger-ui/#!/v1beta3
有关我们的API版本控制和过渡方法的更多详细信息,请参见以下网址:
//github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/api.md
我们发现的另一个更改是,随着kubectl中默认API版本的更改,除非您指定“ --api-version = v1beta1”或更新为v1beta3语法,否则使用“ -o template”的命令将中断。可以在此处看到此类更改的示例:
//github.com/GoogleCloudPlatform/kubernetes/pull/6377/files
如果使用“ -o模板”,则建议始终显式指定API版本,而不要依赖默认版本。我们将来可能会将此设置添加到kubeconfig中。
如果你有任何疑问,请告诉我们。与往常一样,我们可以使用IRC(#google-containers)和github问题。