美文网首页
istio 通过 helm template 安装

istio 通过 helm template 安装

作者: Yellowtail | 来源:发表于2018-09-28 19:14 被阅读0次

    0. 概述

    【istio版本】1.0.1
    【Kubernetes版本】1.11.2
    之所以使用helm template来安装,是因为控制一些配置项比较方便

    1. 下载安装包

    cd /root/
    curl -L https://github.com/istio/istio/releases/download/1.0.1/istio-1.0.1-linux.tar.gz -o istio-1.0.1-linux.tar.gz --progress
    tar vzxf istio-1.0.1-linux.tar.gz
    

    如果直接下载最新版是curl -L https://git.io/getLatestIstio | sh -
    不过最新版本号是1.1.0,我没有用过,不敢保证一模一样,就不在这里乱写了

    2. 添加到path

    export PATH=$PWD/bin:$PATH

    不过这样做,每次重新登录这个设置就失效了;
    如果想一劳永逸,可以添加到.bash_profile

    vi /root/.bash_profile
    在 倒数第二行添加以下内容
    PATH=$PATH:/root/istio-1.0.1/bin
    退出保存

    并应用该profile
    source ~/.bash_profile

    3. 创建istio 安装到的命名空间

    kubectl create ns istio
    

    注意:默认的是istio-system,我这里不想使用默认的,所以就建了一个新的,
    如果想使用默认的,那么就应该新建一个istio-system

    4. 更新CDR

    cd istio-1.0.1
    kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml -n istio
    

    5. 安装

    5.1 生成清单

    helm template install/kubernetes/helm/istio --name my-istio --namespace istio   \
    --set global.tag=1.0.0 \
    --set global.hub=registry.cn-hangzhou.aliyuncs.com/aliacs-app-catalog \
    --set global.hyperkube.hub=registry.cn-hangzhou.aliyuncs.com/aliacs-app-catalog \
    --set sidecarInjectorWebhook.enabled=true \
    --set pilot.enabled=true \
    --set grafana.enabled=true \
    --set grafana.service.type=LoadBalancer \
    > ./001-my-istio.yaml
    

    注意,只安装了一个监控工具:grafana
    之所以这么做,是因为只有grafana可以一步安装到位,其他的工具会出现各种各样的问题,所以就算了
    如果需要其他工具,可以查看我的其他文章

    另外,还打开了自动注入,很好用的一个功能
    还有就是换了下镜像仓库地址为阿里的,默认是国外的,有时会pull不下来

    5.2 修改gateway

    #1.check
    cat 001-my-istio.yaml |grep "istio-system"
    #2.modify
    sed -i 's/istio-system/istio/g' 001-my-istio.yaml
    #3.check
    cat 001-my-istio.yaml |grep "istio-system"
    

    注意,namespace如果不是istio写死的istio-system,,生成的yaml里面,
    gatewaynamespace还是默认的istio-system,安装的时候会导致报错,
    所以需要手动执行命令去修改一下
    目前在版本1.0.1里发现了这个BUG,后续版本不知道有没有改过来

    5.3 安装部署

    kubectl create -f ./001-my-istio.yaml
    

    预期输出不出现任何error

    6. 卸载

    如果安装出错了,可以在找到问题后,卸载、重装

    kubectl delete -f ./001-my-istio.yaml
    

    7. 查询可以被外网访问的ip和端口

    我用的是阿里的k8s集群服务,页面可以查询


    image

    当然了,命令行也是可以的

    kubectl get svc -n istio
    
    image.png

    相关文章

      网友评论

          本文标题:istio 通过 helm template 安装

          本文链接:https://www.haomeiwen.com/subject/bmzpoftx.html