Analyze Kubernetes events in Huawei Cloud CCE clusters to find warning events, anomalies, and failure patterns. Queries events via K8s API or LTS log streams, applies client-side filtering, groups patterns, and hands off to diagnosis skills for remediation.
Architecture: MCP Tool → CCE K8s API / LTS Log Streams → Events → Client-side Filter & Group → Pattern Summary → Diagnosis Handoff
Standard workflow:
text
1. Identify region, cluster_id, and optional namespace from user query
2. Fetch events using huawei_get_cce_events (K8s API) or huawei_query_k8s_events_from_lts (LTS)
3. Apply client-side filters (type, reason, involved_object, time window)
4. Group and aggregate by reason, namespace, or pattern
5. Summarize top reasons, repeated patterns, and affected resources
6. Hand off to diagnosis skill if specific failures identified
Related Skills (handoff targets):
huawei-cloud-cce-pod-failure-diagnoserhuawei-cloud-cce-workload-failure-diagnoserhuawei-cloud-cce-node-failure-diagnoserhuawei-cloud-cce-storage-failure-diagnoserhuawei-cloud-cce-network-failure-diagnoserhuawei-cloud-cce-auto-remediation-runnerhuaweicloudsdkcce, huaweicloudsdkcore, kubernetes packagesValid Huawei Cloud credentials (AK/SK mode)
Security Rules:
echo $HUAWEI_AK or echo $HUAWEI_SK to check credentialsHUAWEI_AK, HUAWEI_SK, HUAWEI_REGIONConfiguration Method (Environment Variables Only):
bash
export HUAWEI_AK=<your-ak>
export HUAWEI_SK=<your-sk>
export HUAWEI_REGION=cn-north-4
⚠️ Important Security Notes:
API ActionPermissionPurposecce:cluster:getGet clusterView CCE cluster detailscce:cluster:createCertCreate certificateObtain kubeconfig for kubectl accesscce:node:listList nodesQuery CCE cluster nodeslte:logStream:listList LTS log streamsDiscover LTS log streams for event querieslte:logs:searchSearch LTS logsQuery K8s events from LTS log streams
Permission Failure Handling:
This skill is strictly read-only. It only queries Kubernetes events and lists related resources. No modifications are made to the cluster.
huawei-cloud-cce-auto-remediation-runner with the evidence summarizedToolPurposeRequired ParametersOptional Parametershuawei_get_cce_eventsQuery CCE Kubernetes events via K8s API Serverregion, cluster_id``namespace, limit``huawei_query_k8s_events_from_ltsQuery K8s events from LTS log streams (Event→LTS LogConfig required)region, cluster_id, start_time, end_time``keywords
User IntentReference DocumentFull event query workflow (5-step)references/workflow.mdEvent pattern recognition tablereferences/workflow.mdTime-window analysis guidancereferences/workflow.mdRisk constraints & guardrailsreferences/risk-rules.mdOutput schema (query & analysis)references/output-schema.md
Fetches raw Kubernetes events from the cluster API Server. All filtering beyond namespace and limit is done client-side after fetching.
bash
# Query all events in a cluster
python3 scripts/huawei-cloud.py huawei_get_cce_events \
region=cn-north-4 \
cluster_id=<cluster-id>
# Query events in a specific namespace
python3 scripts/huawei-cloud.py huawei_get_cce_events \
region=cn-north-4 \
cluster_id=<cluster-id> \
namespace=default
# Limit event count
python3 scripts/huawei-cloud.py huawei_get_cce_events \
region=cn-north-4 \
cluster_id=<cluster-id> \
limit=100
Supported API filters: namespace, limit (default 500)
Unsupported filters (apply client-side): event_type, reason, involved_object_kind, involved_object_name, hours, start_time, end_time
Queries K8s events collected to LTS via Event→LTS LogConfig. Requires a LogConfig with event collection enabled and pointing to LTS output.
bash
# Query events from LTS in a time window
python3 scripts/huawei-cloud.py huawei_query_k8s_events_from_lts \
region=cn-north-4 \
cluster_id=<cluster-id> \
start_time="2026-05-30 06:00:00" \
end_time="2026-05-30 08:00:00"
# Query with keyword filter
python3 scripts/huawei-cloud.py huawei_query_k8s_events_from_lts \
region=cn-north-4 \
cluster_id=<cluster-id> \
start_time="2026-05-30 00:00:00" \
end_time="2026-05-30 23:59:59" \
keywords=FailedScheduling
LTS time format: YYYY-MM-DD HH:MM:SS
Fallback: If no Event→LTS LogConfig is found with events enabled, returns an error. Use huawei_get_cce_events instead.
After fetching events, apply filters based on user needs:
type == "Warning" — warning events onlyreason — specific patterns (FailedScheduling, ImagePullBackOff, FailedMount, etc.)involved_object.kind + involved_object.name — specific resourcesnamespace — namespace-specific analysisfirst_timestamp / last_timestamp — time-window analysisreason to find top event patternsnamespace to find high-noise namespacescount > 1 as repeated patternswarning_count vs normal_count for quick health signalSummarize findings with counts, timestamps, and affected objects. If events point to specific failures, hand off to the appropriate diagnosis skill with evidence.
ParameterRequired/OptionalDescriptionDefaultregionRequiredHuawei Cloud regionHUAWEI_REGION``cluster_idRequiredCCE cluster IDN/AnamespaceOptionalKubernetes namespace filterN/A (all namespaces)akOptionalOverride AKHUAWEI_AK``skOptionalOverride SKHUAWEI_SK``project_idOptionalProject IDAuto from IAM
huawei_get_cce_events Parameters#ParameterRequiredDescriptionDefaultregionYesHuawei Cloud regionHUAWEI_REGION``cluster_idYesCCE cluster IDN/AnamespaceNoKubernetes namespace filterN/A (all namespaces)limitNoMaximum number of events to return500
huawei_query_k8s_events_from_lts Parameters#ParameterRequiredDescriptionDefaultregionYesHuawei Cloud regionHUAWEI_REGION``cluster_idYesCCE cluster IDN/Astart_timeYesQuery start time (YYYY-MM-DD HH:MM:SS)N/Aend_timeYesQuery end time (YYYY-MM-DD HH:MM:SS)N/AkeywordsNoKeyword filter for LTS searchN/A
PatternLikely CauseHandoff TargetImagePullBackOff repeatedWrong image or pull secret missinghuawei-cloud-cce-pod-failure-diagnoser``FailedScheduling + insufficientResource pressure or node not readyhuawei-cloud-cce-workload-failure-diagnoser``FailedMountVolume attach or PVC issuehuawei-cloud-cce-storage-failure-diagnoser``Evicted podsBudget disruption or node pressurehuawei-cloud-cce-pod-failure-diagnoser``NodeNotReadyNode agent or network issuehuawei-cloud-cce-node-failure-diagnoser``Unhealthy + Readiness probeApplication issue or startup failurehuawei-cloud-cce-pod-failure-diagnoser``FailedCreatePodSandBoxCNI or network issuehuawei-cloud-cce-network-failure-diagnoser``OOMKilledMemory limit exceededhuawei-cloud-cce-pod-failure-diagnoser
FieldDescriptionregionHuawei Cloud regioncluster_idCCE cluster IDnamespaceKubernetes namespace filter (if applied)total_fetchedNumber of events returned by the APIeventsRaw event list (apply filters client-side)warning_countNumber of Warning events (calculated)top_reasonsTop event reasons with counts (calculated)repeated_patternsEvents with count > 1 grouped by reasonnamespace_breakdownEvent counts by namespacenext_stepsSuggested follow-up query or diagnosis skill
FieldDescriptionregionHuawei Cloud regioncluster_idCCE cluster IDlog_group_idLTS log group IDlog_stream_idLTS log stream IDkeywordsKeywords used for filteringevent_countNumber of events returnedeventsParsed event list with normalized structuretime_rangeStart/end time of the querylog_configLogConfig info (name, events enabled, etc.)
huawei_get_cce_events for quick queries; fall back to LTS only when time-range precision is neededtype == "Warning" before deep analysisPitfallSymptomQuick FixMissing cluster_idAction fails immediatelyProvide cluster_id from huawei_get_cce_clustersNo Event→LTS LogConfig configuredLTS query returns errorUse huawei_get_cce_events (K8s API) insteadUnbounded time queryOverwhelming results, slow responseAlways provide start_time/ end_time or limit scope to 1-24 hoursLTS time format mismatchLTS query fails or returns no resultsUse exact format YYYY-MM-DD HH:MM:SS for start_time and end_timeLarge namespace scan with no filterToo many events, hard to analyzeNarrow with namespace or client-side filters ( type, reason)Permission denied on kubeconfigCannot access clusterVerify cce:cluster:createCert IAM permissionLTS permission deniedCannot query LTS log streamsVerify lte:logStream:list and lte:logs:search IAM permissionsIgnoring count > 1 eventsMissing systemic patternsAlways group by reason and flag repeated events first
scripts/huawei-cloud.py) is the only execution method — do not use hcloud CLI or direct API calls for event querieshuawei-cloud-cce-auto-remediation-runner with evidence summarized — this skill never executes recovery actionsDocumentDescriptionworkflow.mdFull event query workflow, pattern recognition, time-window analysis, aggregation guidance, LTS vs K8s API selection guiderisk-rules.mdRead-only constraints, data redaction rules, handoff policies, guardrailsoutput-schema.mdEvent query summary, analysis summary, and per-event detail schema