正如我在 cmets 中提到的,我在 istio discuss 上关注了一个关于由@laurentiuspurba 创建的升级的主题。
我针对您的用例做了一些改动,所以从 1.4 升级到 1.5。
看看下面的步骤。
1.关注 istio documentation 并安装 istioctl 1.4 和 1.5:
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.4.0 sh -
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.5.0 sh -
2.将 istioctl 1.4 添加到您的路径
cd istio-1.4.0
export PATH=$PWD/bin:$PATH
3.安装 istio 1.4
istioctl manifest generate > $HOME/generated-manifest.yaml
kubectl create namespace istio-system
kubectl apply -f generated-manifest.yaml
4.检查是否一切正常。
kubectl get pod -n istio-system
kubectl get svc -n istio-system
istioctl version
5.将 istioctl 1.5 添加到您的路径
cd istio-1.5.0
export PATH=$PWD/bin:$PATH
6.安装istio operator以备将来升级。
istioctl operator init
7.准备 IstioOperator.yaml
nano IstioOperator.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: example-istiocontrolplane
spec:
profile: default
tag: 1.5.0
8.升级前使用以下命令
kubectl -n istio-system delete service/istio-galley deployment.apps/istio-galley
kubectl delete validatingwebhookconfiguration.admissionregistration.k8s.io/istio-galley
9.使用 istioctl upgrade 从 1.4 升级到 1.5 并准备好 IstioOperator.yaml
istioctl upgrade -f IstioOperator.yaml
10.升级后使用以下命令
kubectl -n istio-system delete deployment istio-citadel istio-galley istio-pilot istio-policy istio-sidecar-injector istio-telemetry
kubectl -n istio-system delete service istio-citadel istio-policy istio-sidecar-injector istio-telemetry
kubectl -n istio-system delete horizontalpodautoscaler.autoscaling/istio-pilot horizontalpodautoscaler.autoscaling/istio-telemetry
kubectl -n istio-system delete pdb istio-citadel istio-galley istio-pilot istio-policy istio-sidecar-injector istio-telemetry
kubectl -n istio-system delete deployment istiocoredns
kubectl -n istio-system delete service istiocoredns
11.检查是否一切正常。
kubectl get pod -n istio-system
kubectl get svc -n istio-system
istioctl version
12.我已经部署了一个 bookinfo 应用来检查一切是否正常。
kubectl label namespace default istio-injection=enabled
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
13.结果
curl -v xx.xx.xxx.xxx/productpage | grep HTTP
HTTP/1.1 200 OK
istioctl version
client version: 1.5.0
control plane version: 1.5.0
data plane version: 1.5.0 (8 proxies)
希望你觉得这很有用。如果您有任何问题,请告诉我。