This document describes how to use Service and Ingress as entry points to expose workloads to external sources.
Service defines policies for accessing backend Pods and provides a fixed virtual IP address for access. It also provides load balancing for all requests to Pods.
Service can be of the following types:
annotations:service.kubernetes.io/qcloud-loadbalancer-internal-subnetid: subnet-xxxxxxxx
, you can use a private IP address from the VPC private network to access the backend Pod.Note:When the service type is public network access,
ClusterIP
of this service is disabled by default. You can add the following annotations in yaml to enableClusterIP
:
service.kubernetes.io/qcloud-clusterip-loadbalancer-subnetid: #Subnet ID of the service CIDR
Ingress is a collection of rules that allow access to Services of a cluster. You can configure different forwarding rules to allow different URLs to access different Services.
In order for Ingress resources to operate properly, you must run Ingress-controller
. TKE enables the CLB-based l7-lb-controller
by default and supports HTTP, HTTPS, and nginx-ingress controllers. You can select Ingress controllers according to your needs.
For more information and instructions, see Service Management and Ingress Management.
Was this page helpful?