ACK@Edge is the first cloud-native edge computing service that coordinates workloads in the cloud and at the edge based on a non-intrusive approach. The service allows you to deploy application pods at the edge and set these pods to use InClusterConfig to access the Kubernetes API server without making pod-facing changes. This topic describes how to run application pods that use InClusterConfig at the edge.
Background information
The following issues arise when you want to deploy application pods in an open source
Kubernetes cluster to the edge and set these pods to use InClusterConfig to access
the Kubernetes API server:
- Issue 1: Application pods access the Kubernetes API server through the addresses in InClusterConfig. The default load balancing rules (iptables/ipvs) configured on the node forward external requests to the application pods of the Kubernetes API server through their IP addresses. However, the pods at the edge and the Kubernetes API server in the cloud belong to different networks. Therefore, the pods at the edge cannot access the IP addresses of pods in the cloud. As a result, the application pods at the edge cannot use InClusterConfig to access the Kubernetes API server.
- Issue 2: After Issue 1 is resolved, if the application pods are restarted due to network jitters in the cloud, the pods at the edge cannot retrieve workload configurations from the Kubernetes API server. This affects the restart of application pods.
Solutions
You can enable the edge-hub of ACK@Edge on edge nodes to resolve the preceding issues
based on a non-intrusive approach. Then, you can set application pods at the edge
to use InClusterConfig to access the Kubernetes API server without making pod-facing
changes. Take note of the following details:
- The endpoints of pods deployed at the edge are automatically changed from environment
variables (KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT) to the HTTPS endpoint of edge-hub (
KUBERNETES_SERVICE_HOST=169.254.2.1
andKUBERNETES_SERVICE_PORT=10268
) without the awareness of the application pods. This way, the application pods can use InClusterConfig to access the Kubernetes API server through edge-hub. This resolves the first issue. - You must enable the caching feature of edge-hub. This way, application pods can retrieve data from the local cache when they are restarted. This resolves the second issue. For more information about how to enable the caching feature of edge-hub, see Enable the caching feature of edge-hub.
Enable the caching feature of edge-hub
Note
- We recommend that you do not enable caching for pods that receive a large number of list or watch requests because data is cached on local disks.
- You must restart the pods after the caching feature is enabled on the pods.