赞
踩
第一步: 看一下界面长相?从控制台点击Kubernetes Engine–>Clusters
打开了集群控制面板 Dashboard,可以看到目前有一个K8S集群叫做graphviz-app,详情栏目中包括了位置US LOCATION,集群节点3个。总CPU数量和总可用内存。最右边的Connect点击后会在当前页面上生成命令行终端所以GCP在这方面做的比较好,直接帮助你在统一界面上获得集群的连接服务进行操作
点击集群名称进入下一个层级可以看到详情和节点也就是GCP虚拟服务器实例的详情
在GCP K8S部署中一般都是用前端服务PODS对接一个负载均衡单一地址,这个负载均衡的单一地址就是WEB应用的对外服务的响应的IP地址,比如HTTPS://IP地址。点击后会看到如下WEB应用。
以上是一个已经部署好的K8S集群WEB前后端的基本情况,下面讲解以下如何部署一个这样的项目。
对于一个全新的K8S集群部署,在GCP的Kubernetes Engine中可以轻松实现,不过我们这次采用命令行的方式创建更加方便灵活也显得比较专业!!
在右上角找到下面这个图标,点击后获得命令行界面又叫 CLOUD SDK
wait a bit we will have the commnad-line tool like below. this is a lot more convenient than AWS cloud where we have to use our own local terminal to connect to cloud for any operations and we need to care securities and credentials which are all cared by GCP like this.
Once we enter the command-line, we could interact with GCP resources from command-line such as we need to verify the compute zones available to us.
gcloud compute zones list
we will have output like this, there are lots of them so we didnt display all in full!!
in order to create resources on GCP first thing needed is to configure the zones you want the resources to be created.
gcloud config set compute/zone us-central1-a
once we done that, now it is time to create the cluster using command-line tool.
gcloud container clusters create graphviz-app [--optional]
if we do not provide any additional optional arguments, above command will just create a default cluster with 3 nodes of machine type n1-standard-1 (1vCPU and 3.75GB memory). hit t
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。