Логотип Huawei Cloud Cce Kubernetes Event Analyzer

Huawei Cloud Cce Kubernetes Event Analyzer

Организация
huaweicloud
huawei-cloud-cce-kubernetes-event-analyzer

Query and analyze Kubernetes Events in Huawei Cloud CCE clusters. Trigger when users ask about CCE events, Kubernetes warning events, FailedScheduling, FailedMount, ImagePullBackOff, event patterns, historical events in LTS, or event-based diagnosis for a CCE cluster or namespace.

Обзор

Издательhuaweicloud
Репозиторийhuaweicloud-skills
Название навыкаhuawei-cloud-cce-kubernetes-event-analyzer
Звёзды
59
Форки
24
Файлы в комплекте
17
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 17

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — huaweicloud. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Huawei Cloud Cce Kubernetes Event Analyzer в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/huaweicloud/huaweicloud-skills/tree/master/skills/container/cce/huawei-cloud-cce-kubernetes-event-analyzer
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/huaweicloud/huaweicloud-skills.git /tmp/huaweicloud-skills
mkdir -p .claude/skills
cp -r /tmp/huaweicloud-skills/skills/container/cce/huawei-cloud-cce-kubernetes-event-analyzer .claude/skills/huawei-cloud-cce-kubernetes-event-analyzer
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Huawei Cloud Cce Kubernetes Event Analyzer в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Huawei Cloud Cce Kubernetes Event Analyzer, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Huawei Cloud Cce Kubernetes Event Analyzer не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Huawei Cloud CCE Kubernetes Event Analyzer

Overview

Query and analyze Kubernetes Events in Huawei Cloud CCE clusters to identify warnings, repeated failure patterns, affected resources, and useful diagnosis handoffs. The skill supports a current Event view through kubectl and a historical Event view through LTS.

Architecture: python3 scripts/huawei-cloud.py dispatcher -> kubectl through external kubeconfig or kubectl cce for current Events / kubectl cce LogConfig discovery plus hcloud LTS ListLogs for historical Events -> filtering and grouping -> diagnosis handoff.

Execution Method: Invoke only the bundled dispatcher. Do not query Kubernetes Events with raw Python Kubernetes SDK calls, direct Kubernetes API calls, or ad hoc cloud commands. The huawei_get_cce_events implementation invokes kubectl internally: external kubeconfig access first, then the kubectl cce plugin fallback.

Related Skills:

  • huawei-cloud-kubectl-cce-installer - Install kubectl and the kubectl-cce plugin required for cluster access
  • huawei-cloud-cce-metric-analyzer - CCE and cloud-resource metrics

Capabilities:

  • Query current Kubernetes Events across a cluster or in a namespace
  • Read Events through external kubectl kubeconfig access or kubectl cce
  • Query historical Event records from LTS within an explicit time window
  • Filter and group Events by type, reason, namespace, resource, and timestamps
  • Check the current status of supported resources referenced by Events
  • Analyze a supplied current or historical Event result locally without another cloud request
  • Identify repeated warning patterns and hand off evidence to diagnosis skills

Typical Use Cases:

  • "List Warning events for this CCE cluster"
  • "Find repeated FailedScheduling events in namespace default"
  • "Query historical ImagePullBackOff events from LTS"
  • "Analyze the top Kubernetes event reasons during an incident"

Prerequisites

1. Runtime Dependencies

  • Python 3.8+ for the dispatcher and result processing
  • hcloud (KooCLI) for cluster lookup and temporary external kubeconfig generation
  • kubectl for current Event reads
  • kubectl-cce when the cluster has no usable external endpoint; see kubectl-cce.md
  • hcloud LTS command support and the Cloud Native Log Collection add-on (log-agent) with a default-event Event-to-LTS LogConfig. huawei_query_k8s_events_from_lts reads logconfigs.logging.openvessel.io through kubectl cce, then invokes hcloud LTS ListLogs using the configured LTS IDs.

