- Check whether the service is successfully created.
- Log on to the Container Service console. In the left-side navigation pane, choose . On the Services page, verify that the gateway-swarm-slb service is displayed and its type is NodePort.
- Check whether the service is running normally.
You can log on to an ECS instance in the Kubernetes cluster and send a request to the NodePort service to see whether the service is accessible. In this example, the service uses port 30080 and the IP address of the ECS instance is 192.168.0.250.
After you make sure that the NodePort service is running normally, you need to Configure the SLB instance attached to the Swarm cluster and mount the NodePort service to the backend of the SLB instance.
- In the left-side navigation pane, choose Nodes page, select cluster Kubernetes-piggymetrics-cluster and click the ID of the target ECS instance.. On the
- On the Instance Details page that appears, click Connect to log on to the instance.
- Use commands such as ping, telnet, or wget to connect to 192.168.0.251:30080 and check whether the NodePort service is running
Container Service automatically creates a security group for ECS instances in one cluster. By default, only IP addresses within the Pod CIDR block can access services running on cluster nodes. You cannot access the NodePort service from outside the cluster. Therefore, an ECS instance in the cluster is used to access the NodePort service in this example. To view security group settings, use the following steps.
- Log on to the Elastic Compute Service console. In the left-side navigation pane, choose . Select the target security group and click Add Rules in the Actions column.
- On the Security Group Rules page that appears, click the Inbound tab and the allowed CIDR block is displayed in the Authorization Object column.
How helpful was this page?
What might be the problems?