MSE Ingress is compatible with Nginx Ingress and delivers twice the performance of a self-managed open source deployment. It holds an industry-leading security maturity rating from the China Academy of Information and Communications Technology (CAICT) and offers low cost, security, high integration, and high availability (HA). This topic describes how to access Container Service and Container Compute Service through MSE Ingress.
For security reasons, MSE Ingress does not allow you to expose services in the kube-system namespace.
Prerequisites
MSE Ingress Controller can be installed in ACK managed clusters, ACK Serverless clusters, and Container Compute Service (ACS) clusters.
-
For an ACK managed cluster or ACK Serverless cluster, click this authorization link. For an ACS cluster, click this authorization link to grant permissions to MSE Ingress Controller.
-
A container cluster that runs version 1.18 or later. To create a cluster, see Create an ACK managed cluster, Create an ACK Serverless cluster, or Create an ACS cluster.
NoteIf your cluster runs a version earlier than 1.18, upgrade the cluster. For instructions, see Manually upgrade a cluster.
Step 1: Install MSE Ingress Controller
-
ACK managed cluster/ACK Serverless
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of your cluster. In the left navigation pane, click Components and Add-ons .
ACS
-
Log on to the ACS console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, click Add-ons.
-
-
On the Add-on Management page, enter
msein the search box. On the MSE Ingress Controller add-on card, click Install. -
In the Install Add-on MSE Ingress Controller dialog box, configure the parameters, and then click Confirm.
ACK managed cluster/ACK Serverless
For the MSE cloud-native gateway instance, select New or Existing.
-
New: A pay-as-you-go Professional Edition MSE cloud-native gateway instance with node specifications of 2c4g * 2 is created automatically. You can change these default specifications after the instance is created.
From the Network Type drop-down list, select Internet, and then click Confirm.
-
Use existing: From the displayed list, select a pay-as-you-go Professional Edition gateway instance that is in the same VPC as the container cluster and is not associated with another cluster.
ACS
For the MSE cloud-native gateway instance, select New or Existing.
-
New: A pay-as-you-go Professional Edition MSE cloud-native gateway instance with node specifications of 2c4g * 2 is created automatically. An NLB load balancing instance is also created based on the specified network type.
Network Type: Select Internet and click OK to complete the add-on installation.
-
From the displayed list, select a pay-as-you-go Professional Edition gateway instance that is in the same VPC as the container cluster and is not associated with another cluster.
If Failed to pass the precheck. occurs while the add-on is being installed and you use an ACK managed cluster or ACK Serverless product, see Grant permissions to MSE Ingress Controller. If you use ACS, click Authorize MSE Ingress Controller.
On the Add-on Management page, in the Network section, click the View Check Report link on the right side to view the detailed precheck report.
-
-
After the add-on is installed, an MseIngressConfig resource named
mse-ingress-premium-{clusterid}and a gateway instance namedmse-ingress-premium-{clusterid}are created by default.Go to Workload> Custom Resources and click the Resource Objects tab. In API Group, search for
mse. In the Actions column of MseIngressConfig, click Edit YAML to view the status ofMseIngressConfig. Wait 3 to 5 minutes and make sure thatphaseis Listening, which indicates that the cloud-native gateway is created and running. The cloud-native gateway automatically listens to the Ingress resources whose IngressClass is mse in the cluster.The state of MseIngressConfig changes in sequence: Pending > Running > Listening. The following list describes each state:
-
Pending: The cloud-native gateway is being created. Wait approximately 3 minutes.
-
Running: The cloud-native gateway is created and running.
-
Listening: The cloud-native gateway is running and listens to the Ingress resources in the cluster.
-
Failed: The cloud-native gateway is in an invalid state. View Message in the Status field to identify the cause.
Important-
In New mode, installing MSE Ingress Controller creates an MseIngressConfig resource by default. The lifecycle of this resource is bound to the MSE cloud-native gateway instance. Deleting the MseIngressConfig resource cascade deletes the associated MSE cloud-native gateway instance. Do not delete the MseIngressConfig resource unless necessary.
-
If an IngressClass resource named mse already exists in the cluster, installing MSE Ingress Controller does not automatically create an MseIngressConfig resource or an MSE cloud-native gateway instance.
-
-
Log on to the MSE Gateway console. In the corresponding region, you can see the cloud-native gateway instance named
mse-ingress-premium-{clusterid}.
Step 2: Deploy a backend service
-
ACK managed cluster/ACK Serverless
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
ACS
-
Log on to the ACS console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, choose Workloads > Deployments.
-
-
On the Stateless page, click Create Resource from YAML. For example, use the following YAML sample to deploy a Deployment named
httpbinand a Service namedhttpbin.apiVersion: apps/v1 kind: Deployment metadata: name: httpbin namespace: default spec: replicas: 1 selector: matchLabels: app: httpbin template: metadata: labels: app: httpbin version: v1 spec: containers: - image: registry.cn-hangzhou.aliyuncs.com/mse-ingress/go-httpbin args: - "--version=v1" imagePullPolicy: Always name: httpbin --- apiVersion: v1 kind: Service metadata: name: httpbin namespace: default spec: ports: - port: 8080 protocol: TCP selector: app: httpbin -
Verify that the Deployment and Service are deployed.
-
In the left-side navigation pane, choose . A Deployment named
httpbinis created, andPodsis updated to1/1, which indicates that the Deployment is deployed. -
In the left-side navigation pane, choose . A Service named
httpbinis created, which indicates that the Service is deployed.
-
Step 3: Configure MSE Ingress
-
ACK managed cluster/ACK Serverless
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
ACS
-
Log on to the ACS console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, choose Network > Ingresses.
-
-
On the Routes page, click Create Ingress.
-
In the Create Ingress dialog box, set Gateway Type to MSE Ingress, configure the associated backend Service, annotations, and other settings, and then click OK.
Set Ingress Class to mse and set the route to Prefix Match. Set Path to
/, and forward requests to thehttpbinService. -
Log on to the MSE Gateway console. In your cloud-native gateway instance, you can see a route whose name contains httpbin.
The route name contains httpbin, the publishing status is Published, and the routing rule forwards the path
/to the httpbin Service. The source type is Ingress.
Step 4: Access the service
-
You can get the NLB domain name from the Ingress endpoint, or the public IP address from the gateway.
-
Method 1: View the endpoint information of the Ingress on the Routes page of the cluster.
ACK managed cluster/ACK Serverless
-
Log on to the ACK console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
On the Routes page, view the endpoint information of the Ingress.
Endpoint column displays the automatically assigned NLB load balancing address, which is the entry point for accessing MSE Ingress.
ACS
-
Log on to the ACS console. In the left navigation pane, click Clusters.
-
On the Clusters page, click the name of the target cluster. In the left navigation pane, choose Network > Ingresses.
-
On the Routes page, view the endpoint information of the Ingress.
In the Ingress list, the Endpoint column displays the NLB load balancing address, for example,
nlb-lfcq037h1h89ubvq6w.cn-hangzh....
-
-
Method 2: View the public IP address of the gateway in the MSE Gateway console.
Log on to the MSE Gateway console. In the left-side navigation pane, choose Cloud-native Gateway > Gateways and click the name of the target gateway. On the Overview page of your MSE cloud-native gateway instance, click the Endpoint tab to view the public IP address.
-
-
Use a browser, the CMD command, or another command line interface to access
NLB domain name/versionorGateway public IP/versionto test the service. For example, enternlb-b4ewsj2******.cn-hangzhou.nlb.aliyuncsslb.com/versionin a browser to access the service.version: v1 hostname: httpbin-897xxx-q7vcg
References
For details about MSE Ingress and how it works, see MSE Ingress management.