# OpenNJet-istio-install **Repository Path**: njet-rd/istio-install ## Basic Information - **Project Name**: OpenNJet-istio-install - **Description**: 定制化安装istio,自动注入njet sidecar - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2023-03-29 - **Last Updated**: 2023-07-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README - [Istio Install](#istio-install) - [Overview](#overview) - [Install istiod](#install-istiod) - [Inject nginx](#inject-nginx) - [Pod level](#pod-level) - [namespace level](#namespace-level) - [Uninstall Istio](#uninstall-istio) # istio-install ## Overview 基于istio-1.13.3,定制化配置部署istio,自动注入nginx sidecar。需要修改sidecar镜像名称,修改sidecar 容器模板。 ## Install istiod ```sh ./istio-1.13.3/bin/istioctl install --manifests=istio-1.13.3/manifests/ -f default-istio.yaml ``` ## Inject nginx 修改default-istio.yaml文件values.global.proxy.image字段,设置为nginx的镜像名称,必须为包含“/”的仓库url。 自动注入nginx sidecar(支持namespace、pod级别),在pod被创建时被触发。 ### Pod level 给pod打标贴:sidecar.istio.io/inject: “true”,以productpage为例,修改deploy,增加标贴 ```sh kubectl edit deploy productpage-v1 ``` ![img.png](doc/picture/productpage-deployment.png) 等待一会 ![img.png](doc/picture/productpage-pod.png) ### Namespace level 添加namespace label,以便后续在此ns部署应用时,通知istio自动注入nginx sidecar,下面为default ns添加标贴 ```sh kubectl label namespace default istio-injection=enabled ``` 查看ns标贴 ```sh kubectl get ns --show-labels ``` ![img.png](doc/picture/default-ns-label.png) 查看default ns pod状态 ![img.png](doc/picture/default-ns-pod.png) 删除details pod,触发sidecar注入 ```sh kubectl delete pod details-v1-5498c86cf5-6kcpw ``` 查看default ns pod状态,details pod注入nginx sidecar ![img.png](doc/picture/default-ns-pod-inject.png) # Uninstall Istio 官方使用如下命令卸载istio,但是部分cm和sa没有被删除 ```sh istioctl x uninstall --purge ``` ![img.png](doc/picture/uninstall-istio.png) 删除istio-system ns,可以删除istio-system ns下的所有资源 ```sh kubectl delete namespace istio-system ```