在Google Container Engine上访问Kubernetes API [英] Accessing Kubernetes API on Google Container Engine

查看:92
本文介绍了在Google Container Engine上访问Kubernetes API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据Kubernetes API文档,可以创建/列出/删除Pod,复制控制器和服务:

According to Kubernetes API docs it is possible to create/list/delete pods, replication controllers and services:

http://kubernetes.io/third_party/swagger-ui/#!/v1beta1

但是,在Google Container Engine文档中,它们似乎没有公开此API.可以通过REST API管理的唯一资源是群集.必须使用gcloud来管理Pod,复制控制器和服务.

However in the Google Container Engine documentation they don't seem to expose this API. The only resources you can manage through a REST API are clusters. Pods, replication controllers and services have to be managed using gcloud.

使用Google Container Engine时是否可以访问Kubernetes API?

Is it possible to access the Kubernetes API when using Google Container Engine?

推荐答案

在Google Container Engine上启动容器集群后,您将拥有一个在GCP项目中的VM上运行kubernetes API的主机.如果运行gcloud preview container clusters list,您将看到kubernetes API可用的终结点以及访问它的http基本身份验证凭据.

Once you launch your container cluster on Google Container Engine, you will have a master running the kubernetes API on a VM in your GCP project. If you run gcloud preview container clusters list you will see the endpoint at which the kubernetes API is available as well as the http basic auth credentials needed to access it.

gcloud与最新版本的kubectl捆绑在一起,并且能够对您使用Google Container Engine启动的任何容器集群执行该命令.例如,要列出窗格,可以运行gcloud preview container kubectl list pods.

gcloud comes bundled with a recent version of kubectl and the ability to execute it for any container cluster you have launched with Google Container Engine. To list pods, for instance, you can run gcloud preview container kubectl list pods.

https://cloud.google.com/sdk/gcloud/reference/preview/container/kubectl 描述了gcloud preview container kubectl命令及其接受的标志.

https://cloud.google.com/sdk/gcloud/reference/preview/container/kubectl describes the gcloud preview container kubectl command and what flags it accepts.

这篇关于在Google Container Engine上访问Kubernetes API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