kubernetes部署istio

  sre


中文文档:https://preliminary.istio.io/zh/docs/setup/kubernetes/quick-start/

下包

先上代理,以防下包超时

export http_proxy=’http://192.168.2.2:1080′
export https_proxy=’http://192.168.2.2:1080′
export ftp_proxy=’http://192.168.2.2:1080′

执行脚本下包curl -L https://git.io/getLatestIstio | sh -

#加入环境变量
[root@node01 istio-1.0.6]# export PATH=PWD/bin:PATH
[root@node01 istio-1.0.6]# ls
bin  install  istio.VERSION  LICENSE  README.md  samples  tools

在 install/ 目录中包含了 Kubernetes 安装所需的 .yaml 文件
samples/ 目录中是示例应用
istioctl 客户端文件保存在 bin/ 目录之中。istioctl 的功能是手工进行 Envoy Sidecar 的注入
istio.VERSION 配置文件

安装kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml

增加ingress代理访问:

kind: Ingress
apiVersion: extensions/v1beta1
metadata: 
    name: istio-grafana
    namespace: istio-system
    annotations:
        kubernetes.io/ingress.class: traefik
spec:
    rules:
    -   host: istio.netinn.net
        http:
            paths:
            -   backend:
                    serviceName: grafana
                    servicePort: 3000
                path: /

附-下载脚本内容为:

#!/bin/sh
#
# Early version of a downloader/installer for Istio
#
# This file will be fetched as: curl -L https://git.io/getLatestIstio | sh -
# so it should be pure bourne shell, not bash (and not reference other scripts)
#
# The script fetches the latest Istio release candidate and untars it.
# It's derived from ../downloadIstio.sh which is for stable releases but lets
# users do curl -L https://git.io/getLatestIstio | ISTIO_VERSION=0.3.6 sh -
# for instance to change the version fetched.

# This is the latest release candidate (matches ../istio.VERSION after basic
# sanity checks)

OS="(uname)"
if [ "x{OS}" = "xDarwin" ] ; then
  OSEXT="osx"
else
  # TODO we should check more/complain if not likely to work, etc...
  OSEXT="linux"
fi

if [ "x{ISTIO_VERSION}" = "x" ] ; then
  ISTIO_VERSION=(curl -L -s https://api.github.com/repos/istio/istio/releases/latest | \
                  grep tag_name | sed "s/ *\"tag_name\": *\"\\(.*\\)\",*/\\1/")
fi

if [ "x{ISTIO_VERSION}" = "x" ] ; then
  echo "Unable to get latest Istio version. Set ISTIO_VERSION env var and re-run. For example: export ISTIO_VERSION=1.0.4"
  exit;
fi

NAME="istio-ISTIO_VERSION"
URL="https://github.com/istio/istio/releases/download/{ISTIO_VERSION}/istio-{ISTIO_VERSION}-{OSEXT}.tar.gz"
echo "DownloadingNAME from URL ..."
curl -L "URL" | tar xz
# TODO: change this so the version is in the tgz/directory name (users trying multiple versions)
echo "Downloaded into NAME:"
ls "NAME"
BINDIR="(cd "NAME/bin" && pwd)"
echo "Add BINDIR to your path; e.g copy paste in your shell and/or ~/.profile:"
echo "export PATH=\"\$PATH:BINDIR\""

LEAVE A COMMENT

Captcha Code