All Products
Search
Document Center

Container Service for Kubernetes:Create and use an APIG Ingress to expose services

Last Updated:Mar 26, 2026

APIG Ingress is the Enterprise Edition of Higress, compatible with Nginx Ingress. Use it to expose services in Container Service for Kubernetes (ACK) and Container Compute Service clusters through a cloud-native API gateway, with built-in low cost, high security, high availability, and deep integration with Alibaba Cloud.

Important

APIG Ingress does not support exposing services in the kube-system namespace.

In this tutorial, you will:

  • Install the APIG Controller add-on in your ACK cluster

  • Deploy a sample backend service

  • Configure an APIG Ingress to route external traffic to the service

  • Access and verify the service through the gateway endpoint

Prerequisites

Before you begin, ensure that you have:

APIG Controller can only be installed in an ACK managed cluster.

Step 1: Install APIG Controller

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. Log on to the ACS console. In the left navigation pane, click Clusters.

  3. Log on to the ACK console. In the left navigation pane, click Clusters.

  4. On the Clusters page, click the name of your cluster. In the left navigation pane, click Add-ons.

  5. On the Add-ons page, enter APIG in the search box. On the APIG Controller card, click Install.

  6. In the Install dialog box, select an installation mode and click OK.

    If installation fails with a prerequisite check error, grant the required permissions to APIG Controller and retry.
    Mode Description
    Create Automatically creates a pay-as-you-go Cloud-native API Gateway instance with the apig.small.x1 specification.
    Select Existing VPC Select an existing pay-as-you-go Cloud-native API Gateway instance. The instance must be in the same VPC as the cluster and not associated with other clusters.
  7. Verify that the installation succeeded. After installation, an ApigConfig resource and a gateway instance are created, both named apig-controller-pro-{clusterid}. To check the status: The phase field transitions in this order:

    1. Go to Workloads > Custom Resources. Click the Resource Objects tab.

    2. In the API Group search box, enter apig.

    3. In the Actions column for the ApigConfig resource, click Edit YAML.

    4. Check the phase field in the YAML. Wait 3–5 minutes until phase shows Listening.

    Important

    In Create mode, the ApigConfig resource is bound to the gateway instance lifecycle — deleting the ApigConfig also deletes the gateway instance. Do not delete the ApigConfig resource. If an IngressClass named apig already exists in the cluster before you install APIG Controller, the installation does not automatically create an ApigConfig resource or a gateway instance.

    Phase Description
    Pending The gateway is being created. This typically takes about 3 minutes.
    Running The gateway is created and running.
    Listening The gateway is running and listening for Ingress resources with ingressClassName: apig.
    Failed The gateway is in an error state. Check the message field under status for details.

  8. To verify that the gateway instance is created, log on to the Cloud-native API Gateway console. In the corresponding region, confirm that an instance named apig-controller-pro-{clusterid} appears.

Step 2: Deploy the backend service

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, choose Workloads > Deployments.

  3. On the Deployments page, click Create from YAML. Apply the following manifest to create a Deployment and a Service named httpbin in the default namespace.

    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
  4. Verify that the Deployment and Service are running.

    • Go to Workloads > Deployments. The httpbin Deployment is ready when the Pods column shows 1/1.

    • Go to Network > Services. Confirm that a Service named httpbin appears in the list.

Step 3: Configure the APIG Ingress

Using the console

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of your cluster. In the left navigation pane, choose Network > Ingresses.

  3. On the Ingresses page, click Create Ingress.

  4. In the Create Ingress dialog box, set the following options and click OK.

    • Gateway Type: APIG Ingress

    • Ingress Class: apig

    • Routing rule: Prefix (Prefix-based Match), Path: /, backend service: httpbin

  5. To confirm the Ingress is synced to the gateway, log on to the Cloud-native API Gateway console. In the corresponding gateway instance, an API whose name contains {gwid}-ingress should appear.

Using kubectl (optional)

If you prefer a CLI or GitOps workflow, apply the following Ingress manifest directly:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: httpbin-ingress
  namespace: default
spec:
  ingressClassName: apig
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: httpbin
                port:
                  number: 8080

Step 4: Access the service

  1. Get the gateway endpoint. In the ACK console, go to Network > Ingresses and note the endpoint shown for the Ingress you created. The endpoint is the Network Load Balancer (NLB) domain of the gateway. Alternatively, get the public IP address directly from the Cloud-native API Gateway console.

  2. Test the service by accessing <endpoint>/version in a browser or with curl.

    curl http://<endpoint>/version

What's next

To learn more about APIG Ingress features and how it works, see Manage APIG Ingresses.