温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

istio 升级到1.3.0版本

发布时间:2020-06-07 12:27:28 来源:网络 阅读:1248 作者:juestnow 栏目:系统运维

准备

# 工作目录/mnt/e/work/
# 下载安装包
cd /mnt/e/work/
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.3.0 sh -
配置环境变量删除旧的
/etc/profile
export PATH="$PATH:/mnt/e/work/istio-1.3.0/bin"
source /etc/profile

升级

# 修改yaml 与上次版本参数一致
#使用Beyond Compare 4 差异对比
#修改gateways values.yaml 文件 删除nodePort 当然也可不用删除
#参数gateways.istio-ingressgateway.type=NodePort 
# 参数gateways.istio-ingressgateway.type=ClusterIP 必须删除nodePort

istio 升级到1.3.0版本

# 修改 gateways\templates\service.yaml 文件
#添加 clusterIP: None # 方便暴露其它tcp 端口

istio 升级到1.3.0版本

#修改 istio-cni 
# 修改文件helm\istio-cni\templates\istio-cni.yaml
#添加内容 也可以不用修改在这边项目做了修改的
        - effect: NoSchedule
          key: node-role.kubernetes.io/ingress
          operator: Equal

istio 升级到1.3.0版本

升级istio

#检查是否安装 istio-cni  插件
helm status istio-cni --namespace istio-system
root@Qist:/mnt/f# helm status istio-cni --namespace istio-system
NAME: istio-cni
LAST DEPLOYED: 2019-09-18 16:33:57.4490493 +0800 DST
NAMESPACE: istio-system
STATUS: deployed
#返回正常证明已经安装了istio-cni
#由于istio-cni 安装在非kube-system命名空间 先卸载istio-cni
helm uninstall istio-cni --namespace istio-system
# 等待卸载完成
helm install install/kubernetes/helm/istio-cni --name-template istio-cni --namespace istio-system \
--set cniBinDir=/apps/cni/bin   \ # cni 在宿主机目录
--set excludeNamespaces={"istio-system,monitoring,kubernetes-dashboard,kube-system"}# 排除的命名空间
# 如果部署在kube-system 命名空间直接升级
helm upgrade --install istio-cni install/kubernetes/helm/istio-cni  --namespace kube-system \
--set cniBinDir=/apps/cni/bin   \
--set excludeNamespaces={"istio-system,monitoring,kubernetes-dashboard,kube-system"}
# 升级istio-init
helm upgrade --install istio-init install/kubernetes/helm/istio-init  --namespace istio-system --force
# 等待升级完成
# 使用以下命令验证是否已将所有Istio CRD提交到Kubernetes api-server
kubectl get crds | grep 'istio.io' | wc -l
root@Qist:/mnt/f# kubectl get crds | grep 'istio.io' | wc -l
23
# 返回正常
# 升级istio图表
# xxxx 替换成自己的域名
#xxxx.local 替换成自己k8s集群域
helm upgrade --install istio install/kubernetes/helm/istio --namespace istio-system  \
--set gateways.istio-ingressgateway.type=ClusterIP   \ # ClusterIP IP 对外暴露服务 可设置NodePort
--set gateways.istio-egressgateway.enabled=true \ # 开启istio-egressgateway 服务
--set gateways.istio-ingressgateway.serviceAnnotations={'kubernetes.io/ingress.class: traefik,traefik.ingress.kubernetes.io/affinity: true,traefik.ingress.kubernetes.io/load-balancer-method: drr'}  \ # 设置 istio-ingressgateway service 负载均衡规则及session  保持与使用traefik 对外提供ingress 服务 如果是其它ingress 一定要做修改
--set mixer.policy.enabled=true \ # 启用策略检查
--set grafana.enabled=true \ # 开启grafana
--set grafana.ingress.enabled=true \ # 开启grafana ingress
--set grafana.ingress.hosts={"gr.xxxx.com"} \ # 配置grafana  访问域名
--set grafana.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \ # 配置grafana 使用traefik 作为转发服务
--set grafana.contextPath=/ \ # 配置域名访问路径 默认路径/grafana 
--set prometheus.ingress.enabled=true \ # 开启prometheus ingress
--set prometheus.ingress.hosts={"pr.xxxx.com"} \  # 配置 prometheus 访问域名
--set prometheus.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \ #用traefik 作为转发服务
--set prometheus.contextPath=/ \ #配置域名访问路径 默认路径/prometheus 
--set tracing.enabled=true \ # 开启tracing 服务如果以前配置zipkin 作为追踪这里请添加 tracing.provider=zipkin 否则部署会报错
--set tracing.ingress.enabled=true \ # 开启tracing ingress 
--set tracing.ingress.hosts={"tracing.xxxx.com"} \ # 配置tracing 域名访问
--set tracing.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \ # 用traefik 作为转发服务
--set tracing.contextPath=/ \ # 配置域名访问路径 默认路径/tracing 
--set kiali.enabled=true \ # 开启kiali 
--set kiali.ingress.enabled=true \ # 开启kiali ingress 
--set kiali.ingress.hosts={"kiali.xxxx.com"} \ # 配置kiali 域名访问服务
--set kiali.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \ # 用traefik 作为转发服务
--set kiali.contextPath=/ \ #  配置域名访问路径 默认路径/kiali 
--set kiali.dashboard.viewOnlyMode=true \ # 配置账号只有读取权限
--set kiali.dashboard.grafanaURL=http://gr.xxxx.com \ # 配置grafana 对外访问路径可以是对外的IP 跟域名一定要外网访问
--set kiali.dashboard.jaegerURL=http://tracing.xxxx.com \ # 配置jaeger 对外访问路径可以是对外的IP 跟域名 如果启用zipkin 这个配置失效
--set kiali.createDemoSecret=true \ # 设置kiali Secret 账号密码 默认admin/admin 
--set istio_cni.enabled=true   \ # 开启  istio_cni
--set istio-cni.cniBinDir=/apps/cni/bin   \ # 配置 宿主机cni 路径
--set istio-cni.excludeNamespaces={"istio-system,monitoring,kubernetes-dashboard,kube-system"}  \ # 排除命名空间
--set global.k8sIngress.enabled=true \ # 开启用于K8S入口资源的网关
--set global.proxy.clusterDomain="xxxx.local" \ # k8s 集群域istio-proxy 会用到
--set global.proxy.accessLogFile="/dev/stdout" \ # 代理日志输出到/dev/stdout 
--set global.proxy.logLevel="info" \ # 代理日志输出级别
--set global.disablePolicyChecks=false \  #开启策略检查
--set global.proxy.autoInject=disabled # 关闭istio-injection 为enabled 自动注入 设置为使用annotations 注释进行注入 sidecar.istio.io/inject: "true" 默认 sidecar.istio.io/inject: "false"
# 等待升级完成 
kubectl get pod -n istio-system
root@Qist:/mnt/f# kubectl get pod -n istio-system
NAME                                      READY   STATUS      RESTARTS   AGE
grafana-7bfb599d6c-5828h                  1/1     Running     0          17h
istio-citadel-5f85674d5b-x2hbt            1/1     Running     0          17h
istio-cleanup-secrets-1.3.0-rxsqz         0/1     Completed   0          18h
istio-cni-node-4774c                      1/1     Running     0          17h
istio-cni-node-4t7rz                      1/1     Running     0          17h
istio-cni-node-h66gq                      1/1     Running     0          17h
istio-cni-node-nc64k                      1/1     Running     0          17h
istio-cni-node-rd2pw                      1/1     Running     0          17h
istio-cni-node-tzjjn                      1/1     Running     0          17h
istio-cni-node-xgrj7                      1/1     Running     0          17h
istio-egressgateway-55978569d6-cw99p      1/1     Running     0          17h
istio-galley-545fbd68c8-56pmq             1/1     Running     0          17h
istio-ingressgateway-898dd6645-g6jsc      1/1     Running     0          17h
istio-init-crd-10-1.3.0-shl5z             0/1     Completed   0          17h
istio-init-crd-11-1.3.0-rmqjl             0/1     Completed   0          17h
istio-init-crd-12-1.3.0-nckdw             0/1     Completed   0          17h
istio-pilot-7cf68bfd87-fdwx5              2/2     Running     0          17h
istio-policy-7cf59b54db-pq27s             2/2     Running     0          17h
istio-sidecar-injector-5796d5b447-qgnx4   1/1     Running     0          17h
istio-telemetry-8cbc98d59-v5pl4           2/2     Running     0          17h
istio-tracing-d4f8cdf58-2jbdg             1/1     Running     0          16h
kiali-c5965f96c-pdhg9                     1/1     Running     0          15h
prometheus-5b68448dc9-pl9qf               1/1     Running     0          17h
# 所有pod 状态正常 
#边车升级 
#在控制平面升级之后,已经运行Istio的应用程序仍将使用较旧的边车。要升级边车,您需要重新注入它。
#如果您正在使用自动边车注入,您可以通过对所有吊舱进行滚动更新来升级边车,以便自动重新注入新版本的边车。
kubectl rollout restart deployment nginx --namespace default
kubectl get pod -n default | grep nginx
root@Qist:/mnt/f# kubectl get pod -n default | grep nginx
nginx-v1-54dffc665c-gv29t   3/3     Running   0          15h
nginx-v1-54dffc665c-kxp89   3/3     Running   0          15h
nginx-v2-688f8f54d7-fw54c   3/3     Running   0          15h
nginx-v2-688f8f54d7-jbch3   3/3     Running   0          15h
# 查看 pod nginx-v2-688f8f54d7-jbch3 边车是否最新
kubectl describe pod pod nginx-v2-688f8f54d7-jbch3| grep proxyv2
root@Qist:/mnt/f# kubectl describe pod pod nginx-v2-688f8f54d7-jbch3| grep proxyv2
Error from server (NotFound): pods "pod" not found
    Image:         docker.io/istio/proxyv2:1.3.0
    Image ID:      docker-pullable://istio/proxyv2@sha256:f3f68f9984dc2deb748426788ace84b777589a40025085956eb880c9c3c1c056
