检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
修改Nginx镜像的欢迎页面,定制一个新的镜像,将欢迎页面改为“Hello, CCI!”。 操作步骤 以root用户登录容器引擎所在的虚拟机。 创建一个名为Dockerfile的文件。 mkdir mynginx cd mynginx touch Dockerfile 编辑Dockerfile。
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
的访问流量支持直通到容器中;当应用进行滚动升级或者弹性扩缩容,通过配置容器探针,最短就绪时间等可以做到优雅升级,从而实现优雅弹性扩缩容(在升级或者扩缩容过程中业务不会出现5xx的错误响应)。 操作步骤 在此以nginx的无状态工作负载为例,提供了CCI中应用进行优雅滚动升级或者弹性扩缩容最佳实践。
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
ELB访问负载。 从公网访问负载:从外部访问负载,需要通过Ingress绑定公网ELB,通过ELB的IP访问负载。 从负载中访问公网:通过在NAT网关服务中配置SNAT规则,使得容器能够访问公网,具体配置方法请参见从容器访问公网。 图1 网络访问示意图 父主题: 使用Service和Ingress管理网络访问
健康检查 健康检查是指容器运行过程中,根据需要,定时检查容器中应用健康状况。 云容器实例基于Kubernetes,提供了两种健康检查的方式: 应用存活探针(liveness probe),探测应用是否已经启动:该检查方式用于检测容器是否存活,类似于我们执行ps命令检查进程是否存在
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
EIP随Pod创建的优先级高于使用EIPPool创建的EIP。 绑定已有EIP创建的优先级高于EIP随Pod创建的EIP。 绑定EIP的Pod,如果要被公网成功访问,需要添加放通相应公网请求流量的安全组规则。 已经被Pod绑定的弹性公网IP,请勿通过弹性公网IP的console或API直接操作(修改别名/删除/
其中,endpoint为云容器实例的Endpoint,获取方法请参见地区和终端节点;ak、sk的获取方法请参见获取AK/SK,ak为文件中Access Key部分,sk为文件中Secret Key部分。 例如,Endpoint为https://cci.cn-north-4.myhuaweicloud
- the value of this field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
如何处理公网无法访问负载? 公网能正常访问的前提是负载已处于运行中状态,如果您的负载处于未就绪或异常状态,公网访问将无法正常使用。 从负载开始创建到公网可以正常访问可需要1分钟到3分钟的时间,在此时间内网络路由尚未完成配置,请稍作等待。 负载创建3分钟以后仍然无法访问。在“工作负载