有奖捉虫:办公协同&微信生态&物联网文档专题 HOT

工具简介

Istio 社区提供了命令行工具 istioctl 帮助用户管理网格,但对于托管在 TCM 的网格实例,受限于托管架构以及托管服务本身的限制,并不支持直接使用 Istioctl,因此我们提供了供托管网格使用的命令行工具 tcmctl。

前置条件

1. 已创建托管网格,并添加 TKE 标准集群。
2. 使用环境可通过 kubectl 连接任一被网格管理的集群。(具备正确的 kubeconfig 配置)

兼容性

以下为 tcmctl 与 istioctl 差异对比:
命令类型
istioctl(1.12) 命令
功能
兼容情况
基础命令
admin
Manage control plane (istiod) configuration
不支持,托管控制面不支持用户自定义修改配置
analyze
Analyze Istio configuration and print validation messages
支持
authz
(authz is experimental. Use istioctl experimental authz)
支持
bug-report
Cluster information and log capture support tool.
支持
completion
generate the autocompletion script for the specified shell
支持
create-remote-secret
Create a secret with credentials to allow Istio to access remote Kubernetes apiservers
不支持,托管控制面不允许自行为控制面创建 Secret
dashboard
Access to Istio web UIs
部分支持,受限于控制面托管,仅支持 dashboard envoy 命令
experimental
Experimental commands that may be modified or deprecated
部分支持,详情见“实验命令支持情况”
help
Help about any command
支持
install
Applies an Istio manifest, installing or reconfiguring Istio on a cluster.
不支持
upgrade
Upgrade Istio control plane in-place
不支持,托管网格不支持通过命令管理实例生命周期
verify-install
Verifies Istio Installation Status
支持
manifest
Commands related to Istio manifests
支持
operator
Commands related to Istio operator controller.
支持
profile
Commands related to Istio configuration profiles
支持
kube-inject
Inject Istio sidecar into Kubernetes pod resources
不支持,TCM 注入机制由控制面统一管理,不支持命令注入
proxy-config
Retrieve information about proxy configuration from Envoy [kube only]
支持
proxy-status
Retrieves the synchronization status of each Envoy in the mesh [kube only]
支持
remote-clusters
Lists the remote clusters each istiod instance is connected to.
支持
tag
Command group used to interact with revision tags
不支持,未使用 tag 机制,不支持 tag 操作
validate
Validate Istio policy and rules files
支持
version
Prints out build version information
支持
实验命令
add-to-mesh
Add workloads into Istio service mesh
不支持,托管网格不允许自行控制
remove-from-mesh
Remove workloads from Istio service mesh
支持
authz
Inspect Istio AuthorizationPolicy
支持
create-remote-secret
Create a secret with credentials to allow Istio to access remote Kubernetes apiservers
支持
describe
Describe resource and related Istio configuration
支持
injector
List sidecar injector and sidecar versions
不支持,sidecar injector 托管,不支持改显示改信息
internal-debug
Retrieves the debug information of istio
不支持,不允许对托管控制面进行 debug 操作
kube-uninject
Uninject Envoy sidecar from Kubernetes pod resources
不支持,注入机制有控制面统一管理,不支持命令删除 sidecar
metrics
Prints the metrics for the specified workload(s) when running in Kubernetes.
不支持,不允许对控制面核心组件自建可观测性。
precheck
check whether Istio can safely be installed or upgrade
不支持,控制面托管,不支持社区的检查操作
version
Prints out build version information
不支持,无法通过 xds-address 来获取 version 信息,请使用“tcmctl version”命令
proxy-status
Retrieves the synchronization status of each Envoy in the mesh
不支持,无法通过 xds-address 来获取 proxy 状态信息,请使用“tcmctl proxy-status”命令
config
Configure istioctl defaults
支持
remote-clusters
Lists the remote clusters each istiod instance is connected to.
支持
revision
Provide insight into various revisions (istiod, gateways) installed in the cluster
不支持,TCM 未使用 tag 机制,不支持 tag 子命令
uninstall
Uninstall Istio from a cluster
不支持,托管网格不允许通过命令管理实例生命周期
wait
Wait for an Istio resource
支持
workload
Commands to assist in configuring and deploying workloads running on VMs and other non-Kubernetes environments
不支持,sidecar 的注入配置由控制面管理,因此不支持修改操作
对于以上命令行工具 tcmctl 支持的命令,使用语法与社区 istioctl 完全一致,您可以使用 -help 查询相关语法。更多关于 istioctl 的使用,可查看 istioctl 文档

使用方式

1. 下载合适版本的 tcmctl。根据您的使用环境,选择并下载合适的版本:tcmctl-linuxtcmctl-windowstcmctl-mac
2. 为工具增加执行权限,并加入到 PATH 环境变量。
3. 连接网格,与 kubectl 类似。默认情况下 tcmctl 使用 $HOME/.kube/config 连接网格中的集群,您可以通过配置 --context 切换 kubeconfig。