2. Credential Configuration

  • External kubeconfig access uses hcloud credential priority: explicit tool parameters > local hcloud profile > environment variables.
  • The kubectl cce fallback requires AK/SK and the target cluster's project_id from explicit tool parameters or environment variables; encrypted hcloud profile credentials cannot be reused by the plugin. When project_id is available, the implementation passes it explicitly as kubectl cce --project-id <project-id>.
  • LTS queries require valid Huawei Cloud credentials and an authorized project.

Security Rules:

  • Never print, persist, or hardcode AK/SK, security tokens, kubeconfig content, or temporary client credentials.
  • Never use echo $HUAWEI_AK or echo $HUAWEI_SK to inspect credentials.
  • Prefer a local hcloud profile for external kubeconfig access.
  • Use least-privilege IAM identities and read-only Kubernetes RBAC permissions.

Optional Environment Fallback:

bash
export HUAWEI_AK=<your-ak>
export HUAWEI_SK=<your-sk>
export HUAWEI_REGION=cn-north-4
export HUAWEI_PROJECT_ID=<project-id>
export HUAWEI_SECURITY_TOKEN=<security-token>

3. IAM Permission Requirements

PermissionPurpose
cce:cluster:getInspect cluster external endpoint availability
cce:cluster:createCertGenerate temporary kubeconfig for external kubectl access
lts:logs:searchQuery historical Event records in LTS

The effective Kubernetes identity also needs read-only get and list permission for Events in the target namespace or cluster.

Permission Failure Handling:

  1. Report the failed operation and required permission.
  2. Ask the user to grant the missing IAM or Kubernetes RBAC permission.
  3. Do not retry until the user confirms the permission is ready.

Core Commands

All commands use the bundled dispatcher:

bash
python3 scripts/huawei-cloud.py <tool-name> key=value key=value

KooCLI Command Format Standard

Users invoke the dispatcher rather than raw hcloud commands. For current Event queries, the dispatcher internally uses hcloud only to inspect the CCE cluster and generate a temporary external kubeconfig when appropriate.

bash
python3 scripts/huawei-cloud.py huawei_get_cce_events \
  region=cn-north-4 cluster_id=<cluster-id>

Follow these rules:

  • Use key=value parameters and quote values containing spaces or special shell characters.
  • Do not print or persist credentials, security tokens, or temporary kubeconfig files.
  • Use exact cluster_id values for cluster-scoped queries.
  • Keep LTS queries time-bounded with both start_time and end_time.

1. Current Kubernetes Events

bash
# Query Warning Events (default)
python3 scripts/huawei-cloud.py huawei_get_cce_events \
  region=cn-north-4 cluster_id=<cluster-id>

# Query Events in a namespace
python3 scripts/huawei-cloud.py huawei_get_cce_events \
  region=cn-north-4 cluster_id=<cluster-id> namespace=default

# Limit returned Event records
python3 scripts/huawei-cloud.py huawei_get_cce_events \
  region=cn-north-4 cluster_id=<cluster-id> limit=100

# Query all Event types only when explicitly needed
python3 scripts/huawei-cloud.py huawei_get_cce_events \
  region=cn-north-4 cluster_id=<cluster-id> event_type=all limit=100

The tool returns only Warning Events by default, using the Kubernetes API server-side field selector. It first uses the external endpoint with a temporary kubeconfig; it then falls back to kubectl cce. For large clusters, full Event history can be substantial; query all types only after the user explicitly requests it with event_type=all.

2. Historical Events From LTS

bash
# Query an explicit historical 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 an LTS 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 is UTC YYYY-MM-DD HH:MM:SS; the tool always interprets input values as UTC, not the local time zone of the host. The cluster must have the Cloud Native Log Collection add-on (log-agent) installed and healthy with the default-event Event-to-LTS LogConfig. The tool uses kubectl cce --cluster-id <cluster-id> --region <region> get logconfigs.logging.openvessel.io -A -o json, selects default-event, and reads outputDetail.LTS.ltsGroupID and ltsStreamID. LTS queries default to event_type=Warning, using Warning as a server-side keyword filter. For large clusters, request full Event history only after user confirmation with event_type=all; this removes the type keyword filter. LTS filtering is keyword matching, not a structured-field selector.