# 已经是最新版本1.3.0 至此       istio 升级安装完成

istio 完整安装

# 需要修改的配置参考 升级
# istio-init 安装
helm install install/kubernetes/helm/istio-init --name-template istio-init --namespace istio-system
kubectl get crds | grep 'istio.io' | wc -l
# istio 安装
helm install install/kubernetes/helm/istio --name-template istio --namespace istio-system  \
--set gateways.istio-ingressgateway.type=ClusterIP   \
--set gateways.istio-egressgateway.enabled=true \
--set gateways.istio-ingressgateway.serviceAnnotations={'kubernetes.io/ingress.class: traefik,traefik.ingress.kubernetes.io/affinity: true,traefik.ingress.kubernetes.io/load-balancer-method: drr'}  \
--set mixer.policy.enabled=true \
--set grafana.enabled=true \
--set grafana.ingress.enabled=true \
--set grafana.ingress.hosts={"gr.xxxx.com"} \
--set grafana.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \
--set grafana.contextPath=/ \
--set prometheus.ingress.enabled=true \
--set prometheus.ingress.hosts={"pr.xxxx.com"} \
--set prometheus.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \
--set prometheus.contextPath=/ \
--set tracing.enabled=true \
--set tracing.ingress.enabled=true \
--set tracing.ingress.hosts={"tracing.xxxx.com"} \
--set tracing.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \
--set tracing.contextPath=/ \
--set kiali.enabled=true \
--set kiali.ingress.enabled=true \
--set kiali.ingress.hosts={"kiali.xxxx.com"} \
--set kiali.ingress.annotations={"kubernetes.io/ingress.class: traefik"} \
--set kiali.contextPath=/ \
--set kiali.dashboard.viewOnlyMode=true \
--set kiali.dashboard.grafanaURL=http://gr.xxxx.com \
--set kiali.dashboard.jaegerURL=http://tracing.xxxx.com \
--set kiali.createDemoSecret=true \
--set istio_cni.enabled=true   \
--set istio-cni.cniBinDir=/apps/cni/bin   \
--set istio-cni.excludeNamespaces={"istio-system,monitoring,kubernetes-dashboard,kube-system"}  \
--set global.k8sIngress.enabled=true \
--set global.proxy.clusterDomain="xxxx.local" \
--set global.proxy.accessLogFile="/dev/stdout" \
--set global.proxy.logLevel="info" \
--set global.disablePolicyChecks=false \
--set global.proxy.autoInject=disabled
# istio-cni 安装
helm install install/kubernetes/helm/istio-cni --name-template istio-cni --namespace istio-system \
--set cniBinDir=/apps/cni/bin   \
--set excludeNamespaces={"istio-system,monitoring,kubernetes-dashboard,kube-system"}

最新 展示截图

kiali

istio 升级到1.3.0版本
istio 升级到1.3.0版本

jaeger

istio 升级到1.3.0版本

grafana

istio 升级到1.3.0版本
istio 升级到1.3.0版本
istio 升级到1.3.0版本

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI