Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Layotto_飞船_YoungMa962' into Layo…
Browse files Browse the repository at this point in the history
…tto_飞船_YoungMa962
  • Loading branch information
YoungMa962 committed Jun 17, 2022
2 parents 042d848 + d3865b9 commit 67cb53c
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/layotto-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ jobs:
- name: Push Image to DockerHub
run: |
make image.push.linux_amd64.layotto VERSION=latest
- name: Build layotto/proxyv2:latest Image
run: |
make image.proxyv2.build VERSION=latest
- name: Push layotto/proxyv2:latest Image to DockerHub
run: |
make image.proxyv2.push VERSION=latest
build-push-linux-arm64-image:
name: "🎉 Linux ARMD64 Image"
Expand Down
2 changes: 2 additions & 0 deletions docker/proxyv2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM mosnio/proxyv2:v1.0.0-1.10.6
COPY ./layotto /usr/local/bin/mosn
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
- [Zookeeper](en/component_specs/sequencer/zookeeper.md)
- [MongoDB](en/component_specs/sequencer/mongo.md)
- [Secret Store](en/component_specs/secret/common.md)
- [How to deploy and upgrade Layotto](en/operation/)
- Design documents
- [Actuator design doc](en/design/actuator/actuator-design-doc.md)
- [Configuration API with Apollo](en/design/configuration/configuration-api-with-apollo.md)
Expand Down
78 changes: 78 additions & 0 deletions docs/en/operation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# How to deploy and upgrade Layotto

## 1. Deploy Layotto

There are some ways to deploy Layotto that you can find below.

- Deploy using released binaries
- Deploy using Docker
- Deploy on Kubernetes

### Deploy Layotto using released binaries

You can start Layotto directly via executing the binary file. Refer to the [Quick start](en/start) guide.

### Deploy using Docker

You can run Layotto using the official Docker images.Currently include:

- [layotto/layotto](https://hub.docker.com/repository/docker/layotto/layotto)
- [layotto/layotto.arm64](https://hub.docker.com/repository/docker/layotto/layotto.arm64)

It does not contain a `config.json` configuration file in the image, you can mount your own configuration file into the `/runtime/configs/` directory of the image. For example.

```shell
docker run -v "$(pwd)/configs/config.json:/runtime/configs/config.json" -d -p 34904:34904 --name layotto layotto/layotto start
```

Of course, you can also run Layotto and other systems (such as Redis) at the same time via docker-compose. Refer to the [Quick start](en/start/state/start?id=step-1-deploy-redis-and-layotto)

### Deploy on Kubernetes

#### Option 1. Deploy via Istio

If you are using Istio now, you can deploy the Sidecar via Istio.

You can refer to [MOSN guide](https://mosn.io/docs/user-guide/start/istio/). Just replace the MOSN image in the tutorial with a Layotto image.

#### Option 2. Other ways

You can prepare your own image and k8s configuration file, then deploy Layotto via Kubernetes.

We are working on the official Layotto image and the solution for deploying to Kubernetes using Helm, so feel free to join us to build it. More details in <https://github.com/mosn/layotto/issues/392>

## 2.Toggle existing MOSN to Layotto for MOSN users

Existing MOSN can be upgraded to Layotto by replacing the MOSN sidecar image with Layotto image.

Explanation:

Layotto and MOSN are running in the same process, which can be understood as:

> Layotto == MOSN + a special grpcFilter packaged together
So.

> replace MOSN with Layotto == replace MOSN with "MOSN + a special grpcFilter"
There is no essential difference between Layotto and MOSN, just pay attention to the versions of them, which must correspond to each other.

The previously released Layotto v0.3.0 corresponds to MOSN version v0.24.1

## 3. How to upgrade Layotto

There are two options to upgrade.

- Upgrade sidecar container using k8s native solution

- [Hot upgrade: upgrade the sidecar without affecting the business](https://mosn.io/en/docs/concept/smooth-upgrade/)

The advantage of hot upgrade is that it can automatically migrate persistent connections, which can be seen in detail by clicking the above document.

The solutions to achieve hot upgrade are as follows:

- Register a SIGHUP event listener with MOSN, and send a SIGHUP signal to the MOSN process to call ForkExec to generate a new MOSN process.

- Directly start a new MOSN process.

- [Hot upgrade using OpenKruise](https://mosn.io/blog/posts/mosn-sidecarset-hotupgrade/)
2 changes: 1 addition & 1 deletion docs/zh/start/configuration/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ docker-compose up -d
```

#### **本地编译(不适合 Windows)**
您可以使用 Docker 运行 MinIO,然后本地编译、运行 Layotto。
您可以使用 Docker 运行 etcd,然后本地编译、运行 Layotto。

> [!TIP|label: 不适合 Windows 用户]
> Layotto 在 Windows 下会编译失败。建议 Windows 用户使用 docker-compose 部署
Expand Down
9 changes: 9 additions & 0 deletions make/image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ image.build: image.verify $(addprefix image.build., $(addprefix $(IMAGE_PLAT).,
.PHONY: image.build.multiarch
image.build.multiarch: image.verify $(foreach p,$(IMAGE_PLATFORMS),$(addprefix image.build., $(addprefix $(p)., $(IMAGES))))

.PHONY: image.proxyv2.build
image.proxyv2.build: go.build.linux_amd64.layotto
cp $(OUTPUT_DIR)/linux/amd64/layotto $(ROOT_DIR)/docker/proxyv2
cd $(ROOT_DIR)/docker/proxyv2 && $(DOCKER) build --no-cache --rm -t layotto/proxyv2:$(VERSION) .

.PHONY: image.proxyv2.push
image.proxyv2.push:
$(DOCKER) push layotto/proxyv2:$(VERSION)

.PHONY: image.build.%
image.build.%: go.build.%
$(eval IMAGE := $(COMMAND))
Expand Down

0 comments on commit 67cb53c

Please sign in to comment.