All Products
Search
Document Center

Container Service for Kubernetes:Configure an MseIngressConfig

Last Updated:Mar 26, 2026

MseIngressConfig is a CustomResourceDefinition (CRD) provided by Microservices Engine (MSE) Ingress Controller. It lets you manage the full lifecycle of an MSE cloud-native gateway—creating, reusing, or deleting a gateway—and configure global settings such as IP access control, TLS hardware acceleration, access logging, and distributed tracing, all without restarting the controller.

How it works

MSE Ingress Controller watches MseIngressConfig resources in your cluster and dynamically maintains the corresponding cloud-native gateway. After the gateway is associated with your cluster's API server, its control plane syncs Ingress resource changes and updates routing rules in real time. When the gateway receives a request, it matches the request against Ingress routing rules and forwards traffic to the appropriate backend pod.

The following diagram shows the relationship between the components.

ingress的应用场景

The key components are:

  • Service: An abstraction of backend services. A service represents a group of replicated pods.

  • Ingress: Contains reverse proxy rules that route HTTP or HTTPS requests to services based on hostnames and paths.

  • IngressClass: Declares which Ingress controller implementation handles a set of Ingress resources. Associate an IngressClass with an MseIngressConfig to activate the MSE cloud-native gateway for those Ingress resources.

  • MseIngressConfig: The CRD that provides gateway configuration—instance specs, network settings, global policies, and Ingress listening scope.

  • MSE Ingress Controller: The control plane that watches MseIngressConfig resources and coordinates the cloud-native gateway. It does not act as a network data plane.

One MseIngressConfig maps to exactly one MSE cloud-native gateway. To run multiple gateways, create multiple MseIngressConfigs.

MseIngressConfig reference

Full configuration example

apiVersion: mse.alibabacloud.com/v1alpha1
kind: MseIngressConfig
metadata:
  name: test
spec:
  name: mse-ingress
  common:
    pay:
      payType: POSTPAY
    instance:
      spec: 4c8g
      replicas: 3
    network:
      vSwitches:
      - "vsw-1"
      - "vsw-2"
      publicSLBSpec: slb.s2.small
    securityGroupType: normal
  global:
    tls:
      enableHardwareAcceleration: true
    ipAccessControl:
      whitelist:
      - 1.1.XX.XX
      - 2.2.XX.XX
  monitor:
    logging:
      sls:
        reuseProject: "xxx"   # Leave blank to use the default project
    tracing:
      xTrace:
        sampleRate: "100"
  ingress:
    local:
      ingressClass: mse
      watchNamespace: ""      # Leave blank to listen to all namespaces

Parameters

ParameterDescriptionRequiredDefault
nameName of the gatewayNomse-ingress
common.pay.payTypeBilling method. Only POSTPAY (pay-as-you-go) is supported.NoPOSTPAY
common.instance.specGateway instance size. Valid values: 2c4g, 4c8g, 8c16g, 16c32gNo4c8g
common.instance.replicasNumber of gateway replicas. Valid values: 0–30No3
common.network.vSwitchesPrimary and secondary vSwitches. Specify at least one and at most two. If not set, the vSwitch on the node running the MSE Ingress Controller pod is used.NoNone
common.network.publicSLBSpecSpecifications for the Internet-facing Server Load Balancer (SLB) instance. Valid values: slb.s1.small, slb.s2.small, slb.s2.medium, slb.s3.small, slb.s3.medium, slb.s3.largeNoslb.s2.small
common.network.privateSLBSpecSpecifications for the internal-facing SLB instance. Same valid values as publicSLBSpec.Noslb.s2.small
common.securityGroupTypeSecurity group type. Valid values: enterprise (advanced), normal (basic)Nonormal
global.tls.enableHardwareAccelerationEnable Transport Layer Security (TLS) hardware acceleration to improve HTTPS processing performance.Notrue
global.ipAccessControl.whitelistGlobal IP address whitelist. Accepts individual IPs and CIDR blocks.NoNot configured
global.ipAccessControl.blacklistGlobal IP address blacklist. Accepts individual IPs and CIDR blocks.NoNot configured
monitor.logging.slsActivate Simple Log Service (SLS) access logging. Grant SLS permissions to MSE Ingress Controller before enabling.NoDisabled
monitor.logging.sls.reuseProjectSLS project for access logs. Leave blank to use the default project; specify a project name to use an existing project.NoBlank (default project)
monitor.tracing.xTraceEnable xTrace tracing analysis. Cannot be enabled together with openTelemetry.NoDisabled
monitor.tracing.xTrace.sampleRateSampling rate for xTrace, as a string percentage. For example, "100" = 100%.No"0"
monitor.tracing.openTelemetryEnable OpenTelemetry tracing analysis. Cannot be enabled together with xTrace.NoDisabled
monitor.tracing.openTelemetry.sampleRateSampling rate for OpenTelemetry, as a string percentage.No"100"
ingress.local.ingressClassIngressClass the gateway listens to. See the table below for valid values.NoNot configured
ingress.local.watchNamespaceNamespace to watch. Leave blank to listen to all namespaces. Only one namespace can be specified.NoBlank (all namespaces)

`ingress.local.ingressClass` valid values:

ValueBehavior
Not configuredNo Ingress resources are listened to.
mseListens to Ingress resources with IngressClass mse.
"" (empty string)Listens to all Ingress resources in the cluster.
nginxListens to Ingress resources with IngressClass nginx, or with no IngressClass.
Any other valueListens to Ingress resources associated with the specified IngressClass.
An IngressClass resource that explicitly references an MseIngressConfig in its spec.parameters takes precedence over the value of ingress.local.ingressClass.

