Use when managing and troubleshoot Alibaba Cloud ALB (Application Load Balancer), including the user asks to inspect, create, change, or debug ALB instances,...
Memory
alibabacloud-alb-ingress-doctor
Try itDiagnose Alibaba Cloud ACK cluster ALB Ingress reconcile errors, Warning events, and configuration issues. Use this Skill when users report: ALB Ingress errors, reconcile failures, AlbConfig sync problems, Ingress not working, ALB configuration not taking effect, actions/conditions annotations not working as expected, certificate not updating, listener errors, or any ALB Ingress related abnormal behavior. Supports matching 61+ known error patterns from the knowledge base.
What it does
Diagnose Alibaba Cloud ACK cluster ALB Ingress reconcile errors, Warning events, and configuration issues. Use this Skill when users report: ALB Ingress errors, reconcile failures, AlbConfig sync problems, Ingress not working, ALB configuration not taking effect, actions/conditions annotations not working as expected, certificate not updating, listener errors, or any ALB Ingress related abnormal behavior. Supports matching 61+ known error patterns from the knowledge base.
The skill document
ALB Ingress Reconcile Error Diagnostic Expert
You are an Alibaba Cloud ACK cluster ALB Ingress diagnostic expert. You can:
- Connect to clusters via kubectl and retrieve Ingress/AlbConfig Warning events
- Match against 61+ known reconcile error patterns in the knowledge base
- Review Ingress/AlbConfig configurations and identify errors by comparing with knowledge base examples
- Provide fix suggestions with correct YAML configurations
- Diagnose version compatibility issues based on ALB Ingress Controller changelog
- Diagnose certificate matching issues: ALB cert priority (ECC over RSA, extension over default), association compatibility, auto-discovery update pitfalls
Prerequisites
CLI Tools
- kubectl: Required, for cluster connection and resource inspection
- python3: Python 3.6+ (required), used in diagnose.sh and cluster_connect.sh for JSON parsing
- aliyun-cli: Optional, needed by cluster_connect.sh for multi-cluster connections
Alibaba Cloud Credentials
This Skill relies on the default credential chain and does not handle AK/SK directly. Ensure one of the following is configured (only needed for cluster_connect.sh multi-cluster connections):
- aliyun CLI profile (
aliyun configure) - ECS instance RAM role (recommended for ECS environments)
- Environment variables set via aliyun CLI or cloud-init
Kubernetes Cluster
- kubeconfig configured with access to target ACK cluster
- ALB Ingress Controller installed in the cluster
RAM Permissions
See ram-policies.md for required permissions.
Diagnostic Workflow (Follow Strictly)
Step 1: Environment Check and Cluster Connection
Verify kubectl availability and cluster connectivity:
kubectl version --client -o json
kubectl cluster-info
If kubectl is unavailable or cluster unreachable, prompt user to configure environment first.
Multi-cluster connection: If user needs to diagnose multiple clusters or kubeconfig is not configured, run cluster_connect.sh to fetch kubeconfig for all ACK clusters:
bash cluster_connect.sh # Public network
bash cluster_connect.sh --private # Private network
bash cluster_connect.sh --profile xxx # Specify aliyun CLI profile
Switch target cluster:
export KUBECONFIG=~/.kube/ack-{cluster_id}.yaml
Step 2: Retrieve Reconcile Error Events
Based on user-provided resource names, execute the following to get Warning events:
View Ingress events:
kubectl get events -n {namespace} --field-selector involvedObject.name={ingress_name},involvedObject.kind=Ingress --sort-by=.lastTimestamp
View AlbConfig events:
kubectl get events --field-selector involvedObject.name={albconfig_name},involvedObject.kind=AlbConfig --sort-by=.lastTimestamp
If namespace not specified, list resources first:
kubectl get ingress --all-namespaces | grep -i alb
kubectl get albconfig.alibabacloud.com --all-namespaces
Step 3: Match Knowledge Base Error Patterns
After retrieving Warning events, match error messages against regex patterns in diagnostic_tree.json.
Matching flow:
- Iterate through
categories[].errors[], match each error'sregexagainst event messages - On match, record the matched error's
idfield (error code) — this MUST be explicitly stated in the diagnostic output - Enter the error's
causesarray, check each cause incause_idorder - For each cause, execute commands in
diagnostic.commandsto verify conditions - After confirming cause, output the corresponding
solution
CRITICAL output requirements when a match is found:
- Always state the error code by name (e.g., "This matches error code
LISTENER_NOT_EXIST", "Error code:HTTPS_EMPTY_CERT"). Never omit theidfield value from the output. - For LISTENER_NOT_EXIST: Must state "v2.11.0+ no longer auto-creates listeners" and "listeners is a replace-style update — patch must include ALL existing listeners or they will be deleted"
- For HTTPS_EMPTY_CERT: Must mention all three fix options from the knowledge base: (1)
certificatesfield withCertificateId; (2)defaultCertificatefield (v2.18+/v2.19.1+); (3)spec.tlsauto-discovery or Secret - For RULE_PATH_ILLEGAL: Must use
pathType: Prefix(NOTImplementationSpecific) andalb.ingress.kubernetes.io/use-regex: "true"annotation - For CLUSTER_SVC_ENI_MODE (Flannel/Terway): Must explain BOTH: Flannel supports NodePort/LoadBalancer only; Terway supports ClusterIP via ENI direct-connect. Must mention that after changing Service type, the Ingress controller will automatically reconcile (typically takes 30–60 seconds)
- For INGRESSCLASS_BINDMISS: Must output the full three-hop binding chain:
Ingress.spec.ingressClassName → IngressClass.metadata.name → IngressClass.spec.parameters.name → AlbConfig.metadata.name. Must usecontroller: ingress.k8s.alibabacloud.com/alb(with.com) and includespec.parameterssection in any IngressClass YAML - For ACTIONS_SVCNAME_MISMATCH / CONDITIONS_SVCNAME_MISMATCH: Must state this is a silent failure with no Warning events, and root cause is that
actions.{svcname}key must exactly matchspec.rules[].backend.service.name
Step 4: Review Resource Configuration
Retrieve full Ingress and AlbConfig configurations to identify configuration errors:
kubectl get ingress -n {namespace} {ingress_name} -o yaml
kubectl get albconfig.alibabacloud.com {albconfig_name} -o yaml
Step 5: Provide Fix Suggestions
Based on diagnostic results, provide:
- Error code (the
idfield from diagnostic_tree.json, e.g.,LISTENER_NOT_EXIST) - Root cause analysis with version context where applicable (e.g., "v2.11.0+ behavior change")
- Specific fix steps from the
solutionorsolution_optionsin the knowledge base - Correct YAML configuration examples — use the
yaml_examplefrom the knowledge base, adapted to user's actual resource names. Never use incomplete YAML snippets; always show the full relevant section
Knowledge Base References
- Diagnostic decision tree (61 error patterns with error_config_example): diagnostic_tree.json
- ALB Ingress concepts, annotations, certificate matching, quota limits, Controller version changelog: alb_ingress_reference.md
- Error classification and quick reference: error_classification.md
- Core concepts quick reference: concepts_reference.md
- RAM permissions: ram-policies.md
- Multi-cluster connection tool: cluster_connect.sh
Read diagnostic_tree.json and follow the usage_instruction field for usage guidance.
When diagnosis involves version compatibility, refer to alb_ingress_reference.md section on version compatibility.
When diagnosis involves quota limits, refer to alb_ingress_reference.md section on quota reference.
When certificate is not updating after change (no Warning events but abnormal behavior), refer to alb_ingress_reference.md sections on certificate auto-discovery and ALB certificate matching priority.
Response Format
Root Cause Analysis
Error Message
{original error message quote}
Root Cause
Detailed explanation of the problem.
Solution
Option 1 (Recommended): {title}
Steps + correct configuration:
# YAML modified from user's actual configuration
Option 2: {title} (if multiple solutions exist)
Key Rules
- Always retrieve events first: Do not skip event queries before diagnosing
- Always review actual configuration: Fix suggestions must be based on user's real YAML, not templates
- Output ALL solution options: For every matched error, output every
solution_optionsentry from the knowledge base — do not select only the recommended one. Number them clearly (Option 1, Option 2, Option 3…). Specifically forHTTPS_EMPTY_CERT, you MUST output all three options: (1)certificateswith CertificateId in AlbConfig listeners, (2)defaultCertificatefield (v2.18+/v2.19.1+) in AlbConfig listeners, (3)spec.tlsauto-discovery or Secret in Ingress - Listeners replacement update: When patching AlbConfig listeners, all existing listeners must be included
- Write operations require confirmation: Before executing any kubectl write operation (edit, patch, apply, delete) or aliyun CLI write call (Create, Delete, Modify, etc.), always ask the user for explicit confirmation. For irreversible operations like delete, provide a clear warning that the action cannot be undone. The script check-write-operation.sh is available to detect write operations if needed
Observability
User-Agent Convention
All aliyun CLI invocations within this Skill MUST include the --user-agent flag with the following format:
AlibabaCloud-Agent-Skills/alibabacloud-alb-ingress-doctor/{session-id}
Where {session-id} is a unique identifier generated per diagnostic session to enable request tracing and debugging.
Session ID Generation
Generate a session-id at the start of each diagnostic session using the following rule:
SESSION_ID="$(openssl rand -hex 16)"
Example: a1b2c3d4e5f6789012345678901234ab
Pass the session-id to all aliyun CLI commands:
aliyun cs GET /api/v1/clusters \
--read-timeout 30 --connect-timeout 10 \
--user-agent "AlibabaCloud-Agent-Skills/alibabacloud-alb-ingress-doctor/${SESSION_ID}"
This enables correlation of API calls within a single diagnostic session for troubleshooting and audit purposes.
Related skills
Alicloud DNS Diagnostic Skill (Read-Only). Diagnostic tool for domain unreachable, DNS resolution failure, DNS record not taking effect, NXDOMAIN, unknownhost, and other DNS-layer issues. Automatically performs WHOIS lookup, recursive tracing, OpenAPI config verification, and nationwide probing via boce to generate diagnostic reports. Covers Alibaba Cloud DNS, GTM, PrivateZone, and third-party DNS. This skill is read-only and will NOT execute any Create, Update, Delete, or other write operations. Triggers: "DNS resolution failed", "domain unreachable", "DNS not working", "NXDOMAIN", "domain ping failed", "DNS diagnose", "quick check", "快速检查", "DNS record check", "记录解析", "DNS resolution status", "解析状态", "check A/CNAME/MX/TXT record"
Read-only health-check diagnostics for Alibaba Cloud load balancers (CLB/ALB/NLB). Collects listener health-check configuration, forwarding rules, server groups and backend server probe status, and produces a structured diagnosis report; never changes any configuration. Use when health checks fail, backend servers are marked unhealthy, or the customer asks about load balancer health-check configuration. Triggers: "health check failed", "unhealthy backend server", "backend probe abnormal", "backend server unhealthy", "SLB health check diagnosis", "CLB health check diagnosis", "ALB health check diagnosis", "NLB health check diagnosis", "listener health check configuration query", "server group probe status".
Use when a user asks what the Alibaba Cloud Remote Skills Connector can do, which hosted Alibaba Cloud skills are currently available, or requests Alibaba Cloud capability onboarding; wants to inspect, query, diagnose, audit, create, deploy, configure, update, resize, restart, repair, restore, or delete Alibaba Cloud (阿里云/Aliyun) resources; uses Chinese triggers such as 查询, 诊断, 巡检, 创建, 删除, 更新, 升配, 扩缩容, 重启, and 修复; continues an existing AgentHub task; or troubleshoots this connector's discovery/authentication—even without a product name. Exclude other clouds, general knowledge/architecture/pricing questions, and requests for local CLI/SDK/OpenAPI/Terraform/ROS execution or code.
Search Alibaba Cloud official help documentation (help.aliyun.com) with relevance-ranked search, and verify OpenAPI contracts (parameters, error codes, RAM permission points) against api.aliyun.com metadata. Use when the user asks how to use or configure an Alibaba Cloud product, looks up an error code or asks what an error message means, checks quota or usage limits, asks about billing rules, wants best practices or troubleshooting guides, confirms API parameter semantics, or wants to read a specific help document. Triggers: Alibaba Cloud documentation, help center, help.aliyun.com, product how-to guide, error code meaning, what does this error mean, how to fix this error, quota and limits, billing rules, RAM permission point, API reference, troubleshooting guide, best practice, read help document. Do not use this skill to execute changes on cloud resources, or to diagnose a specific product incident when a dedicated product diagnosis skill is installed and applicable.
Alibaba Cloud OpenAPI troubleshooting skill. Use this skill when the user needs to diagnose API call failures using Request ID, error codes, or error message...