负载访问504问题定位思路
负载访问504问题一般是因为ELB实例绑定的Port到后端 CCI 负载Pod的安全组没有放通。查看CCI负载Pod使用的安全组,确保安全组规则放通ELB实例绑定的Port。
Pod绑定的安全组可以通过查看负载对应Network获得,调用Network接口,响应里面metadata.annotations中的network.alpha.kubernetes.io/default-security-group即为安全组ID,如下所示。
{ "kind": "Network", "apiVersion": "networking.cci.io/v1beta1", "metadata": { "name": "namespace-test-dc1-default-network", "namespace": "namespace-test", "selfLink": "/apis/networking.cci.io/v1beta1/namespaces/namespace-test/networks/namespace-test-dc1-default-network", "uid": "6fb85414-af6b-11e8-b6ef-f898ef6c78b4", "resourceVersion": "5016899", "creationTimestamp": "2018-09-03T11:21:00Z", "annotations": { "network.alpha.kubernetes.io/project-id": "51bf52609f2a49c68bfda3398817b376", "network.alpha.kubernetes.io/default-security-group": "19c5d024-aed5-4856-b958-c0f65ce70855", "network.alpha.kubernetes.io/domain-id": "aadb43c0b14c4cafbccfff483d075987" }, "enable": true }, "spec": { "cidr": "192.168.244.0/23", "attachedVPC": "0d4080e5-546a-46c4-86fe-f3e26d685177", "networkType": "underlay_neutron", "physicalNetwork": "phy_net0", "networkID": "0022e356-f730-4226-802e-9cdaa6e7da17", "subnetID": "1ffd839d-e534-4fa8-a59d-42356335bf74", "availableZone": "cnnorth1a" }, "status": { "state": "Active" } }
进入网络控制台,根据上述操作中已获取的安全组ID,查找对应的安全组。
单击安全组名称,在安全组的入方向规则中增加如下规则。
UDP类型的公网访问,健康检查依赖ICMP规则,请注意添加。