安装
警告
建议使用Kind来安装测试环境的Kubernetes集群。
istioctl
bash
$ curl -L https://istio.io/downloadIstio | sh -
$ cd istio-1.20.1
$ export PATH=$PWD/bin:$PATH
$ chmod +x ./bin/istioctl
# 安装demo默认配置组合
istioctl install --set profile=default -y
# 提示如下信息即成功
✔ Istio core installed
✔ Istiod installed
✔ Ingress gateways installed
✔ Installation complete Made this installation the default for injection and validation.
# 查看istio的配置
$ kubectl -n istio-system get istio -o yaml
# 查看服务是否全部启动
$ kubectl -n istio-system get all
使用
istioctl
启动istio组件时,可以通过--set
来携带参数启动。也可以通过修改istio-system下的configmap: istio来实现参数修改
profile
核心组件 | default | demo | minimal | remote | empty | preview | ambient |
---|---|---|---|---|---|---|---|
istio-egressgateway | √ | ||||||
istio-ingressgateway | √ | √ | √ | ||||
istiod | √ | √ | √ | √ | √ | ||
CNI | √ | ||||||
Ztunnel | √ |
不同的profile会安装不同的组件,一般来说常用的就是
default
和demo
。
istio-operator
警告
官网:不建议在新安装时使用Operator。虽然Operator将继续得到支持,但新特性请求将不会被优先化。
初始化istio-operator
bash
$ istioctl operator init
查看istio-operator是否创建成功
bash
$ kubectl -n istio-operator get all
使用operator安装istio
bash
$ kubectl apply -f - <<EOF
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-operator-sample
spec:
profile: default
values:
global:
istioNamespace: istio-system # 配置istiod控制平面的ns
EOF
查看istio-operator资源列表
bash
$ kubectl get io -n istio-system
查看istio控制平面是否正常启动
bash
$ kubectl -n istio-system get all
卸载istio-operator
bash
$ istioctl operator remove --purge