Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: SOFAMesh setup quick start in Kubernetes #142

Merged
merged 7 commits into from Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions content/zh/projects/sofa-mesh/_index.md
Expand Up @@ -14,10 +14,8 @@ sidebar:
link: 'pilot-readme'
- title: '安装指南'
link: 'pilot-setup-zookeeper-installation'
- title: '使用 Docker 快速开始'
link: 'pilot-setup-zookeeper-quick-start-docker'
- title: 'Zookeeper Adpater'
link: 'pilot-zookeeper-adapter'
- title: '在 Kubernetes 中快速开始'
link: 'sofa-mesh-setup'
- title: 'X-Protocol'
link: 'pilot-x-protocol'
- title: 'Register Agent'
Expand Down
82 changes: 82 additions & 0 deletions content/zh/projects/sofa-mesh/sofa-mesh-setup/index.md
@@ -0,0 +1,82 @@
---
title: "在 Kubernetes 中快速开始"
aliases: "/sofa-mesh/docs/sofa-mesh-setup"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aliases 的值可以是数组,用途是重定向,请将删除的 URL 重定向到这里,可以这样配置:

aliases: ["/sofa-mesh/docs/sofa-mesh-setup","/projects/pilot-setup-zookeeper-quick-start-docker"]

---

JamazRuan marked this conversation as resolved.
Show resolved Hide resolved


本文旨在描述如何在 Kubernetes 快速开始安装和配置 Istio。
SOFA Mosn 不仅可以支持 Istio 标准的部署模式,也能支持单方面的 Inbound Sidecar,Outbound Sidecar的部署模式,满足用户的各种需求。

## 前置要求

- Kubernetes
- 安装helm,参考:https://github.com/helm/helm/blob/master/docs/install.md

## 安装步骤

1. 下载最新的 release 包
2. 解压安装文件,并且进入解压后的路径,安装路径包含:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请不要将有序列表和无序列表混合使用,将导致HTML渲染错误。

- 示例应用路径 `samples/`
- /bin 路径下应该能找到 istioctl 客户端可执行文件,istioctl 可用于创建路由规则和策略
- 配置文件 istion.VERSION
3. 把 Istio 的 bin 路径添加到系统的 PATH。比如,在 Linux 系统下执行如下命令:
```bash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

列表中不要出现代码片段,将导致 HTML 渲染错误。

export PATH=$PWD/bin;$PATH
```

4. 创建命名空间

```bash
kubectl create namespace istio-system
```

5. 使用helm安装istio CRD

```bash
helm template install/kubernetes/helm/istio-init --name istio-init --namespace istio-system | kubectl apply -f -
```

6. 使用helm安装各个组件

```bash
helm template install/kubernetes/helm/istio --name istio --namespace istio-system | kubectl apply -f -
```

7. 确认所有 pod 都在运行中

```bash
kubectl get pod -n istio-system
```


## 部署应用程序

现在开始部署 Bookinfo 示例程序
为 default 命名空间打上标签 istio-injection=enabled,实现 Sidecar 自动注入

```bash
kubectl label namespace default istio-injection=enabled
```

使用 kubectl 部署Bookinfo的服务

```bash
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
```

确认所有的服务和 Pod 都已经正确的定义和启动

```bash
kubectl get services

kubectl get pods
```

## 卸载 Istio

```bash
helm template install/kubernetes/helm/istio --name istio --namespace istio-system | kubectl delete -f -
kubectl delete namespace istio-system
```