1、查看

  1. istioctl --help
  2. Istio configuration command line utility for service operators to
  3. debug and diagnose their Istio mesh.
  4. Usage:
  5. istioctl [command]
  6. Available Commands:
  7. admin Manage control plane (istiod) configuration
  8. analyze Analyze Istio configuration and print validation messages
  9. authz (authz is experimental. Use `istioctl experimental authz`)
  10. bug-report Cluster information and log capture support tool.
  11. completion Generate the autocompletion script for the specified shell
  12. create-remote-secret Create a secret with credentials to allow Istio to access remote Kubernetes apiservers
  13. dashboard Access to Istio web UIs
  14. experimental Experimental commands that may be modified or deprecated
  15. help Help about any command
  16. install Applies an Istio manifest, installing or reconfiguring Istio on a cluster.
  17. kube-inject Inject Istio sidecar into Kubernetes pod resources
  18. manifest Commands related to Istio manifests
  19. operator Commands related to Istio operator controller.
  20. profile Commands related to Istio configuration profiles
  21. proxy-config Retrieve information about proxy configuration from Envoy [kube only]
  22. proxy-status Retrieves the synchronization status of each Envoy in the mesh [kube only]
  23. remote-clusters Lists the remote clusters each istiod instance is connected to.
  24. tag Command group used to interact with revision tags
  25. uninstall Uninstall Istio from a cluster
  26. upgrade Upgrade Istio control plane in-place
  27. validate Validate Istio policy and rules files
  28. verify-install Verifies Istio Installation Status
  29. version Prints out build version information
  30. Flags:
  31. --context string The name of the kubeconfig context to use
  32. -h, --help help for istioctl
  33. -i, --istioNamespace string Istio system namespace (default "istio-system")
  34. -c, --kubeconfig string Kubernetes configuration file
  35. -n, --namespace string Config namespace
  36. --vklog Level number for the log level verbosity. Like -v flag. ex: --vklog=9
  37. Additional help topics:
  38. istioctl options Displays istioctl global options
  39. Use "istioctl [command] --help" for more information about a command.

2、istioctl version

  1. istioctl version
  2. client version: 1.16.2 # 客户端
  3. control plane version: 1.16.2 # 控制面板
  4. data plane version: 1.16.2 (2 proxies) # 数据面板

3、 istioctl analyze

  • 分析Istio配置并打印验证消息
  1. istioctl analyze --help
  2. istioctl analyze
  3. kubectl get ns default --show-lables # 查看名称空间标签
  4. istioctl analyze -n default # 分析名称空间
  • 分析默认命名空间
  1. istioctl analyze
  2. Info [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
  1. ubectl label namespace default istio-injection=enabled
  • 注入相关标签之后查看
  1. istioctl analyze -n default
  2. Warning [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代理。这通常可以通过重新启动或重新部署工作负载来解决。
  1. # 重启工作服务查看
  2. kubectl delete pod nfs-client-provisioner-5cb67db888-rfhpb
  3. # 再次分析
  4. istioctl analyze
  5. No validation issues found when analyzing namespace: default.

4、istioctl profile

与Istio配置文件相关的命令

  1. istioctl profile dump demo > demo.yaml
  • components组件信息
  • addonComponents(较低版本存在插件,会自动部署这些服务),目前版本需要手动在samples/addons部署

可以通过以上方法查看每个profile默认都开启了那些组件和插件功能

empty profile

一个空模板,老玩家可以通过改模板自定义所需要的组件和插件

remote profile