一、源码编译
同事交了我编译envoy的编译顺序,在这里编译整理下,毕竟envoy是istio中重要的代理
下面的环境是ubuntu20.04下的安装步骤,同事告诉我说编译envoy的话尽量使用gcc 9,否则编译可能会出现一些小问题
sudo apt install curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt update && sudo apt install bazel
sudo apt update && sudo apt full-upgrade
sudo apt update && sudo apt install bazel-4.1.0
上面的这些可能几年之后就不能用了,参考安装的网站是bazel的官网,参考的地址是:
https://bazel.build/
安装好bazel后直接安装envoy吧,参考官网地址:
https://github.com/envoyproxy/envoy/blob/7d3057f8c039910f06c583684642c6e0a4e35b37/bazel/README.md
输入命令
bazel build -c dbg //source/exe:envoy-static
进行长达4~8个小时的编译之后,我们就可以编译完成debug版本了
二、修改istio环境中的自定义配置
这几天注入了自己写的sidecar后碰到一个问题,需要修改istio上的envoy默认配置,需要引入官方的libjaeger_plugin.so,自己对istio又不是很熟,istio官方的tracing是不支持这种方式的,但是istio官方提供了自定义envoy配置的接口
https://github.com/istio/istio/tree/master/samples/custom-bootstrap
一个非常重要的参数配置就是
sidecar.istio.io/bootstrapOverride: "istio-custom-bootstrap-config"