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).
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
