官网:https://istio.io/latest/zh/docs/setup/install/helm/
1、修改文件
sudo vim /etc/kubernetes/manifests/kube-apiserver.yaml
- --service-account-issuer=api
- --service-account-api-audiences=api,vault,factors
- --feature-gates=RemoveSelfLink=false
- --service-account-signing-key-file=/etc/kubernetes/pki/sa.key
2、创建 namespace
kubectl create namespace istio-system
3
、添加 helm 源
helm repo add istio https://istio-release.storage.googleapis.com/charts
helm repo list
helm repo update
4、 安装 Istio Base Chart
helm install istio-base istio/base -n istio-system --set defaultRevision=default
5、查看
helm ls -n istio-system
6
、安装 Istio Discovery Chart,它用于部署 istiod 服务
helm install istiod istio/istiod -n istio-system
7
、安装 gateway
kubectl create namespace istio-ingress
helm install istio-ingress istio/gateway -n istio-ingress
8、验证
创建 nginx
-rw-rw-r-- 1 keda keda 709 12月 10 15:16 nginx-VirtualService.yaml
keda@citc-OpenStack-Nova:~/istio$ cat nginx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: oicc.eu.org/nginx:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
创建一个 Istio IngressGateway 和 VirtualService
keda@citc-OpenStack-Nova:~/istio$ cat nginx-VirtualService.yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: nginx-gateway
spec:
selector:
istio: ingress # 使用 Istio 默认的 IngressGateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: nginx
spec:
hosts:
- "*"
gateways:
- nginx-gateway
http:
- match:
- uri:
exact: /nginx
rewrite:
uri: /
route:
- destination:
host: nginx
port:
number: 80