Merge pull request #565 from BinaryHB0916/offline-deployment-practice
Offline deployment practice
This commit is contained in:
commit
a8c17a5806
|
|
@ -4,7 +4,7 @@ author: Lei Zhang and Fei Guo
|
|||
author_title: CNCF TOC Member/Kubernetes
|
||||
author_url: https://github.com/JoelMarcey
|
||||
author_image_url: https://avatars.githubusercontent.com/u/1701782?s=200&v=4
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: The Extensible App Platform Based on Open Application Model and Kubernetes
|
||||
image: https://tva1.sinaimg.cn/large/ad5fbf65gy1glgj5q8inej208g049aa6.jpg
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ author: Da Yin, Yang Song, Zhengxi Zhou and Jianbo Sun
|
|||
author_title: KubeVela Team
|
||||
author_url: https://github.com/oam-dev/kubevela
|
||||
author_image_url: https://kubevela.io/img/logo.svg
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: KubeVela is demonstrated to be able to host thousands of applications effectively with limited resources.
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ author: Da Yin, Yang Song
|
|||
author_title: KubeVela Team
|
||||
author_url: https://github.com/oam-dev/kubevela
|
||||
author_image_url: https://kubevela.io/img/logo.svg
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ author: Tianxin Dong
|
|||
author_title: KubeVela Team
|
||||
author_url: https://github.com/oam-dev/kubevela
|
||||
author_image_url: https://kubevela.io/img/logo.svg
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ author: Tianxin Dong
|
|||
author_title: KubeVela team
|
||||
author_url: https://github.com/oam-dev/kubevela
|
||||
author_image_url: https://kubevela.io/img/logo.svg
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -0,0 +1,129 @@
|
|||
---
|
||||
title: China Merchants Bank's Practice on Offline Installation with KubeVela
|
||||
author: Xiangbo Ma
|
||||
author_title: (Cloud platform development team)
|
||||
author_url: http://www.cmbchina.com/
|
||||
author_image_url: /img/china-merchants-bank.jpg
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/KubeVela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
---
|
||||
|
||||
The cloud platform development team of China Merchants Bank has been trying out KubeVela since 2021 internally and aims to using it for enhancing our primary application delivery and management capabilities. Due to the specific security concern for financial insurance industry, network control measurements are relatively strict, and our intranet cannot directly pull Docker Hub image, and there is no Helm image source available as well. Therefore, in order to landing KubeVela in the intranet, you must perform a complete offline installation.
|
||||
|
||||
This article will take the KubeVela V1.2.5 version as an example, introduce the offline installation practice to help other users easier to complete KubeVela's deployment in offline environment.
|
||||
|
||||
## KubeVela Offline Installation Solution
|
||||
|
||||
We divide the offline installation of KubeVela in three parts, which are Vela CLI, Vela Core, and Addon offline installation. Each part mainly involves the loading of the relevant Docker image and Helm's package, which can greatly speed up deployment process in offline environment.
|
||||
|
||||
Before doing so, please ensure that Kubernetes cluster version is `>= v1.19 && < v1.22`. One way of KubeVela as a control plane relies on Kubernetes, which can be placed in any product or in any cloud provider. At the same time, you can also use Kind or Minikube to deploy KubeVela locally.
|
||||
|
||||
### Vela CLI Offline Installation
|
||||
|
||||
- First, you need to download of the binary version of `vela` that you want by checking KubeVela [Release Log](https://github.com/oam-dev/kubevela/releases)
|
||||
- Unzip binary files and configure the appropriate environment variables in `$PATH`
|
||||
- Unzip binary file
|
||||
- `tar -zxvf vela-v1.2.5-linux-amd64.tar.gz`
|
||||
- `mv ./linux-amd64/vela /usr/local/bin/vela`
|
||||
- Set environment variables
|
||||
- `vi /etc/profile`
|
||||
- `export PATH="$PATH:/usr/local/bin"`
|
||||
- `source /etc/profile`
|
||||
- Verify the installation of Vela CLI through `vela version`
|
||||
```shell
|
||||
CLI VERSION: V1.2.5
|
||||
Core Version:
|
||||
GitRevision: git-ef80b66
|
||||
GOLANGVERSION: Go1.17.7
|
||||
```
|
||||
|
||||
- At this point, Vela CLI has been deployed offline!
|
||||
|
||||
### Vela Core Offline Installation
|
||||
|
||||
- Before deploying Vela Core offline, first you need to install [Helm](https://helm.sh/docs/intro/install/) in an offline environment and its version needs to meet `v3.2.0+`
|
||||
- Prepare Docker image. Vela Core's deployment mainly involves 5 images, you need to first visit the Docker Hub in extranet to download the corresponding images, then load them to offline environment
|
||||
- Pull the image from Docker Hub
|
||||
- `docker pull oamdev/vela-core:v1.2.5`
|
||||
- `docker pull oamdev/cluster-gateway:v1.1.7`
|
||||
- `docker pull oamdev/kube-webhook-certgen:v2.3`
|
||||
- `docker pull oamdev/alpine-k8s:1.18.2`
|
||||
- `docker pull oamdev/hello-world:v1`
|
||||
- Save image to local disks
|
||||
- `docker save -o vela-core.tar oamdev/vela-core:v1.2.5`
|
||||
- `docker save -o cluster-gateway.tar oamdev/cluster-gateway:v1.1.7`
|
||||
- `docker save -o kube-webhook-certgen.tar oamdev/kube-webhook-certgen:v2.3`
|
||||
- `docker save -o alpine-k8s.tar oamdev/alpine-k8s:1.18.2`
|
||||
- `docker save -o hello-world.tar oamdev/hello-world:v1`
|
||||
- Re-load the image in the offline environment
|
||||
- `docker load vela-core.tar`
|
||||
- `docker load cluster-gateway.tar`
|
||||
- `docker load kube-webhook-certgen.tar`
|
||||
- `docker load alpine-k8s.tar`
|
||||
- `docker load hello-world.tar`
|
||||
- Download [KubeVela Core](https://github.com/oam-dev/KubeVela/releases), copy it to offline environment and use Helm to repackage
|
||||
- Repackage the KubeVela source code and install the chart package to the control cluster offline
|
||||
- `helm package kubevela/charts/vela-core --destination kubevela/charts`
|
||||
- `helm install --create-namespace -n vela-system kubevela kubevela/charts/vela-core-0.1.0.tgz --wait`
|
||||
- Check the output
|
||||
```shell
|
||||
KubeVela Control Plane Has Been successfully set up on your cluster.
|
||||
```
|
||||
|
||||
- At this point, Vela Core has been deployed offline!
|
||||
|
||||
### Addon Offline Installation
|
||||
|
||||
- First download [Catalog Source](https://github.com/oam-dev/catalog) and copy it to offline environment
|
||||
- Here, we will take VelaUX, one of many more addons, as an example. First prepare its Docker image, VelaUX mainly involve 2 images, you need to first access the extranet to download the corresponding image from Docker Hub, then load it to offline environment
|
||||
- Pull the image from Docker Hub
|
||||
- `docker pull oamdev/vela-apiserver:v1.2.5`
|
||||
- `docker pull oamdev/velaux:v1.2.5`
|
||||
- Save image to local disks
|
||||
- `docker save -o vela-apiserver.tar oamdev/vela-apiserver:v1.2.5`
|
||||
- `docker save -o velaux.tar oamdev/velaux:v1.2.5`
|
||||
- Re-load the image in the offline environment
|
||||
- `docker load vela-apiserver.tar`
|
||||
- `docker load velaux.tar`
|
||||
- Install VelaUX
|
||||
- Install VelaUX via Vela CLI
|
||||
- `vela addon enable catalog-master/addons/velaux`
|
||||
- Check the output
|
||||
```shell
|
||||
Addon: velaux enabled Successfully.
|
||||
```
|
||||
|
||||
- If there is a cluster installed route Controller or Nginx Ingress Controller and also linked with an available domain, you can deploy external routing to make VelaUX accessible. Here present Openshift Route as an example, you can also choose Ingress if you wish
|
||||
```yaml
|
||||
apiVersion: route.openshift.io/v1
|
||||
kind: Route
|
||||
metadata:
|
||||
name: velaux-route
|
||||
namespace: vela-system
|
||||
spec:
|
||||
host: velaux.xxx.xxx.cn
|
||||
port:
|
||||
targetPort: 80
|
||||
to:
|
||||
kind: Service
|
||||
name: velaux
|
||||
weight: 100
|
||||
wildcardPolicy: None
|
||||
```
|
||||
|
||||
- Check the installation
|
||||
```shell
|
||||
curl -I -m 10 -o /dev/null -s -w %{http_code} http://velaux.xxx.xxx.cn/applications
|
||||
```
|
||||
|
||||
- At this point, VelaUX has been deployed offline! At the same time, for other types of Addon's offline deployment, access to the corresponding directory of the [Catalog Source](https://github.com/oam-dev/catalog) and repeat the above moves, you would complete all the addons' offline deployments for good.
|
||||
|
||||
## Summarize
|
||||
|
||||
During offline deployment, we also try to save Vela Core and Addon's resource that generated to be YAML files after deploying in extranet and re-deploy them in an offline environment, but because of all different kinds of resource involved in and it requires many other authorization issues to resolve, this way is more than cumbersome.
|
||||
|
||||
With this practice of KubeVela's offline deployment , we hope it help you build a complete set of KubeVela in offline environment much faster. Offline installation is pretty much a pain point for most developers, we also see that the KubeVela community is introducing the brand new [velad](https://github.com/oam-dev/elad), a fully offline, highly accountable installation tool. Velad can help automate completion by making many steps as one, such as preparing clusters, downloading and packing image, installing and etc. Further more, it do support many features: In Linux machine (such as Alibaba Cloud ECS) we can locally spin up a cluster to install Vela-Core; while starting a KubeVela control plane, do not have to worry about its data to be lost when machine behind it accidentally was shutdown; Velad can stores all the data from control plane cluster into a traditional database (such as MySQL deployed on another ECS).
|
||||
|
||||
In the recent version to come, China Merchants Bank will increase the efforts in the open source community of KubeVela, actively building: enterprise-level capacity, enhancement on multi-cluster, offline deployment and application-level observability. We'll also be contributing the financial industry's user scenarios and business needs, driving cloud-native ecology achieve more easily and efficient application management experience, and at last but not at least, welcome you the community member to join us together in this journey.
|
||||
|
|
@ -4,7 +4,7 @@ author: Lei Zhang and Fei Guo
|
|||
author_title: CNCF TOC Member/Kubernetes
|
||||
author_url: https://github.com/resouer
|
||||
author_image_url: https://avatars.githubusercontent.com/u/1701782?s=200&v=4
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: The Extensible App Platform Based on Open Application Model and Kubernetes
|
||||
image: https://tva1.sinaimg.cn/large/ad5fbf65gy1glgj5q8inej208g049aa6.jpg
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ author: Da Yin, Yang Song
|
|||
author_title: KubeVela 团队
|
||||
author_url: https://github.com/oam-dev/kubevela
|
||||
author_image_url: https://kubevela.io/img/logo.svg
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ author: Tianxin Dong
|
|||
author_title: KubeVela 团队
|
||||
author_url: https://github.com/oam-dev/kubevela
|
||||
author_image_url: https://kubevela.io/img/logo.svg
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ author: Tianxin Dong
|
|||
author_title: KubeVela 团队
|
||||
author_url: https://github.com/oam-dev/kubevela
|
||||
author_image_url: https://kubevela.io/img/logo.svg
|
||||
tags: [ kubevela ]
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
|
|
|
|||
|
|
@ -0,0 +1,129 @@
|
|||
---
|
||||
title: 招商银行 KubeVela 离线部署实践
|
||||
author: 马祥博
|
||||
author_title: (云平台开发团队)
|
||||
author_url: http://www.cmbchina.com/
|
||||
author_image_url: /img/china-merchants-bank.jpg
|
||||
tags: [ KubeVela ]
|
||||
description: ""
|
||||
image: https://raw.githubusercontent.com/oam-dev/kubevela.io/main/docs/resources/KubeVela-03.png
|
||||
hide_table_of_contents: false
|
||||
---
|
||||
|
||||
招商银行云平台开发团队自2021年开始接触 KubeVela,并探索 KubeVela 在招商银行云平台的落地实践,借此提升云原生应用交付与管理能力。同时因为金融保险行业的特殊性,网络安全管控措施相对严格,行内网络无法直接拉取 Docker Hub 镜像,同时行内暂时没有可用的 Helm 镜像源。因此,要想实现 KubeVela 在行内私有环境的落地,必须进行完全的离线部署。
|
||||
|
||||
本文将以 KubeVela v1.2.5 版本为例,介绍招商银行 KubeVela 的离线部署实践,来帮助其他用户在离线环境中更便捷的完成 KubeVela 的部署。
|
||||
|
||||
## KubeVela 离线部署方案
|
||||
|
||||
我们将 KubeVela 的离线部署主要分为三部分,分别是 Vela Cli、Vela Core 以及 Addon 的离线部署,每一部分主要涉及到相关 docker 镜像的加载及 Helm 的 repackage,通过该离线部署方案,能够大大加快 KubeVela 在离线环境的部署。
|
||||
|
||||
在离线部署前请确保 Kubernetes 集群版本 `>= v1.19 && < v1.22`,KubeVela 控制平面依赖 Kubernetes,可以放置在任何托管 Kubernetes 作为底座的产品或自建 Kubernetes 集群中。同时你也可以使用 kind 或 minikube 在本地部署、测试 KubeVela。
|
||||
|
||||
### Vela Cli 离线部署
|
||||
|
||||
- 首先,需要通过 KubeVela 的 [发布日志](https://github.com/oam-dev/kubevela/releases) 下载你所需版本的 `vela` 二进制文件
|
||||
- 解压二进制文件,并且在 `$PATH` 中配置相应的环境变量
|
||||
- 解压二进制文件
|
||||
- `tar -zxvf vela-v1.2.5-linux-amd64.tar.gz`
|
||||
- `mv ./linux-amd64/vela /usr/local/bin/vela`
|
||||
- 设置环境变量
|
||||
- `vi /etc/profile`
|
||||
- `export PATH="$PATH:/usr/local/bin"`
|
||||
- `source /etc/profile`
|
||||
- 通过 `vela version` 验证 Vela Cli 的安装,并检查输出
|
||||
```shell
|
||||
CLI Version: v1.2.5
|
||||
Core Version:
|
||||
GitRevision: git-ef80b66
|
||||
GolangVersion: go1.17.7
|
||||
```
|
||||
|
||||
- 至此,Vela Cli 已经离线部署完成!
|
||||
|
||||
### Vela Core 离线部署
|
||||
|
||||
- 离线部署 Vela Core 之前,首先需要在离线环境中 [安装 Helm](https://helm.sh/docs/intro/install/) , 并且 Helm 的版本需要满足`v3.2.0+`
|
||||
- 准备 docker 镜像, Vela Core 的部署主要涉及5个镜像,你需要首先访问互联网从 Docker Hub 下载相应镜像,之后再 load 到离线环境
|
||||
- 从Docker Hub拉取镜像
|
||||
- `docker pull oamdev/vela-core:v1.2.5`
|
||||
- `docker pull oamdev/cluster-gateway:v1.1.7`
|
||||
- `docker pull oamdev/kube-webhook-certgen:v2.3`
|
||||
- `docker pull oamdev/alpine-k8s:1.18.2`
|
||||
- `docker pull oamdev/hello-world:v1`
|
||||
- 将镜像保存到本地磁盘
|
||||
- `docker save -o vela-core.tar oamdev/vela-core:v1.2.5`
|
||||
- `docker save -o cluster-gateway.tar oamdev/cluster-gateway:v1.1.7`
|
||||
- `docker save -o kube-webhook-certgen.tar oamdev/kube-webhook-certgen:v2.3`
|
||||
- `docker save -o alpine-k8s.tar oamdev/alpine-k8s:1.18.2`
|
||||
- `docker save -o hello-world.tar oamdev/hello-world:v1`
|
||||
- 在私有环境中重新加载镜像
|
||||
- `docker load vela-core.tar`
|
||||
- `docker load cluster-gateway.tar`
|
||||
- `docker load kube-webhook-certgen.tar`
|
||||
- `docker load alpine-k8s.tar`
|
||||
- `docker load hello-world.tar`
|
||||
- 下载 [KubeVela 源码](https://github.com/oam-dev/kubevela/releases) ,拷贝到离线环境中,并使用 Helm 重新打包
|
||||
- 将 KubeVela 源码重新打 chart 包,并离线安装 chart 包到控制集群
|
||||
- `helm package kubevela/charts/vela-core --destination kubevela/charts`
|
||||
- `helm install --create-namespace -n vela-system kubevela kubevela/charts/vela-core-0.1.0.tgz --wait`
|
||||
- 检查输出
|
||||
```shell
|
||||
KubeVela control plane has been successfully set up on your cluster.
|
||||
```
|
||||
|
||||
- 至此,Vela Core 已经离线部署完成!
|
||||
|
||||
### Addon 离线部署
|
||||
|
||||
- 首先下载 [Catalog 源码](https://github.com/oam-dev/catalog) 并拷贝到私有环境中
|
||||
- 这里将以 VelaUX 为例介绍 Addon 的离线部署,首先准备 docker 镜像,VelaUX 主要涉及2个镜像,需要首先访问互联网从 Docker Hub 下载相应镜像,之后再 load 到离线环境
|
||||
- 从 Docker Hub 拉取镜像
|
||||
- `docker pull oamdev/vela-apiserver:v1.2.5`
|
||||
- `docker pull oamdev/velaux:v1.2.5`
|
||||
- 将镜像保存到本地磁盘
|
||||
- `docker save -o vela-apiserver.tar oamdev/vela-apiserver:v1.2.5`
|
||||
- `docker save -o velaux.tar oamdev/velaux:v1.2.5`
|
||||
- 在私有环境中重新加载镜像
|
||||
- `docker load vela-apiserver.tar`
|
||||
- `docker load velaux.tar`
|
||||
- 安装 VelaUX
|
||||
- 通过 Vela Cli 安装VelaUX
|
||||
- `vela addon enable catalog-master/addons/velaux`
|
||||
- 检查输出
|
||||
```shell
|
||||
Addon: velaux enabled Successfully.
|
||||
```
|
||||
|
||||
- 若有集群中安装了 route Controller 或 Nginx Ingress Controller,且有可用域名,你可以部署外部路由访问 VelaUX,这里以 openshift route 为例,也可以选择 ingress
|
||||
```yaml
|
||||
apiVersion: route.openshift.io/v1
|
||||
kind: Route
|
||||
metadata:
|
||||
name: velaux-route
|
||||
namespace: vela-system
|
||||
spec:
|
||||
host: velaux.xxx.xxx.cn
|
||||
port:
|
||||
targetPort: 80
|
||||
to:
|
||||
kind: Service
|
||||
name: velaux
|
||||
weight: 100
|
||||
wildcardPolicy: None
|
||||
```
|
||||
|
||||
- 检查安装
|
||||
```shell
|
||||
curl -I -m 10 -o /dev/null -s -w %{http_code} http://velaux.xxx.xxx.cn/applications
|
||||
```
|
||||
|
||||
- 至此,VelaUX 已经离线部署完成! 同时,对于其他类型 Addon 的离线部署,只需要去 Catalog 源码的对应目录确定所需镜像,并重复以上操作即可完成相应 Addon 的离线部署
|
||||
|
||||
## 总结
|
||||
|
||||
在离线部署的过程中,我们也尝试将 Vela Core 和 Addon 在互联网环境中部署后产生的资源实例保存为 yaml 文件,并在私有环境中进行重新部署,从而完成离线部署,但由于涉及的资源实例较多以及服务授权问题,导致该种方式较为繁琐。
|
||||
|
||||
通过 KubeVela 离线部署实践,可以帮助你更便捷的在离线环境中搭建一整套的 KubeVela,探索 KubeVela 的落地实践。针对离线部署这个共性的问题,我们也看到 KubeVela 社区即将推出全新的 [velad](https://github.com/oam-dev/velad),一个完全离线、数据高可用的安装工具。Velad 可以帮助自动化完成准备集群、下载打包镜像并安装到离线环境等一系列步骤。它支持了:在 Linux 机器(例如阿里云 ECS)本地启动集群、安装 vela-core;在快速启动一个 KubeVela 控制平面的同时,不必担心控制平面的数据随着机器关机等情况而丢失;velad 可以将控制平面全部数据存储到一个传统数据库(例如 RDS 或另一个 ECS 上部署的 MySQL)。
|
||||
|
||||
近期的版本中,招行将加大在 KubeVela 开源社区的投入,积极共建,在企业级集成能力、多集群能力增强、离线部署和应用级统一可观测等诸多领域,贡献来自于金融行业的特定用户场景和业务需求,推动云原生生态实现更易用更高效的应用管理平台向前发展,也欢迎更多的社区成员一起加入进来。
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Loading…
Reference in New Issue