3. Query and Analyze Event Results

Without events, the tool queries and analyzes current cluster Events by default. For historical requests spanning more than one hour, use LTS with a bounded time window. Providing start_time or end_time automatically selects LTS; event_source=lts may also be set explicitly. Passing an events array (or a complete response object containing it) retains offline analysis behavior.

bash
# Query and analyze current Events
python3 scripts/huawei-cloud.py huawei_analyze_cce_events \
  region=cn-north-4 cluster_id=<cluster-id>

# Query and analyze historical LTS Events
python3 scripts/huawei-cloud.py huawei_analyze_cce_events \
  region=cn-north-4 cluster_id=<cluster-id> event_source=lts \
  start_time="2026-05-30 06:00:00" end_time="2026-05-30 08:00:00"

# Analyze supplied Events without a cloud query
python3 scripts/huawei-cloud.py huawei_analyze_cce_events \
  events='[{"type":"Warning","reason":"FailedScheduling","namespace":"default","count":3}]' \
  max_groups=10

Risk Levels

This skill is read-only. It never changes cloud resources, Kubernetes resources, LTS configuration, or local cluster access configuration.

LevelMeaningExecution Guidance
R3Read-only Event query or local Event analysisMay run automatically
ToolOperation TypeRisk LevelDescription
huawei_get_cce_eventsQueryR3Query current cluster or namespace Events through kubectl
huawei_query_k8s_events_from_ltsQueryR3Query historical Event records from configured LTS collection
huawei_analyze_cce_eventsQuery and analyzeR3Query current or LTS Events when needed, then aggregate by type, reason, namespace, and resource

Parameter Reference

Common Parameters

ParameterRequired/OptionalDescriptionDefault
regionRequiredHuawei Cloud regionHUAWEI_REGION
cluster_idRequiredExact CCE cluster IDN/A
akOptionalExplicit AK for access paths that support itprofile/environment fallback
skOptionalExplicit SK for access paths that support itprofile/environment fallback
project_idRequired for kubectl cce; optional otherwiseTarget cluster's Huawei Cloud project IDhcloud profile/IAM/environment fallback for external kubeconfig access

Current Event Query Parameters

ToolRequiredOptional
huawei_get_cce_eventsregion, cluster_idnamespace, event_type (Warning default, Normal, or all), limit, ak, sk, project_id (required for kubectl cce), security_token

Historical Event Query Parameters

ToolRequiredOptional
huawei_query_k8s_events_from_ltsregion, cluster_id, start_time, end_time, project_idevent_type (Warning default, Normal, or all), keywords (requires event_type=all), ak, sk

Event Analysis Parameters

ToolRequiredOptional
huawei_analyze_cce_eventsEither events, or region + cluster_idevent_source (current default or lts), start_time/end_time (required for lts), namespace, event_type, keywords, limit, max_groups (1-100, default 10), check_resource_status (default true when region and cluster_id are present), ak, sk, project_id, security_token

Output Format

All public response fields, Event record fields, and resource-status states are defined in output-schema.md. That reference is the single source of truth for output contracts.

Workflow

  1. Identify region, exact cluster_id, optional namespace, and incident time window.
  2. Use huawei_get_cce_events for current Event inspection.
  3. Use huawei_query_k8s_events_from_lts for historical Event windows longer than one hour, or when a precise LTS time range or keyword filtering is required.
  4. Pass the returned events to huawei_analyze_cce_events to aggregate reasons, namespaces, resources, and repeated patterns.
  5. Hand off evidence to the relevant Pod, Workload, Node, Storage, or Network diagnosis skill.

See workflow.md for pattern recognition and time-window analysis guidance.

Verification

Run a current Event query first:

