{"id":"bd9ffdcb-6743-40e3-8e88-22abb7e44cbc","shortId":"G8hjHH","kind":"skill","title":"tencentcloud-tke","tagline":"Manage Tencent Cloud TKE (Tencent Kubernetes Engine) clusters and\nworkloads. Use when the user asks to: list clusters, check cluster /\nnode health, list pods or services, scale a Deployment, do a rolling\nrestart, fetch kubeconfig, view recent K8s events, manage node pools.\nCombin","description":"# Tencent Cloud TKE (Kubernetes)\n\nManage TKE clusters and the workloads inside them.\n\n> **Setup:** See [tencentcloud authentication](../_shared/tencentcloud.md). Cluster discovery and kubeconfig retrieval go through the SDK; everything inside the cluster (pods, services, scale, restart) goes through `kubectl` against the kubeconfig we fetch.\n\n## CLI (preferred)\n\nThe skill ships [`scripts/tke.py`](scripts/tke.py) — wraps cluster discovery, kubeconfig retrieval, and the most common in-cluster operations.\n\n```bash\nTKE=$SKILL_DIR/scripts/tke.py\n\npython3 $TKE clusters                                              # list clusters\npython3 $TKE cluster cls-xxxxxxxx                                  # one cluster's details\npython3 $TKE nodes cls-xxxxxxxx\npython3 $TKE pools cls-xxxxxxxx                                    # node pools\npython3 $TKE kubeconfig cls-xxxxxxxx --save ~/.kube/config-tke     # write kubeconfig\npython3 $TKE workloads cls-xxxxxxxx -n my-namespace\npython3 $TKE pods cls-xxxxxxxx -n my-namespace\npython3 $TKE events cls-xxxxxxxx -n my-namespace                   # recent events\npython3 $TKE scale cls-xxxxxxxx -n my-namespace --name my-deploy --replicas 4\npython3 $TKE restart cls-xxxxxxxx -n my-namespace --name my-deploy\n```\n\nIn-cluster commands shell out to `kubectl` against an SDK-fetched kubeconfig. `kubectl` must be installed in the sandbox (`pip install` doesn't ship it).\n\n## When to Use\n\n- List TKE clusters across regions\n- Check node health and node-pool resource usage\n- List Deployments / StatefulSets / DaemonSets in a namespace\n- List Services / Pods / recent Events\n- Scale a workload up or down\n- Rolling restart a Deployment (e.g. after a config change)\n- Fetch kubeconfig for ad-hoc `kubectl` work\n\n## Dependencies\n\n```bash\npip install tencentcloud-sdk-python\nbrew install kubectl   # macOS;  apt install kubectl on Debian/Ubuntu\n```\n\n## Quick start — list clusters\n\n```python\nimport os\nfrom tencentcloud.common import credential\nfrom tencentcloud.tke.v20180525 import tke_client, models\n\ncred = credential.EnvironmentVariableCredential().get_credential()\nclient = tke_client.TkeClient(cred, os.environ[\"TENCENTCLOUD_REGION\"])\n\nreq = models.DescribeClustersRequest()\nreq.Limit = 100\nresp = client.DescribeClusters(req)\nfor c in resp.Clusters:\n    print(c.ClusterId, c.ClusterName, c.ClusterStatus, c.ClusterVersion)\n```\n\n> Cluster IDs look like `cls-xxxxxxxx`. The `ap-hongkong` region typically holds the production clusters; `DescribeClusters` is region-scoped — call it per region you care about.\n\n## Workflows\n\n### Get cluster details + worker node count\n\n```python\nreq = models.DescribeClustersRequest()\nreq.ClusterIds = [\"cls-xxxxxxxx\"]\nresp = client.DescribeClusters(req)\nc = resp.Clusters[0]\nprint(c.ClusterName, c.ClusterStatus, c.ClusterNodeNum, c.ClusterVersion)\n```\n\n### List worker nodes (and their CVM instance types)\n\n```python\nreq = models.DescribeClusterInstancesRequest()\nreq.ClusterId = \"cls-xxxxxxxx\"\nreq.Limit = 100\nresp = client.DescribeClusterInstances(req)\nfor i in resp.InstanceSet:\n    print(i.InstanceId, i.InstanceRole, i.InstanceState, i.NodePoolId)\n```\n\n### Fetch kubeconfig\n\n```python\nreq = models.DescribeClusterKubeconfigRequest()\nreq.ClusterId = \"cls-xxxxxxxx\"\nreq.IsExtranet = True            # False for VPC-internal kubeconfig\nresp = client.DescribeClusterKubeconfig(req)\n\n# Save and use immediately\nimport os, pathlib\nkubeconfig = pathlib.Path(os.path.expanduser(\"~/.kube/config-tke-cls-xxxxxxxx\"))\nkubeconfig.parent.mkdir(parents=True, exist_ok=True)\nkubeconfig.write_text(resp.Kubeconfig)\nprint(\"export KUBECONFIG=\" + str(kubeconfig))\n```\n\n> Many TKE clusters expose only the **internal** API endpoint by default. If `IsExtranet=True` returns an empty / unusable config, the cluster's public API access isn't enabled — set `IsExtranet=False` and run `kubectl` from a host inside the same VPC (e.g. CVM, jump host).\n\n### Run kubectl commands (with the fetched kubeconfig)\n\n```python\nimport subprocess\n\nKUBECONFIG = os.path.expanduser(\"~/.kube/config-tke-cls-xxxxxxxx\")\nNS = \"acedatacloud\"\n\ndef kubectl(*args):\n    return subprocess.run(\n        [\"kubectl\", f\"--kubeconfig={KUBECONFIG}\", *args],\n        check=True, capture_output=True, text=True,\n    ).stdout\n\nprint(kubectl(\"get\", \"pods\", \"-n\", NS))\nprint(kubectl(\"get\", \"deploy\", \"-n\", NS))\nprint(kubectl(\"get\", \"svc\", \"-n\", NS))\nprint(kubectl(\"get\", \"events\", \"-n\", NS, \"--sort-by=.lastTimestamp\"))\n```\n\n### Describe a misbehaving pod\n\n```python\nprint(kubectl(\"describe\", \"pod\", \"<pod-name>\", \"-n\", NS))\nprint(kubectl(\"logs\", \"<pod-name>\", \"-n\", NS, \"--tail=200\"))\n```\n\n### Scale a Deployment\n\n```python\n# To 4 replicas. Confirm with the user before running for prod workloads.\nprint(kubectl(\"scale\", \"deploy/platform-backend\", \"-n\", NS, \"--replicas=4\"))\n```\n\n### Rolling restart a Deployment\n\n```python\n# Forces every pod to recycle through the rolling-update strategy.\nprint(kubectl(\"rollout\", \"restart\", \"deploy/platform-backend\", \"-n\", NS))\nprint(kubectl(\"rollout\", \"status\", \"deploy/platform-backend\", \"-n\", NS, \"--timeout=300s\"))\n```\n\n### List node pools (TKE concept above raw nodes)\n\n```python\nreq = models.DescribeClusterNodePoolsRequest()\nreq.ClusterId = \"cls-xxxxxxxx\"\nresp = client.DescribeClusterNodePools(req)\nfor np in resp.NodePoolSet:\n    print(np.NodePoolId, np.Name, np.LifeState, np.DesiredNodesNum, np.AutoscalingGroupId)\n```\n\n## Troubleshooting flow\n\n```\n1. python: DescribeClusters → cluster status / version\n2. python: DescribeClusterInstances → any nodes \"failed\" / \"running\"\n3. kubectl get events → recent failures (image pulls, scheduling, OOM)\n4. kubectl get pods → which pod is in CrashLoopBackOff / ImagePullBackOff\n5. kubectl describe pod <name> → conditions, events on the pod\n6. kubectl logs <name> --tail=200 → application logs\n7. (optional) tencentcloud-cls skill → CLS query for the same window\n```\n\n## Important reminders\n\n- **Confirm scale / restart actions** with the user before running for production workloads. A `replicas=0` typo takes the service down.\n- **Kubeconfigs contain a long-lived bearer token.** Treat the file like a credential — `chmod 600`, never commit, regenerate after offboarding people.\n- **Internal vs external endpoint:** `IsExtranet=False` gives a kubeconfig usable only from inside the cluster VPC. From a laptop, use `IsExtranet=True` and ensure the cluster has a public API endpoint enabled (TKE console → Cluster → Basic Info → API Server access).\n- **Region matters.** Cluster `cls-xxxxxxxx` in `ap-hongkong` is invisible from a TKE client constructed for `ap-guangzhou`.\n\n## Console links\n\n- TKE console: <https://console.cloud.tencent.com/tke2/cluster>\n- API reference: <https://www.tencentcloud.com/document/product/457/31862>","tags":["tencentcloud","tke","skills","acedatacloud","acedata-cloud","agent-skills","agentskills","ai-image","ai-music","ai-tools","ai-video","claude-code"],"capabilities":["skill","source-acedatacloud","skill-tencentcloud-tke","topic-acedata-cloud","topic-agent-skills","topic-agentskills","topic-ai-image","topic-ai-music","topic-ai-tools","topic-ai-video","topic-claude-code","topic-cursor","topic-gemini-cli","topic-github-copilot","topic-mcp"],"categories":["Skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/AceDataCloud/Skills/tencentcloud-tke","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add AceDataCloud/Skills","source_repo":"https://github.com/AceDataCloud/Skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (6,736 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:14:04.630Z","embedding":null,"createdAt":"2026-05-18T13:21:35.848Z","updatedAt":"2026-05-18T19:14:04.630Z","lastSeenAt":"2026-05-18T19:14:04.630Z","tsv":"'/.kube/config-tke':149 '/.kube/config-tke-cls-xxxxxxxx':467,539 '/_shared/tencentcloud.md':63 '/document/product/457/31862':869 '/tke2/cluster':864 '0':402,769 '1':692 '100':341,424 '2':698 '200':605,738 '3':705 '300s':661 '4':199,611,629,715 '5':725 '6':734 '600':790 '7':741 'access':506,836 'acedatacloud':541 'across':247 'action':758 'ad':289 'ad-hoc':288 'ap':363,845,856 'ap-guangzhou':855 'ap-hongkong':362,844 'api':489,505,826,834,865 'applic':739 'apt':305 'arg':544,551 'ask':18 'authent':62 'bash':109,294 'basic':832 'bearer':781 'brew':301 'c':346,400 'c.clusterid':350 'c.clustername':351,404 'c.clusternodenum':406 'c.clusterstatus':352,405 'c.clusterversion':353,407 'call':376 'captur':554 'care':381 'chang':284 'check':22,249,552 'chmod':789 'cli':89 'client':326,332,852 'client.describeclusterinstances':426 'client.describeclusterkubeconfig':455 'client.describeclusternodepools':678 'client.describeclusters':343,398 'cloud':6,48 'cls':122,132,138,146,156,166,176,188,204,359,395,421,444,675,745,747,841 'cls-xxxxxxxx':121,131,137,145,155,165,175,187,203,358,394,420,443,674,840 'cluster':11,21,23,53,64,76,97,107,115,117,120,125,216,246,313,354,370,385,484,502,695,811,822,831,839 'combin':46 'command':217,529 'commit':792 'common':104 'concept':666 'condit':729 'config':283,500 'confirm':613,755 'consol':830,858,861 'console.cloud.tencent.com':863 'console.cloud.tencent.com/tke2/cluster':862 'construct':853 'contain':776 'count':389 'crashloopbackoff':723 'cred':328,334 'credenti':320,331,788 'credential.environmentvariablecredential':329 'cvm':413,524 'daemonset':261 'debian/ubuntu':309 'def':542 'default':492 'depend':293 'deploy':32,197,213,259,279,569,608,633 'deploy/platform-backend':625,650,657 'describ':588,595,727 'describeclust':371,694 'describeclusterinst':700 'detail':127,386 'dir/scripts/tke.py':112 'discoveri':65,98 'doesn':237 'e.g':280,523 'empti':498 'enabl':509,828 'endpoint':490,800,827 'engin':10 'ensur':820 'event':42,174,183,269,581,708,730 'everi':636 'everyth':73 'exist':471 'export':478 'expos':485 'extern':799 'f':548 'fail':703 'failur':710 'fals':448,512,802 'fetch':37,88,226,285,437,532 'file':785 'flow':691 'forc':635 'get':330,384,562,568,574,580,707,717 'give':803 'go':69 'goe':81 'guangzhou':857 'health':25,251 'hoc':290 'hold':367 'hongkong':364,846 'host':518,526 'i.instanceid':433 'i.instancerole':434 'i.instancestate':435 'i.nodepoolid':436 'id':355 'imag':711 'imagepullbackoff':724 'immedi':460 'import':315,319,324,461,535,753 'in-clust':105,214 'info':833 'insid':57,74,519,809 'instal':231,236,296,302,306 'instanc':414 'intern':452,488,797 'invis':848 'isextranet':494,511,801,817 'isn':507 'jump':525 'k8s':41 'kubeconfig':38,67,86,99,144,151,227,286,438,453,464,479,481,533,537,549,550,775,805 'kubeconfig.parent.mkdir':468 'kubeconfig.write':474 'kubectl':83,221,228,291,303,307,515,528,543,547,561,567,573,579,594,600,623,647,654,706,716,726,735 'kubernet':9,50 'laptop':815 'lasttimestamp':587 'like':357,786 'link':859 'list':20,26,116,244,258,265,312,408,662 'live':780 'log':601,736,740 'long':779 'long-liv':778 'look':356 'maco':304 'manag':4,43,51 'mani':482 'matter':838 'misbehav':590 'model':327 'models.describeclusterinstancesrequest':418 'models.describeclusterkubeconfigrequest':441 'models.describeclusternodepoolsrequest':672 'models.describeclustersrequest':339,392 'must':229 'my-deploy':195,211 'my-namespac':159,169,179,191,207 'n':158,168,178,190,206,564,570,576,582,597,602,626,651,658 'name':194,210 'namespac':161,171,181,193,209,264 'never':791 'node':24,44,130,140,250,254,388,410,663,669,702 'node-pool':253 'np':681 'np.autoscalinggroupid':689 'np.desirednodesnum':688 'np.lifestate':687 'np.name':686 'np.nodepoolid':685 'ns':540,565,571,577,583,598,603,627,652,659 'offboard':795 'ok':472 'one':124 'oom':714 'oper':108 'option':742 'os':316,462 'os.environ':335 'os.path.expanduser':466,538 'output':555 'parent':469 'pathlib':463 'pathlib.path':465 'peopl':796 'per':378 'pip':235,295 'pod':27,77,164,267,563,591,596,637,718,720,728,733 'pool':45,136,141,255,664 'prefer':90 'print':349,403,432,477,560,566,572,578,593,599,622,646,653,684 'prod':620 'product':369,765 'public':504,825 'pull':712 'python':300,314,390,416,439,534,592,609,634,670,693,699 'python3':113,118,128,134,142,152,162,172,184,200 'queri':748 'quick':310 'raw':668 'recent':40,182,268,709 'recycl':639 'refer':866 'regener':793 'region':248,337,365,374,379,837 'region-scop':373 'remind':754 'replica':198,612,628,768 'req':338,344,391,399,417,427,440,456,671,679 'req.clusterid':419,442,673 'req.clusterids':393 'req.isextranet':446 'req.limit':340,423 'resourc':256 'resp':342,397,425,454,677 'resp.clusters':348,401 'resp.instanceset':431 'resp.kubeconfig':476 'resp.nodepoolset':683 'restart':36,80,202,277,631,649,757 'retriev':68,100 'return':496,545 'roll':35,276,630,643 'rolling-upd':642 'rollout':648,655 'run':514,527,618,704,763 'sandbox':234 'save':148,457 'scale':30,79,186,270,606,624,756 'schedul':713 'scope':375 'scripts/tke.py':94,95 'sdk':72,225,299 'sdk-fetch':224 'see':60 'server':835 'servic':29,78,266,773 'set':510 'setup':59 'shell':218 'ship':93,239 'skill':92,111,746 'skill-tencentcloud-tke' 'sort':585 'sort-bi':584 'source-acedatacloud' 'start':311 'statefulset':260 'status':656,696 'stdout':559 'str':480 'strategi':645 'subprocess':536 'subprocess.run':546 'svc':575 'tail':604,737 'take':771 'tencent':5,8,47 'tencentcloud':2,61,298,336,744 'tencentcloud-cl':743 'tencentcloud-sdk-python':297 'tencentcloud-tk':1 'tencentcloud.common':318 'tencentcloud.tke':322 'text':475,557 'timeout':660 'tke':3,7,49,52,110,114,119,129,135,143,153,163,173,185,201,245,325,483,665,829,851,860 'tke_client.tkeclient':333 'token':782 'topic-acedata-cloud' 'topic-agent-skills' 'topic-agentskills' 'topic-ai-image' 'topic-ai-music' 'topic-ai-tools' 'topic-ai-video' 'topic-claude-code' 'topic-cursor' 'topic-gemini-cli' 'topic-github-copilot' 'topic-mcp' 'treat':783 'troubleshoot':690 'true':447,470,473,495,553,556,558,818 'type':415 'typic':366 'typo':770 'unus':499 'updat':644 'usabl':806 'usag':257 'use':14,243,459,816 'user':17,616,761 'v20180525':323 'version':697 'view':39 'vpc':451,522,812 'vpc-intern':450 'vs':798 'window':752 'work':292 'worker':387,409 'workflow':383 'workload':13,56,154,272,621,766 'wrap':96 'write':150 'www.tencentcloud.com':868 'www.tencentcloud.com/document/product/457/31862':867 'xxxxxxxx':123,133,139,147,157,167,177,189,205,360,396,422,445,676,842","prices":[{"id":"0faaf383-e39b-4945-a788-b474806508fd","listingId":"bd9ffdcb-6743-40e3-8e88-22abb7e44cbc","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"AceDataCloud","category":"Skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:21:35.848Z"}],"sources":[{"listingId":"bd9ffdcb-6743-40e3-8e88-22abb7e44cbc","source":"github","sourceId":"AceDataCloud/Skills/tencentcloud-tke","sourceUrl":"https://github.com/AceDataCloud/Skills/tree/main/skills/tencentcloud-tke","isPrimary":false,"firstSeenAt":"2026-05-18T13:21:35.848Z","lastSeenAt":"2026-05-18T19:14:04.630Z"}],"details":{"listingId":"bd9ffdcb-6743-40e3-8e88-22abb7e44cbc","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"AceDataCloud","slug":"tencentcloud-tke","github":{"repo":"AceDataCloud/Skills","stars":7,"topics":["acedata-cloud","agent-skills","agentskills","ai-image","ai-music","ai-tools","ai-video","claude-code","cursor","gemini-cli","github-copilot","mcp","npm","openai-codex","roo-code"],"license":"other","html_url":"https://github.com/AceDataCloud/Skills","pushed_at":"2026-05-18T07:35:03Z","description":"Agent Skills for AceDataCloud AI services — music, image, video generation, web search, and more. Compatible with Claude Code, GitHub Copilot, Gemini CLI, and all agentskills.io-compatible agents.","skill_md_sha":"df03a721768977b2b019046469a635e9a4fdb3c5","skill_md_path":"skills/tencentcloud-tke/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/AceDataCloud/Skills/tree/main/skills/tencentcloud-tke"},"layout":"multi","source":"github","category":"Skills","frontmatter":{"name":"tencentcloud-tke","license":"Apache-2.0","description":"Manage Tencent Cloud TKE (Tencent Kubernetes Engine) clusters and\nworkloads. Use when the user asks to: list clusters, check cluster /\nnode health, list pods or services, scale a Deployment, do a rolling\nrestart, fetch kubeconfig, view recent K8s events, manage node pools.\nCombines the official tencentcloud-sdk-python TKE client (cluster\nmetadata) with kubectl for in-cluster operations."},"skills_sh_url":"https://skills.sh/AceDataCloud/Skills/tencentcloud-tke"},"updatedAt":"2026-05-18T19:14:04.630Z"}}