Status

Check the status of an MseIngressConfig:

kubectl get mseingressconfig

Expected output:

NAME   STATUS     MESSAGE
test   Listening

The status progresses in the following order: PendingRunningListening.

StatusDescription
PendingThe cloud-native gateway is being created. Creation takes approximately 3 minutes.
RunningThe gateway is created and running.
ListeningThe gateway is running and listening to Ingress resources in the cluster.
FailedThe gateway is invalid. Check the Message field in the status output for the cause.

Resource tags

MSE cloud-native gateways created or reused by MseIngressConfigs are automatically tagged. View these tags in the basic information section of the MSE console.

Important

Do not edit these tags in the MSE console. Modifying them may disrupt gateway operation.

TagDescription
ack.aliyun.comIdentifies the ACK cluster whose ingress traffic this gateway manages.
ingress.k8s.alibaba/MseIngressConfigIdentifies the MseIngressConfig associated with this gateway.
kubernetes.reused.by.userMarks the gateway as reused. Deleting the associated MseIngressConfig does not delete a tagged gateway.

Create an MSE cloud-native gateway

  1. Apply an MseIngressConfig to create the gateway. The following example creates a gateway named mse-ingress with 3 replicas at the 2c4g specification.

    apiVersion: mse.alibabacloud.com/v1alpha1
    kind: MseIngressConfig
    metadata:
      name: test
    spec:
      name: mse-ingress
      common:
        instance:
          spec: 2c4g
          replicas: 3
  2. Create an IngressClass resource and link it to the MseIngressConfig.

    apiVersion: networking.k8s.io/v1
    kind: IngressClass
    metadata:
      name: mse
    spec:
      controller: mse.alibabacloud.com/ingress
      parameters:
        apiGroup: mse.alibabacloud.com
        kind: MseIngressConfig
        name: test

    After applying both resources, Ingress resources with IngressClass mse are processed by the associated cloud-native gateway.

  3. Verify the gateway is running.

    kubectl get mseingressconfig test

    The status progresses through PendingRunningListening. When the status shows Listening, the gateway is ready.

Reuse an existing MSE cloud-native gateway

To reuse a gateway that already exists, set spec.id to the gateway's ID (in gw-xxx format) and control whether to overwrite its configuration with spec.override.

apiVersion: mse.alibabacloud.com/v1alpha1
kind: MseIngressConfig
metadata:
  name: reuse
spec:
  id: gw-xxxx
  override: false
  ingress:
    local:
      ingressClass: mse

`spec.override` behavior:

spec.override valueEffect on Ingress listening options, TLS acceleration, IP access control, and observabilityEffect on cluster association
falseExisting gateway settings are preserved.If the gateway is not yet associated with the cluster, automatically associates it and configures ingressClass listening. If already associated, original Ingress settings are unchanged.
trueOverwrites gateway settings with the values specified in this MseIngressConfig. If a parameter is omitted from the MseIngressConfig, the original setting is cleared.Associates the gateway with the cluster.
Important

When setting spec.override: true, specify all parameters you want to keep. Parameters omitted from the MseIngressConfig are overwritten and your traffic may be negatively affected.

Delete an MSE cloud-native gateway

Deleting an MseIngressConfig deletes the associated gateway in most cases. The exception is reuse scenarios, where the gateway is preserved.

Run the following command to delete an MseIngressConfig:

kubectl delete mseingressconfig <your-config-name>

Deletion behavior by scenario:

Billing methodGateway created by MSE Ingress ControllerGateway reused from the console
Pay-as-you-goDeleting the MseIngressConfig also deletes the gateway.Deleting the MseIngressConfig retains the gateway.
SubscriptionN/ADeleting the MseIngressConfig retains the gateway.

Configure IP access control

Allow traffic from specific IPs (whitelist)

The following example allows only the IP address 1.1.XX.XX and the CIDR block 2.0.XX.XX/8 to access the gateway.

apiVersion: mse.alibabacloud.com/v1alpha1
kind: MseIngressConfig
metadata:
  name: test
spec:
  name: mse-ingress
  global:
    ipAccessControl:
      whitelist:
      - 1.1.XX.XX
      - 2.0.XX.XX/8

Block traffic from specific IPs (blacklist)

The following example blocks access from the IP address 1.1.XX.XX and the CIDR block 2.0.XX.XX/8.

apiVersion: mse.alibabacloud.com/v1alpha1
kind: MseIngressConfig
metadata:
  name: test
spec:
  name: mse-ingress
  global:
    ipAccessControl:
      blacklist:
      - 1.1.XX.XX
      - 2.0.XX.XX/8

Activate Simple Log Service

Before activating Simple Log Service (SLS), grant SLS permissions to MSE Ingress Controller for your cluster type:

The following example configures the gateway to deliver access logs to an SLS project named demo. To use the default project instead, leave reuseProject blank.

apiVersion: mse.alibabacloud.com/v1alpha1
kind: MseIngressConfig
metadata:
  name: test
spec:
  name: mse-ingress
  monitor:
    logging:
      sls:
        reuseProject: "demo"

Activate Managed Service for OpenTelemetry

Configuring Managed Service for OpenTelemetry enables end-to-end distributed tracing to help diagnose and locate production issues.

The following example sets the sampling rate to 100%.

apiVersion: mse.alibabacloud.com/v1alpha1
kind: MseIngressConfig
metadata:
  name: test
spec:
  name: mse-ingress
  monitor:
    tracing:
      xTrace:
        sampleRate: "100"