Skip to content

Checking your reading list…

Retry verification

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Why Tencent Cloud Ingress Defaults to ImplementationSpecific and How It Differs from Huawei Cloud
Cloud Native 5 min read

Why Tencent Cloud Ingress Defaults to ImplementationSpecific and How It Differs from Huawei Cloud

This article compares Tencent Cloud and Huawei Cloud ingress implementations, explaining why Tencent defaults to the ImplementationSpecific path rule, how each provider supports Exact, Prefix, and Regex matching, and provides Go code for handling CCE-specific annotations.

Path Matching Rules

Official Kubernetes supports three path matching types, but cloud providers often add regex support via custom ingress controllers.

Tencent Cloud Ingress

Tencent Cloud TKE offers two ingress types: Application CLB and Nginx Ingress Controller. Both create ingress objects with the path matching field set to ImplementationSpecific.

Nginx Ingress

Tencent's Nginx ingress is based on the native Nginx ingress controller. It supports Exact and Prefix types, and can use annotation+ImplementationSpecific to specify regex matching.

When created via the console, the default rule is ImplementationSpecific, which, according to documentation, behaves like a prefix match that also accommodates more characters.

Testing shows that the default rule effectively performs prefix matching.

Application CLB

According to Tencent documentation, Application CLB allows different path matching rules based on specific characters in the path. Paths starting with “/” use longest‑prefix matching, preferring exact matches before fuzzy matches.

Huawei Cloud CCE Ingress

CCE ingress supports Prefix, Exact, and Regex matching. The matching mode is indicated by a property field in the ingress spec, which does not exist in the community ingress.

When creating ingress via client‑go, an annotation is added to specify this property; the console‑created ingress lacks the annotation.

Example Go code for converting CCE ingress properties:

type ccePathType struct {
    Host      string `json:"host"`
    Path      string `json:"path"`
    MatchMode string `json:"matchmode"`
}
var ingressProperty []ccePathType
for i := range ingress.Spec.Rules {
    if ingress.Spec.Rules[i].HTTP != nil {
        for j := range ingress.Spec.Rules[i].HTTP.Paths {
            ingressProperty = append(ingressProperty, ccePathType{
                Host:      ingress.Spec.Rules[i].Host,
                Path:      ingress.Spec.Rules[i].HTTP.Paths[j].Path,
                MatchMode: matchModeMap[string(*ingress.Spec.Rules[i].HTTP.Paths[j].PathType)],
            })
            ingress.Spec.Rules[i].HTTP.Paths[j].PathType = (*networkingv1.PathType)(&implementationSpecificPathType)
        }
    }
}
cceIngressPropertyValue, err := json.Marshal(ingressProperty)
if err != nil {
    return err
}
meta.SetAnnotation(ingress, "kubernetes.io/ingress.property", string(cceIngressPropertyValue))

Source: https://juejin.cn/post/7312724126242013223 (© original author).

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

Report an issue with this article
Cloud NativeKubernetesTencent CloudHuawei CloudPath Matching

Reader feedback

Was this useful?

Useful0

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion