Istio 安装与使用


1. 前提要求


  1. 官网安装:虚拟机安装
  2. minukube: minikube start

2. istio安装

安装Istio相对比较简单,官网也提供了详细的安装步骤, 参考链接:Istio getting started

  1. Istioctl 安装
  2. Operator 方式的安装
  3. Helm 安装(已被弃用)

3. Istioctl 安装

3.1. 下载istio

curl -L | sh -

cd istio-1.19.3

3.2. 添加istioctl到PATH

export PATH=$PWD/bin:$PATH

3.3. 安装istio

istioctl install --set profile=demo -y

3.4. 注入k8s namespace

kubectl label namespace default istio-injection=enabled

4 Istio配置文件

参考链接: Istio-Installation Configuration Profiles

4.1 Istio内建配置文件

  1. default: enables components according to the default settings of the IstioOperator API. This profile is recommended for production deployments and for primary clusters in a multicluster mesh. You can display the default settings by running the istioctl profile dump command.

  2. demo: configuration designed to showcase Istio functionality with modest resource requirements. It is suitable to run the Bookinfo application and associated tasks. This is the configuration that is installed with the quick start instructions.

This profile enables high levels of tracing and access logging so it is not suitable for performance tests.
minimal: same as the default profile, but only the control plane components are installed. This allows you to configure the control plane and data plane components (e.g., gateways) using separate profiles.

  1. remote: used for configuring a remote cluster that is managed by an external control plane or by a control plane in a primary cluster of a multicluster mesh.

  2. empty: deploys nothing. This can be useful as a base profile for custom configuration.

  3. preview: the preview profile contains features that are experimental. This is intended to explore new features coming to Istio. Stability, security, and performance are not guaranteed – use at your own risk.

  4. ambient: the ambient profile is designed to help you get started with ambient mesh.

4.2 配置与组件对应


5. Istio ingress NodePort修改

由于Istio ingress Service模式方式为LoadBalancer,但是我们的可能没有LoadBalancer, 在这种情况下我们可以把istio-ingressgateway修改为NodePort, 我们使用yaml为istio-ingressgateway编写一个NodePort service, yaml文件如下:

apiVersion: v1
kind: Service
  name: istio-ingressgateway
  namespace: istio-system
  type: NodePort  #从LoadBalancer改为NodePort
  - port: 80
    targetPort: 8080
    nodePort: 31080  #指定一个NodePort
    app: istio-ingressgateway


kubectl apply -f istio-ingressgateway-nodeport.yaml


kubectl get svc -n istio-system
istio-ingressgateway   NodePort   <none>        15021:32187/TCP,80:31080/TCP,443:31818/TCP,31400:32039/TCP,15443:32064/TCP   2d20h




您的电子邮箱地址不会被公开。 必填项已用 * 标注