bash
python3 scripts/huawei-cloud.py huawei_get_cce_events \
  region=cn-north-4 cluster_id=<cluster-id> limit=10

When default Event-to-LTS collection is enabled, verify a bounded historical query:

bash
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 07:00:00"

Verify that the current Event response includes access_method, and that the LTS response identifies the default LTS group and stream. Do not create or change logging configuration as part of verification.

Best Practices

  1. Start with warnings - filter type == "Warning" before detailed inspection.
  2. Group by reason - repeated reasons reveal systemic issues faster than individual records.
  3. Use exact cluster IDs - do not infer a cluster from its name.
  4. Keep LTS windows bounded - use the smallest incident window that answers the question.
  5. Use LTS for history - current Kubernetes Events have limited retention.
  6. Hand off rather than remediate - this skill provides evidence only.

Notes

  • No active warning does not prove a cluster is healthy; inspect historical LTS Events for recent or recovered incidents when available.
  • The Event-to-LTS path depends on a healthy log-agent add-on with default Event collection enabled.
  • Event summaries should redact sensitive production workload, Pod, and node identifiers where the audience does not need them.
  • Do not modify Kubernetes, CCE logging, LTS, or cloud resources through this skill.

Troubleshooting

SymptomLikely CauseAction
External kubeconfig access failsNo external endpoint, invalid profile, or missing CCE permissionVerify cce:cluster:get and cce:cluster:createCert; the tool then tries kubectl cce
kubectl cce fallback failsPlugin missing or plugin credentials unavailableInstall/configure the plugin using kubectl-cce.md
LTS query finds no default Event streamDefault Event collection is not enabled or has not finished provisioningEnable default Event collection through the log-agent add-on, then retry
LTS query returns no recordsTime window, keywords, retention, or event collection does not matchNarrow or correct the window and verify the default LTS group and stream
Too many current EventsBroad cluster queryWarning is the default; provide namespace and a lower limit to further reduce data at the source
Permission deniedMissing IAM or Kubernetes RBAC permissionGrant the reported least-privilege permission, then retry

Limitations

  • The skill provides only the two documented read-only Event tools.
  • Current Event queries support only namespace and Event type (Warning, Normal, or all) server-side selection.
  • Historical queries require default Event-to-LTS collection enabled before the incident; the skill cannot recover uncollected history.
  • The skill cannot create, modify, or delete LTS streams, Kubernetes resources, or CCE resources.
  • The skill does not automatically select a cluster, namespace, event filter, or diagnosis/remediation action for the user.

References

DocumentUse
WorkflowEvent query sequence, grouping, patterns, and time-window analysis
Risk RulesRead-only boundaries, redaction, and handoff constraints
Output SchemaQuery, analysis, and Event record fields
kubectl-ccekubectl-cce installation, credentials, and access fallback
Acceptance CriteriaExpected outcomes for current, historical, and combined query-and-analysis flows

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Huawei Cloud Cce Kubernetes Event Analyzer?

Query and analyze Kubernetes Events in Huawei Cloud CCE clusters. Trigger when users ask about CCE events, Kubernetes warning events, FailedScheduling, FailedMount, ImagePullBackOff, event patterns, historical events in LTS, or event-based diagnosis for a CCE cluster or namespace.

Зачем использовать Huawei Cloud Cce Kubernetes Event Analyzer в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Huawei Cloud Cce Kubernetes Event Analyzer — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Huawei Cloud Cce Kubernetes Event Analyzer в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/huaweicloud/huaweicloud-skills/tree/master/skills/container/cce/huawei-cloud-cce-kubernetes-event-analyzer. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Huawei Cloud Cce Kubernetes Event Analyzer?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Huawei Cloud Cce Kubernetes Event Analyzer?

С любым количеством. В TypingMind вы можете использовать Huawei Cloud Cce Kubernetes Event Analyzer с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Huawei Cloud Cce Kubernetes Event Analyzer?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — huaweicloud. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