发布时间:2021-01-21 10:02:10编辑:admin阅读(3504)
使用如下命令查看 kiali pod 详情:
kubectl edit pod -n istio-system $(kubectl get pods -n istio-system | grep -i kiali | awk '{print $1}')
kiali pod 内只有一个容器,名称为 kiali。该容器在启动的过程中会运行容器内 kiali 进程,该进程会加载 /kiali-configuration/config.yaml 配置文件,该 config.yaml 文件定义了 kiali 进程运行时行为。pod 部分详情如下:
spec: containers: - command: - /opt/kiali/kiali - -config - /kiali-configuration/config.yaml - -v - "3"
kiali pod 内 /kiali-configuration/config.yaml 配置文件是通过挂载 configmap 获取到的,如下:
volumeMounts: - mountPath: /kiali-configuration name: kiali-configuration
configmap 信息如下:
volumes: - configMap: defaultMode: 420 name: kiali name: kiali-configuration
可以通过语句查看 kiali configmap 内容:
kubectl edit configmap -n istio-system kiali
kiali configmap 部分内容如下:
apiVersion: v1 data: config.yaml: | auth: openid: {} ... kind: ConfigMap metadata: annotations: ...
由上面可知,configmap 最终会以 config.yaml 文件的形式挂载到 kiali pod 中的 /kiali-configuration 目录下。
查看pod
[root@k8s-master ~]# kubectl get pods -n istio-system |grep kiali kiali-667b888c56-8h7cp 1/1 Running 1 3h26m
进入 kiali pod 查看
[root@k8s-master ~]# kubectl exec -it -n istio-system kiali-667b888c56-8h7cp /bin/bash kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl kubectl exec [POD] -- [COMMAND] instead. [kiali@kiali-667b888c56-8h7cp kiali]$ ls /kiali-configuration/ config.yaml [kiali@kiali-667b888c56-8h7cp kiali]$
config.yaml 内容如下:
[kiali@kiali-667b888c56-8h7cp kiali]$ cat /kiali-configuration/config.yaml auth: openid: {} openshift: client_id_prefix: kiali strategy: anonymous deployment: accessible_namespaces: - '**' additional_service_yaml: {} affinity: node: {} pod: {} pod_anti: {} custom_dashboards: excludes: - "" includes: - '*' image_name: quay.io/kiali/kiali image_pull_policy: Always image_pull_secrets: [] image_version: v1.26 ingress_enabled: false namespace: istio-system node_selector: {} override_ingress_yaml: metadata: {} pod_annotations: sidecar.istio.io/inject: "false" pod_labels: {} priority_class_name: "" replicas: 1 resources: {} secret_name: kiali service_annotations: {} service_type: "" tolerations: [] verbose_mode: "3" version_label: v1.26.0 view_only_mode: false external_services: custom_dashboards: enabled: true identity: cert_file: "" private_key_file: "" istio_namespace: istio-system login_token: signing_key: CHANGEME server: metrics_enabled: true metrics_port: 9090 port: 20001 web_root: /kiali
该配置文件定义了 kiali 行为,下面分别介绍如下:
首先声明 istio 自身以及 istio 插件在 k8s 哪个命名空间下:
# istio 自身 istio_namespace: istio-system
其次介绍 kiali 鉴权方式:
auth: openid: {} openshift: client_id_prefix: kiali strategy: anonymous # 通过匿名用户登录
再次介绍 kiali deployment 可以访问的 k8s 命名空间:
deployment: accessible_namespaces: - '**' # 没有限制,可访问任何命名空间
接着介绍 kiali 对外服务的端口号和访问路径:
server: metrics_enabled: true metrics_port: 9090 port: 20001 web_root: /kiali
本文参考链接:
https://blog.51cto.com/14268033/2487237
下一篇: istio kiali 亲和性调度
47743
46233
37107
34625
29227
25883
24743
19861
19414
17906
5713°
6312°
5832°
5885°
6981°
5827°
5842°
6358°
6313°
7670°