1、查看
istioctl --helpIstio configuration command line utility for service operators todebug and diagnose their Istio mesh.Usage:istioctl [command]Available Commands:admin Manage control plane (istiod) configurationanalyze Analyze Istio configuration and print validation messagesauthz (authz is experimental. Use `istioctl experimental authz`)bug-report Cluster information and log capture support tool.completion Generate the autocompletion script for the specified shellcreate-remote-secret Create a secret with credentials to allow Istio to access remote Kubernetes apiserversdashboard Access to Istio web UIsexperimental Experimental commands that may be modified or deprecatedhelp Help about any commandinstall Applies an Istio manifest, installing or reconfiguring Istio on a cluster.kube-inject Inject Istio sidecar into Kubernetes pod resourcesmanifest Commands related to Istio manifestsoperator Commands related to Istio operator controller.profile Commands related to Istio configuration profilesproxy-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 tagsuninstall Uninstall Istio from a clusterupgrade Upgrade Istio control plane in-placevalidate Validate Istio policy and rules filesverify-install Verifies Istio Installation Statusversion Prints out build version informationFlags:--context string The name of the kubeconfig context to use-h, --help help for istioctl-i, --istioNamespace string Istio system namespace (default "istio-system")-c, --kubeconfig string Kubernetes configuration file-n, --namespace string Config namespace--vklog Level number for the log level verbosity. Like -v flag. ex: --vklog=9Additional help topics:istioctl options Displays istioctl global optionsUse "istioctl [command] --help" for more information about a command.
2、istioctl version
istioctl versionclient version: 1.16.2 # 客户端control plane version: 1.16.2 # 控制面板data plane version: 1.16.2 (2 proxies) # 数据面板
3、 istioctl analyze
- 分析Istio配置并打印验证消息
istioctl analyze --helpistioctl analyzekubectl get ns default --show-lables # 查看名称空间标签istioctl analyze -n default # 分析名称空间
- 分析默认命名空间
istioctl analyzeInfo [IST0102] (Namespace default) The namespace is not enabled for Istio injection. Run 'kubectl label namespace default istio-injection=enabled' to enable it, or 'kubectl label namespace default istio-injection=disabled' to explicitly mark it as not needing injection.
- 默认命名空间未注入istio
ubectl label namespace default istio-injection=enabled
- 注入相关标签之后查看
istioctl analyze -n defaultWarning [IST0103] (Pod default/nfs-client-provisioner-5cb67db888-rfhpb) The pod default/nfs-client-provisioner-5cb67db888-rfhpb is missing the Istio proxy. This can often be resolved by restarting or redeploying the workload.
- pod缺少Istio代理。这通常可以通过重新启动或重新部署工作负载来解决。
# 重启工作服务查看kubectl delete pod nfs-client-provisioner-5cb67db888-rfhpb# 再次分析istioctl analyze✔ No validation issues found when analyzing namespace: default.
4、istioctl profile
与Istio配置文件相关的命令
istioctl profile dump demo > demo.yaml
- components组件信息
- addonComponents(较低版本存在插件,会自动部署这些服务),目前版本需要手动在
samples/addons部署
可以通过以上方法查看每个profile默认都开启了那些组件和插件功能
empty profile
一个空模板,老玩家可以通过改模板自定义所需要的组件和插件
