1、查看
istioctl --help
Istio configuration command line utility for service operators to
debug and diagnose their Istio mesh.
Usage:
istioctl [command]
Available Commands:
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
dashboard Access to Istio web UIs
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.
kube-inject Inject Istio sidecar into Kubernetes pod resources
manifest Commands related to Istio manifests
operator Commands related to Istio operator controller.
profile Commands related to Istio configuration profiles
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
uninstall Uninstall Istio from a cluster
upgrade Upgrade Istio control plane in-place
validate Validate Istio policy and rules files
verify-install Verifies Istio Installation Status
version Prints out build version information
Flags:
--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=9
Additional help topics:
istioctl options Displays istioctl global options
Use "istioctl [command] --help" for more information about a command.
2、istioctl version
istioctl version
client version: 1.16.2 # 客户端
control plane version: 1.16.2 # 控制面板
data plane version: 1.16.2 (2 proxies) # 数据面板
3、 istioctl analyze
- 分析Istio配置并打印验证消息
istioctl analyze --help
istioctl analyze
kubectl get ns default --show-lables # 查看名称空间标签
istioctl analyze -n default # 分析名称空间
- 分析默认命名空间
istioctl analyze
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
ubectl label namespace default istio-injection=enabled
- 注入相关标签之后查看
istioctl analyze -n default
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代理。这通常可以通过重新启动或重新部署工作负载来解决。
# 重启工作服务查看
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
一个空模板,老玩家可以通过改模板自定义所需要的组件和插件