前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >istio安装使用

istio安装使用

原创
作者头像
堕落飞鸟
发布2022-06-07 09:19:36
发布2022-06-07 09:19:36
56300
代码可运行
举报
文章被收录于专栏:飞鸟的专栏飞鸟的专栏
运行总次数:0
代码可运行

一、安装

1.1、安装istio
代码语言:javascript
代码运行次数:0
运行
复制
# 安装
# 下载
https://github.com/istio/istio/releases/download/1.13.2/istio-1.13.2-linux-amd64.tar.gz
tar -xvf istio-1.13.2-linux-amd64.tar.gz
cp /root/istio-1.13.2/bin/istioctl /usr/local/bin/
​
istioctl version
istioctl operator init
​
vim default-install.yaml
​
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
  name: istio-operator
spec:
  profile: default
  components:
    ingressGateways:
      - name: istio-ingressgateway
        enabled: true
        k8s:
          resources:
            requests:
              cpu: 200m
          serviceAnnotations:
            cloud.google.com/load-balancer-type: "internal"
          service:
            type: NodePort
            ports:
            - port: 15020
              nodePort: 30520
              name: status-port
            - port: 80
              targetPort: 8080
              nodePort: 30080
              name: http2
            - port: 443
              nodePort: 30443
              targetPort: 8443
              name: https
​
​
istioctl manifest apply -f default-install.yaml
1.2、安装kiali
代码语言:javascript
代码运行次数:0
运行
复制
# 安装kiali
cd /root/istio-1.13.2/samples/addons
kubectl apply -f kiali.yaml
​
# ingress配置
kubectl create secret tls test-secret --cert=www.test.com.crt --key=www.test.com.key -n istio-system
​
vim kiali-ingress-https.yaml
​
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: kiali
  namespace: istio-system
  annotations:
    kubernetes.io/ingress.class: "nginx"
spec:
  tls:
    - hosts:
        - kiali.test.com
      secretName: test-secret
  rules:
    - host: kiali.test.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: kiali
                port:
                  name: http
​
​
kubectl apply -f kiali-ingress-https.yaml -n istio-system
​
1.3、安装jaeger
代码语言:javascript
代码运行次数:0
运行
复制
# 安装jaeger
cd /root/istio-1.13.2/samples/addons
kubectl apply -f jaeger.yaml
1.4、安装prometheus,grafana
代码语言:javascript
代码运行次数:0
运行
复制
# 安装prometheus,grafana
cd /root/istio-1.13.2/samples/addons
kubectl apply -f prometheus.yaml
kubectl apply -f grafana.yaml
二、使用测试
2.1、部署演示项目bookinfo
代码语言:javascript
代码运行次数:0
运行
复制
# 部署演示项目bookinfo
kubectl create ns bookinfo
kubectl label ns bookinfo istio-injection=enabled
cd /root/istio-1.13.2/samples/bookinfo/platform/kube
kubectl apply -f bookinfo.yaml -n bookinfo
2.2、gateway,VirtualService配置
代码语言:javascript
代码运行次数:0
运行
复制
# ingress gateway
# 
vim bookinfo-gateway.yaml

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: bookinfo-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 443
      name: https
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: "test-secret"
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: bookinfo
spec:
  hosts:
  - "bookinfo.test.com"
  gateways:
  - bookinfo-gateway
  http:
  - match:
    - uri:
        exact: /productpage
    - uri:
        prefix: /static
    - uri:
        exact: /login
    - uri:
        exact: /logout
    - uri:
        prefix: /api/v1/products
    route:
    - destination:
        host: productpage
        port:
          number: 9080

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、安装
    • 1.1、安装istio
    • 1.2、安装kiali
    • 1.3、安装jaeger
    • 1.4、安装prometheus,grafana
    • 二、使用测试
      • 2.1、部署演示项目bookinfo
      • 2.2、gateway,VirtualService配置
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档