检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
Service 直接访问Pod的问题 负载创建完成后,如何访问负载呢?访问负载实际上就是访问Pod,但是直接访问Pod会有如下几个问题: Pod会随时被Deployment这样的控制器删除重建,那访问Pod的结果就会变得不可预知。 Pod的IP地址是在Pod启动后才被分配,在启动前并不知道Pod的IP地址。
kubectl get pod nginx -o yaml -n $namespace_name 您还可以使用kubectl describe命令查看Pod的详情。 $ kubectl describe pod nginx -n $namespace_name 删除Pod 删除pod时,Kubernetes终止Pod中所有容器。
查询指定namespace下的Services 功能介绍 查询Namespace下所有Service的详细信息。 调用方法 请参见如何调用API。 URI GET /api/v1/namespaces/{namespace}/services 表1 路径参数 参数 是否必选 参数类型
of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and
rules for the pod. podAffinity io.k8s.api.core.v1.PodAffinity object Describes pod affinity scheduling rules (e.g. co-locate this pod in the same
以创建和管理多个Pod,提供副本管理、滚动升级和自愈能力,其中最为常用的就是Deployment。 一个Deployment可以包含一个或多个Pod副本,每个Pod副本的角色相同,所以系统会自动为Deployment的多个Pod副本分发请求。 Deployment集成了上线部署、
图2 选择Pod来源 您可以查看到所有Pod详情,包括基本信息、Pod中容器组成、Pod的监控信息、事件,以及使用远程终端访问Pod。您还可以对Pod进行删除操作,并查看Pod的日志。 图3 Pod详情 使用kubectl创建Pod 使用kubectl创建Pod请参见Pod“开发指南”。
rules for the pod. podAffinity io.k8s.api.core.v1.PodAffinity object Describes pod affinity scheduling rules (e.g. co-locate this pod in the same
按需秒级计费 根据实际使用的资源数量,按需按秒计费,避免业务不活跃时段的费用开销,降低用户成本。 完全开放的原生平台 紧跟Kubernetes和Docker社区,迅速同步最新版本 原生支持Kubernetes API 高安全 云容器实例同时具备容器级别的启动速度和虚拟机级别的安全隔离能力,提供更好的容器体验。
rules for the pod. podAffinity io.k8s.api.core.v1.PodAffinity object Describes pod affinity scheduling rules (e.g. co-locate this pod in the same
of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and
of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and
查询指定namespace下的PersistentVolumeClaims 功能介绍 查询Namespace下的所有PersistentVolumeClaim。 调用方法 请参见如何调用API。 URI GET /api/v1/namespaces/{namespace}/persistentvolumeclaims
URI DELETE /api/v1/namespaces/{namespace}/services/{name} 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the Service namespace 是 String object name
"service-test", "namespace" : "namespace-test", "resourceVersion" : "41521168", "selfLink" : "/api/v1/namespaces/namespace-test/services/service-test"
"redis", "namespace" : "namespace-test", "resourceVersion" : "5146412", "selfLink" : "/api/v1/namespaces/namespace-test/services/redis"
rules for the pod. podAffinity 否 io.k8s.api.core.v1.PodAffinity object Describes pod affinity scheduling rules (e.g. co-locate this pod in the same
POST /api/v1/namespaces/{namespace}/pods/{name}/exec 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the PodExecOptions namespace 是 String object
URI GET /api/v1/namespaces/{namespace}/pods/{name}/exec 表1 路径参数 参数 是否必选 参数类型 描述 name 是 String name of the PodExecOptions namespace 是 String object
rules for the pod. podAffinity io.k8s.api.core.v1.PodAffinity object Describes pod affinity scheduling rules (e.g. co-locate this pod in the same