This topic describes how to use an Ingress to enable external access to applications that are deployed on a virtual node of a Container Service for Kubernetes (ACK) cluster. This allows you to provide the applications with scalable and unlimited computing capacity without the need to create new nodes in the ACK cluster. This also ensures the elasticity of your workloads to withstand traffic fluctuations.
Prerequisites
A virtual node is deployed in your ACK cluster. For more information, see Deploy ack-virtual-node in an ACK cluster.
The virtual-node-affinity-injection: enabled label is added to the namespace vk. For more information, see Create a pod in a namespace with specified labels.
Procedure
Verify the results
- Go to the Workload page and click the Deployments tab. On the Deployments tab, you can find the newly created Deployments that are
named coffee and tea.
- Go to the Workload page and click the Pods tab. On the Pods tab, you can find that all pods of the created Deployments run on
the virtual-kubelet node.
- On the details page of the cluster, click Ingresses in the left-side navigation pane. On the Ingresses page, you can find the newly created
Ingress.
- Run the following command to check whether you can access the applications through
the Ingress:
kubectl get ing
Expected output:
NAME HOSTS ADDRESS PORTS AGE cafe-ingress cafe.example.com 114.55.252.185 80 6m18s
curl -H "Host:cafe.example.com" <EXTERNAL_IP>/tea
Expected output:
Server address: 192.168.xx.xx:80 Server name: tea-658d56f6cc-cxxxx Date: 25/Sep/2020:12:36:50 +0000 URI: /tea Request ID: b01d5bab9ae07abb8bc385377193xxxx
curl -H "Host:cafe.example.com" <EXTERNAL_IP>/coffee
Expected output:
Server address: 192.168.xx.xx:80 Server name: coffee-8c8ff9b4f-hxxxx Date: 25/Sep/2020:12:36:47 +0000 URI: /coffee Request ID: 722fe41a65a7fb552613c56e0a9axxxx