You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/07/19 02:06:09 UTC

[incubator-linkis-website] branch dev updated: add deploy linkis with kubernetes (#431)

This is an automated email from the ASF dual-hosted git repository.

casion pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-linkis-website.git


The following commit(s) were added to refs/heads/dev by this push:
     new d0e336a9cc add deploy linkis with kubernetes (#431)
d0e336a9cc is described below

commit d0e336a9cc1af4af7db54a910b67a6828e2ed4c2
Author: jack tao <79...@qq.com>
AuthorDate: Tue Jul 19 10:06:05 2022 +0800

    add deploy linkis with kubernetes (#431)
    
    * add deploy linkis with kubernetes
---
 blog/2022-07-16-deploy-linkis-with-kubernetes.md   | 239 +++++++++++++++++++++
 blog/authors.yml                                   |   8 +-
 .../2022-07-16-deploy-linkis-with-kubernetes.md    | 237 ++++++++++++++++++++
 .../docusaurus-plugin-content-blog/authors.yml     |   8 +-
 4 files changed, 490 insertions(+), 2 deletions(-)

diff --git a/blog/2022-07-16-deploy-linkis-with-kubernetes.md b/blog/2022-07-16-deploy-linkis-with-kubernetes.md
new file mode 100644
index 0000000000..72014e6254
--- /dev/null
+++ b/blog/2022-07-16-deploy-linkis-with-kubernetes.md
@@ -0,0 +1,239 @@
+---
+title: deploy linkis with kubernetes
+authors: [jacktao]
+tags: [github]
+---
+
+**1. Dependencies and versions**
+
+kind github:https://github.com/kubernetes-sigs/kind
+
+kind website:[kind.sigs.k8s.io/](https://kind.sigs.k8s.io/)
+
+version:
+
+kind 0.14.0
+
+docker  20.10.17
+
+node v14.19.3
+
+Note:
+
+1. Ensure that the front and back ends can compile properly
+
+2. Ensure that the component depends on the version
+
+3. Kind refers to the machine that uses docker container to simulate nodes. When the machine is restarted, the scheduler does not work because the container is changed.
+
+ 
+
+**2.Install the docker**
+
+(1)Install the tutorial
+
+```
+sudo yum install -y yum-utils device-mapper-persistent-data lvm2
+
+sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
+
+sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
+
+sudo yum makecache fast
+
+sudo yum -y install docker-ce
+
+systemctl start docker
+
+systemctl enable docker
+```
+
+
+
+(2)setting image mirrors
+
+```
+vi /etc/docker/daemon.json
+
+{
+
+"registry-mirrors": ["http://hub-mirror.c.163.com"],
+
+"insecure-registries": ["https://registry.mydomain.com","http://hub-mirror.c.163.com"]
+
+}
+```
+
+
+
+**3.install the kind**
+
+(1)Manually download the Kind binary
+
+https://github.com/kubernetes-sigs/kind/releases
+
+(2)Install kind binary
+
+```
+chmod +x ./kind
+
+mv kind-linux-amd64 /usr/bin/kind
+```
+
+
+
+**4.Install the JDK and Maven**
+
+(1)Refer to the general installation tutorial to install the following components
+
+jdk 1.8
+
+mavne 3.5+
+
+**5.Install the NodeJS**
+
+(1)version
+
+node v14.19.3
+
+(2)install the nvm
+
+```
+export http_proxy=http://10.0.0.150:7890
+
+export https_proxy=http://10.0.0.150:7890
+
+curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
+
+export NVM_DIR="$HOME/.nvm"
+
+[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
+
+[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
+```
+
+
+
+(3)install the nodejs
+
+```
+nvm ls-remote
+
+nvm install v14.19.3
+```
+
+
+
+(4)setting NPM
+
+```
+npm config set registry https://registry.npmmirror.com
+
+npm config set sass_binary_site https://registry.npmmirror.com/binary.html?path=node-sass/
+```
+
+
+
+(5)Compiler front-end
+
+```
+npm install -g yarn
+
+yarn
+
+yarn build
+
+yarn 
+```
+
+
+
+**6.Compile linkis**
+
+```
+# 1. When compiling for the first time, execute the following command first
+
+./mvnw -N install
+
+# 2. make the linkis distribution package
+
+# - Option 1: make the linkis distribution package only
+
+./mvnw clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+
+# - Option 2: make the linkis distribution package and docker image
+
+./mvnw clean install -Pdocker -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+
+# - Option 3: linkis distribution package and docker image (included web)
+
+./mvnw clean install -Pdocker -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -Dlinkis.build.web=true
+```
+
+
+
+
+
+**7.Create the cluster**
+
+```
+dos2unix ./linkis-dist/helm/scripts/*.sh
+
+./linkis-dist/helm/scripts/create-test-kind.sh
+```
+
+
+
+
+
+**8.install the helm charts**
+
+```
+ ./scripts/install-charts.sh linkis linkis-demo
+```
+
+
+
+
+
+**9.Visit the Linkis page**
+
+```
+kubectl port-forward -n linkis  --address=0.0.0.0 service/linkis-demo-web 8087:8087
+
+http://10.0.2.101:8087
+```
+
+
+
+
+
+**10.Test using the Linkis client**
+
+```
+kubectl -n linkis exec -it linkis-demo-ps-publicservice-77d7685d9-f59ht -- bash
+./linkis-cli -engineType shell-1 -codeType shell -code "echo \"hello\" "  -submitUser hadoop -proxyUser hadoop
+```
+
+
+
+**11.install the kubectl**
+
+```
+cat <<EOF > /etc/yum.repos.d/kubernetes.repo
+[kubernetes]
+name=Kubernetes
+baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
+enabled=1
+gpgcheck=1
+repo_gpgcheck=1
+gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
+EOF
+
+yum install -y --nogpgcheck kubectl
+
+kubectl config view  
+kubectl config get-contexts  
+kubectl cluster-info  
+```
+
diff --git a/blog/authors.yml b/blog/authors.yml
index 027434bc5e..6d173c7ff4 100644
--- a/blog/authors.yml
+++ b/blog/authors.yml
@@ -14,4 +14,10 @@ BeaconTown:
   name: BeaconTown
   title: Student
   url: https://github.com/Beacontownfc/
-  image_url: https://avatars.githubusercontent.com/u/89081023?s=40&v=4
\ No newline at end of file
+  image_url: https://avatars.githubusercontent.com/u/89081023?s=40&v=4
+
+jacktao:
+  name: jacktao
+  title: contributors
+  url: https://github.com/jacktao007
+  image_url: https://avatars.githubusercontent.com/u/1073365?v=4
\ No newline at end of file
diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2022-07-16-deploy-linkis-with-kubernetes.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2022-07-16-deploy-linkis-with-kubernetes.md
new file mode 100644
index 0000000000..24fe356b0b
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2022-07-16-deploy-linkis-with-kubernetes.md
@@ -0,0 +1,237 @@
+---
+title: 部署Linkis到Kubernetes
+authors: [jacktao]
+tags: [github]
+---
+
+**1.依赖、版本**
+
+kind github:https://github.com/kubernetes-sigs/kind
+
+kind官网:[kind.sigs.k8s.io/](https://kind.sigs.k8s.io/)
+
+版本:
+
+kind 0.14.0
+
+docker  20.10.17
+
+node v14.19.3
+
+注意:
+
+1.先确保前后端能够正常编译
+
+2.确保组件依赖版本
+
+3.kind是用docker容器模拟节点的 机器重启回来容器都变了 调度器就不工作了 这个是kind的limitation,官方文档有详细说明。
+
+**2.安装docker**
+
+(1)安装教程
+
+```
+sudo yum install -y yum-utils device-mapper-persistent-data lvm2
+
+sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
+
+sudo sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
+
+sudo yum makecache fast
+
+sudo yum -y install docker-ce
+
+systemctl start docker
+
+systemctl enable docker
+```
+
+
+
+(2)设置国内镜像
+
+```
+vi /etc/docker/daemon.json
+
+{
+
+"registry-mirrors": ["http://hub-mirror.c.163.com"],
+
+"insecure-registries": ["https://registry.mydomain.com","http://hub-mirror.c.163.com"]
+
+}
+```
+
+
+
+**3.安装kind**
+
+(1)手工下载kind二进制
+
+https://github.com/kubernetes-sigs/kind/releases
+
+(2)安装kind二进制
+
+```
+chmod +x ./kind
+
+mv kind-linux-amd64 /usr/bin/kind
+```
+
+
+
+**4.安装JDK 和 Maven**
+
+(1)参考通用安装教程,安装如下组件
+
+jdk 1.8
+
+mavne 3.5+
+
+**5.安装NodeJS**
+
+(1)安装版本
+
+node v14.19.3
+
+(2)安装nvm
+
+```
+export http_proxy=http://10.0.0.150:7890
+
+export https_proxy=http://10.0.0.150:7890
+
+curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
+
+export NVM_DIR="$HOME/.nvm"
+
+[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
+
+[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
+```
+
+
+
+(3)安装nodejs
+
+```
+nvm ls-remote
+
+nvm install v14.19.3
+```
+
+
+
+(4)配置NPM
+
+```
+npm config set registry https://registry.npmmirror.com
+
+npm config set sass_binary_site https://registry.npmmirror.com/binary.html?path=node-sass/
+```
+
+
+
+(5)编译前端
+
+```
+npm install -g yarn
+
+yarn
+
+yarn build
+
+yarn 
+```
+
+
+
+**6.编译linkis**
+
+```
+\# 1. When compiling for the first time, execute the following command first
+
+./mvnw -N install
+
+\# 2. make the linkis distribution package
+
+\# - Option 1: make the linkis distribution package only
+
+./mvnw clean install -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+
+\# - Option 2: make the linkis distribution package and docker image
+
+./mvnw clean install -Pdocker -Dmaven.javadoc.skip=true -Dmaven.test.skip=true
+
+\# - Option 3: linkis distribution package and docker image (included web)
+
+./mvnw clean install -Pdocker -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -Dlinkis.build.web=true
+```
+
+
+
+
+
+**7.创建集群**
+
+```
+dos2unix ./linkis-dist/helm/scripts/*.sh
+
+./linkis-dist/helm/scripts/create-test-kind.sh
+```
+
+
+
+
+
+**8.安装helm charts**
+
+```
+ ./scripts/install-charts.sh linkis linkis-demo
+```
+
+
+
+
+
+**9.访问linkis页面**
+
+```
+kubectl port-forward -n linkis  --address=0.0.0.0 service/linkis-demo-web 8087:8087
+
+http://10.0.2.101:8087
+```
+
+
+
+
+
+**10.使用Linkis客户端测试**
+
+```
+kubectl -n linkis exec -it linkis-demo-ps-publicservice-77d7685d9-f59ht -- bash
+./linkis-cli -engineType shell-1 -codeType shell -code "echo \"hello\" "  -submitUser hadoop -proxyUser hadoop
+```
+
+
+
+**11.安装kubectl**
+
+```
+cat <<EOF > /etc/yum.repos.d/kubernetes.repo
+[kubernetes]
+name=Kubernetes
+baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
+enabled=1
+gpgcheck=1
+repo_gpgcheck=1
+gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
+EOF
+
+yum install -y --nogpgcheck kubectl
+
+kubectl config view  查看集群信息
+kubectl config get-contexts  得到所有集群context对象信息
+kubectl cluster-info  查看当前集群情况
+```
+
diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/authors.yml b/i18n/zh-CN/docusaurus-plugin-content-blog/authors.yml
index 4fe6c504e0..c81f390efe 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-blog/authors.yml
+++ b/i18n/zh-CN/docusaurus-plugin-content-blog/authors.yml
@@ -14,4 +14,10 @@ BeaconTown:
   name: BeaconTown
   title: 学生
   url: https://github.com/Beacontownfc/
-  image_url: https://avatars.githubusercontent.com/u/89081023?s=40&v=4
\ No newline at end of file
+  image_url: https://avatars.githubusercontent.com/u/89081023?s=40&v=4
+
+jacktao:
+  name: jacktao
+  title: 开源贡献者
+  url: https://github.com/jacktao007
+  image_url: https://avatars.githubusercontent.com/u/1073365?v=4
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org