Tüm Ürünler
Search
Belge Merkezi

Container Service for Kubernetes:Expose services with an APIG Ingress

Son Güncelleme:Oct 12, 2026

Küme içi hizmetleri Cloud-native API Gateway üzerinden kullanıma açmak için APIG Ingress'i kullanın.

Önemli

Güvenlik nedeniyle, APIG Ingress kube-system ad alanındaki hizmetlerin kullanıma açılmasına izin vermez.

Ön koşullar

APIG Controller'ı yükleyin

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

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

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

  4. On the Add-ons page, search for APIG and click Install on the APIG Controller card.

  5. In the Install APIG Controller dialog box, configure the parameters and click OK.

    • Create:

      Automatically creates a pay-as-you-go Cloud-native API Gateway instance with the apig.small.x1 specification.

      Önemli
      • When you select Create, an ApigConfig resource and a Cloud-native API Gateway instance are automatically created. Deleting the ApigConfig resource also deletes the associated gateway instance. Do not delete the ApigConfig resource.

      • If an IngressClass named apig already exists in the cluster, the add-on does not create an ApigConfig resource or a gateway instance.

    • 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 bound to another cluster. If the instance that you want to use does not appear in the list, check whether it is already bound to another cluster. Instances that are already bound do not appear in the list. In this case, select Create to create a new Cloud-native API Gateway instance.

    If a Failed to pass the precheck. error occurs during installation, grant the required permissions to the APIG Controller .
  6. After installation, an ApigConfig resource named apig-controller-pro-{clusterid} is created in the cluster. In the Cloud-native API Gateway console, a gateway instance named apig-controller-pro-{clusterid} appears in the corresponding region.

Örnek bir uygulama oluşturun

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

  2. On the Deployments page, click Create from YAML. Use the following YAML to deploy a Deployment named httpbin and a Service named httpbin.

    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
      type: ClusterIP
  3. Click View and verify the pod status is Running.

APIG Ingress'i yapılandırın

  1. In the navigation pane on the left, choose Ingresses > Ingresses. On the Ingresses page, click Create Ingress.

  2. In the Create Ingress dialog box, set Gateway Type to APIG Ingress, Ingresses to Prefix Match, and Path to / to forward requests to the httpbin service, and click OK.

  3. On the Ingresses page, find the Ingress endpoint in the Endpoint column. Access endpoint/version or gateway public IP/version from a browser or CLI. A response of version: v1 confirms the Ingress works.

  4. Log on to the Cloud-native API Gateway konsolu. In the corresponding gateway instance, find an API whose name contains {gwid}-ingress.

İlgili bilgiler

APIG Ingress'i yönetin