Creates an ingress.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only common request headers. For more information, see the topic about common request parameters.

Request syntax

POST /pop/v5/k8s/acs/k8s_ingress HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
ClusterId String Query Yes 5b2b4ab4-efbc-4a81-9c45-xxxxxxxxxxxxx

The ID of the Kubernetes cluster.

Name String Query Yes my-ingress-rule

The name of the ingress. The name can contain lowercase letters, digits, and hyphens (-). It must start with a lowercase letter but cannot end with a hyphen (-). The name can be up to 63 characters in length.

Namespace String Query Yes default

The Kubernetes namespace of the cluster.

IngressConf Json Query No {"rules":[{"host":"abc.com","secretName":"tls-secret","paths":[{"path":"/path","backend":{"servicePort":80,"serviceName":"xxx"}}]}]}

The routing rules of the ingress. Set the value to a JSON string in the following format:


{
  "rules": [
    {
      "host": "abc.com",
      "secretName": "tls-secret",
      "paths": [
        {
          "path": "/path",
          "backend": {
            "servicePort": 80,
            "serviceName": "xxx"
          }
        }
      ]
    }
  ]
}
                                

Parameter description:

  • rules: the list of routing rules.
  • host: the domain name to be accessed.
  • secretName: the name of the secret that stores the information about the Transport Layer Security (TLS) certificate. The certificate is required if you need to use the HTTPS protocol.
  • paths: the list of paths to be accessed.
  • path: the path to be accessed.
  • backend: the configuration of the backend service. You can specify a service that is created in the Enterprise Distributed Application Service (EDAS) console.
  • serviceName: the name of the backend service.
  • servicePort: the port of the backend service.

Response parameters

Parameter Type Example Description
Code Integer 200

The HTTP status code.

Message String success

The returned message.

Examples

Sample requests

POST /pop/v5/k8s/acs/k8s_ingress HTTP/1.1
Common request headers
{
"ClusterId": "5b2b4ab4-efbc-4a81-9c45-xxxxxxxxxxxxx",
"Name": "my-ingress-rule",
"Namespace": "default"
}

Sample success responses

XML format

<Message>success</Message>
<Code>200</Code>

JSON format

{
    "Message": "success",
    "Code": 200
}

Error codes

HTTP status code Error code Error message Description
500 Edas.errorcode.PermissionDenied.message You are not authorized to perform the operation. The error message returned because you are not authorized to perform the operation.

For a list of error codes, visit the API Error Center.