Giter Site home page Giter Site logo

i9s's Introduction

I9S


站在巨人的肩膀

开发i9s的初衷是提高服务网格的运维效率,我们希望有一款工具可以像 k9s 管理k8s资源那样,可视化的管理istio。得益于k9s代码的可扩展性, 我们基于k9s-v0.25.18 的代码,进行了二次开发,提供了istio资源可视化以及调试接口的能力,再次感谢k9s

运维场景

常常遇到的场景是,某服务治理规则不生效,需要排查。可能会分以下几个步骤进行排查:

  1. 查找服务pods, 查看envoyconfig_dump. 一般来说会先查找pod, 这里以view服务为例

    kubectl -n skiff-demo-sidecar get pods
    demo-stock-viewer-sidecar-8547788687-lk48m       2/2     Running   0          15d
    
  2. 执行envoy debug命令查看 config_dump文件

    kubectl -n skiff-demo-sidecar exec demo-stock-viewer-sidecar-8547788687-lk48m -- curl 127.0.0.1:15000/config_dump | less
    
  3. 这时候会遇到类似config_dump中没有相关配置文件,控制面是否下发的问题

  4. 目标转移到控制面,查找istio pod

    kubectl -n istio-system get pods
    istiod-112-5fb95d6fff-k94pz            1/1     Running     0          46h
    
  5. 然后首先看istio中是否有该配置

    k exec istiod-112-5fb95d6fff-k94pz -- curl 127.0.0.1:15014/debug/configz | less
    
  6. 如果发现没有配置,可能是istio的上层问题(没下发)。如果是istio的问题,可以接着看下发到 view 服务的实际数据是否正常

    kubectl -n istio-system exec istiod-112-5fb95d6fff-k94pz -- curl 127.0.0.1:15014/debug/config_dump?proxyID=demo-stock-viewer-sidecar-8547788687-lk48m | less
    
  7. 到这步基本就能判断出问题出在了控制面还是数据面

  8. 接下来可能需要更具体的排查

i9s介绍

i9s的宗旨是提高istio的运维效率,从运维场景章节可以看到,配置是否下发问题的定位就需要多个kubectl交互命令,而i9s可以极大提升该过程的查询效率。目前i9s提供的功能包括

  • istio 调试接口,包括configz,adsz,config_dump 等接口信息查看

  • enovy 调试接口,包括config_dump,cluster,endpoints 等接口信息查看

  • revision查看,从revision视角提供注入规则、deployment资源清单、mesh配置文件等信息

运行

前提:需要指定kubeconfig, 且目前以适配1.12为主, 由于不同版本接口不同,可能导致查询其他版本的接口时出现问题。

  • 镜像方式(需要将kubeconfig文件挂载进容器内)

运行最新版本i9s

tag=$(curl https://api.github.com/repos/slime-io/i9s/releases/latest -s|grep tag_name|sed 's/.*tag_name": "//g; s/",.*//g')

docker run -it --net=host -v $HOME/.kube/config:/root/.kube/config slimeio/i9s:$tag
  • 二进制方式, 该安装脚本会检查本地是否有kubectl, 如果没有需用户自行安装。之后会检查jq, less 等命令是否存在,如果不存在会自动安装, 之后会运行镜像,并将镜像中的可执行文件i9s, istioctl, fx移动至 /usr/bin 目录下

默认情况下,会安装最新的tag

sh ./install.sh

或者用户可以指定需要安装的tag

tag=v0.0.7-i9s ./install.sh

如果没有拉取 install.sh, 可以执行下面命令在线安装最新版本的i9s

tag=$(curl https://api.github.com/repos/slime-io/i9s/releases/latest -s|grep tag_name|sed 's/.*tag_name": "//g; s/",.*//g')

tar_tag=$(curl https://api.github.com/repos/slime-io/i9s/releases/latest -s|grep tag_name|sed 's/.*tag_name": "v//g; s/",.*//g')

source <(curl -fsSL https://github.com/slime-io/i9s/archive/$tag.tar.gz | tar xzO i9s-$tar_tag/install.sh)

由于有些minikube 权限问题,可能需要将kubeconifg中指定的client-key的目录一同挂进容器

操作方式

  • 按下 :istio 切换至isito revision视图,可以选在不同rev

revision

  • 选中rev按下 enter 进入rev详情页面, 包含注入规则、deployment清单和mesh configuration

pilot_describe

  • 选中istiod configuratiojn按下 enter 展示了mesh 配置项详情

pilot_describe

  • istio revision 视图下,选中rev并按下m(mesh)进入isito api视图, 展示可调试的istio接口列表

revision

  • 选中istio/configz按下 enter展示debug/configz信息, 支持less操作,按q退出

revision

  • 选中服务(接入网格的服务)所在pod并按下m(mesh) 进入envoy api视图,展示可调试的envoy接口信息

revision

  • 选中envoy/config_dump进入/config_dump 接口,支持less操作,按q退出

revision

规划

i9s 提供了istio可视化基础操作能力, 之后计划结合istioctlisito提供配置的分析统计能力,持续演进。

i9s's People

Contributors

derailed avatar moucel avatar paivagustavo avatar joscha-alisch avatar raphink avatar ameausoone avatar dependabot[bot] avatar mcristina422 avatar yonkafang avatar chenrui333 avatar sagor999 avatar davidnemec avatar bkmeneguello avatar raulcabello avatar eldada avatar groselt avatar fridokus avatar syvanpera avatar torjue avatar sachaos avatar mikesigs avatar brunohms avatar igorramalho avatar wi1dcard avatar tlipinski avatar thomasboni avatar darklore avatar twin avatar tomerf avatar mycreepy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.