tree: 4bf30963065d3b1a6303787b711953cb6e9f9c8f [path history] [tgz]
  1. build.sh
  2. delete.sh
  3. ingress-nginx-controller.yaml
  4. ingress.yaml
  5. init.sh
  6. linkis-bml-configmap.yaml
  7. linkis-bml-deployment.yaml
  8. linkis-cs-server-configmap.yaml
  9. linkis-cs-server-deployment.yaml
  10. linkis-dsm-server-configmap.yaml
  11. linkis-dsm-server-deployment.yaml
  12. linkis-eureka-configmap.yaml
  13. linkis-gateway-configmap.yaml
  14. linkis-gateway-deployment.yaml
  15. linkis-gateway-service.yaml
  16. linkis-mdm-server-configmap.yaml
  17. linkis-mdm-server-deployment.yaml
  18. linkis-mdm-service-es-configmap.yaml
  19. linkis-mdm-service-es-deployment.yaml
  20. linkis-mdm-service-hive-configmap.yaml
  21. linkis-mdm-service-hive-deployment.yaml
  22. linkis-mdm-service-mysql-configmap.yaml
  23. linkis-mdm-service-mysql-deployment.yaml
  24. linkis-metadata-configmap.yaml
  25. linkis-metadata-deployment.yaml
  26. linkis-publicservice-configmap.yaml
  27. linkis-publicservice-deployment.yaml
  28. linkis-resourcemanager-configmap.yaml
  29. linkis-resourcemanager-deployment.yaml
  30. linkis-ujes-hive-enginemanager-configmap.yaml
  31. linkis-ujes-hive-enginemanager-deployment.yaml
  32. linkis-ujes-hive-entrance-configmap.yaml
  33. linkis-ujes-hive-entrance-deployment.yaml
  34. linkis-ujes-jdbc-entrance-configmap.yaml
  35. linkis-ujes-jdbc-entrance-deployment.yaml
  36. linkis-ujes-mlsql-entrance-configmap.yaml
  37. linkis-ujes-mlsql-entrance-deployment.yaml
  38. linkis-ujes-pipeline-enginemanager-configmap.yaml
  39. linkis-ujes-pipeline-enginemanager-deployment.yaml
  40. linkis-ujes-pipeline-entrance-configmap.yaml
  41. linkis-ujes-pipeline-entrance-deployment.yaml
  42. linkis-ujes-python-enginemanager-configmap.yaml
  43. linkis-ujes-python-enginemanager-deployment.yaml
  44. linkis-ujes-python-entrance-configmap.yaml
  45. linkis-ujes-python-entrance-deployment.yaml
  46. linkis-ujes-shell-enginemanager-configmap.yaml
  47. linkis-ujes-shell-enginemanager-deployment.yaml
  48. linkis-ujes-shell-entrance-configmap.yaml
  49. linkis-ujes-shell-entrance-deployment.yaml
  50. linkis-ujes-spark-enginemanager-configmap.yaml
  51. linkis-ujes-spark-enginemanager-deployment.yaml
  52. linkis-ujes-spark-entrance-configmap.yaml
  53. linkis-ujes-spark-entrance-deployment.yaml
  54. package.sh
  55. push.sh
  56. README.MD
  57. register.yaml
  58. scriptis.yaml
k8s/README.MD

Linkis on kubernetes

#重点解决问题 1.每个人在部署过程中,都会遇到包冲突,操作系统不兼容,openjdk,hotspot jdk兼容问题,docker交付可以从根本上解决这些问题

2.docker基于cgroup资源隔离,共享文件系统,namespace 可以轻量限制计算资源,秒级扩缩容

 例如:限制某个进程只能使用CPU一个核的20%资源
 cd /sys/fs/cgroup/cpu
 touch test 
 $ echo 10000 > cpu.cfs_quota_us 
 $ echo 50000 > cpu.cfs_period_us
 启动一个进程,请不要在生产做这样操作!!!!  
 $ while :; do :; done &
 记录当前进程Id
 $ echo pid >> tasks

#部署文档

##基础镜像及各服务镜像编译方法

目前所有微服务镜像都上传到dockerhub,https://hub.docker.com/repository/docker/wedatasphere/linkis

出于对虚机部署版本的考虑,新增了pom_k8s.xml,默认打包方式跟之前保持一致,如果想要自己编译镜像,需要引用pom_k8s.xml

mvn clean package -f  gateway/gateway-ujes-support/pom_k8s.xml

一.创建kubernetes docker secret

  k8s/registry.yaml 修改对应harbor的账号,密码,镜像仓库地址
  或者手动创建secret,后续拉取镜像使用,私有docker仓库请修改成私有reposity地址
  $kubectl create secret docker-registry registry-key \
   --docker-server=https://hub.docker.com \
   --docker-username=wedatasphere \
   --docker-password=***** \
   --docker-email=wedatasphere@webank.com

二.NFS/ceph 搭建

 搭建NFS或者ceph完成后,publicservice等微服务的deployment需要修改nfs的地址

三.基础镜像创建文件(使用官方维护的镜像可以跳过该步骤) 自己制作基础镜像方法如下:

  • 环境变量设置

    设置harbor的地址环境变量

    export HARBOR_LINKIS=
    
  • 基础镜像编译打包

    打包

    cd Linkis/emr-base
    docker build -t $HARBOR_LINKIS/linkis:emr-base-spark2.4.4 .
    

    推送

    docker push  $HARBOR_LINKIS/linkis:emr-base-spark2.4.4 
    
  • 基础依赖包编译

    mvn clean install -Dmaven.test.skip=true
    
  • 替换各个微服务Dockerfile的基础镜像为自己的私服地址

    find . -name Dockerfile | xargs grep -rl "FROM wedatasphere/linkis" | xargs sed -i "" "s?FROM wedatasphere/linkis?FROM $HARBOR_LINKIS/linkis?"
    find . -name "*.yaml" | xargs grep -rl "image: wedatasphere/linkis" | xargs sed -i "" "s?image: wedatasphere/linkis?image: $HARBOR_LINKIS/linkis?"
    
  • 编译各微服务镜像

    各个微服务basedir下面有对应 module 的 Dockerfile 与公司内部的CI/CD集成,可以通过mvn docker插件直接编译docker镜像

    sh k8s/package.sh
    sh k8s/build.sh
    sh k8s/push.sh
    

四、K8S部署

1.大数据环境配置
  > 主要涉及 hadoop,hive,spark环境配置,需要将几个组件的配置在k8s各个节点上
  
  | 组件 | 版本 |  节点目录 |
  | ---  | --- |  ---    |
  | hadoop | 2.7.7 | /opt/hadoop/hadoop-2.7.7 |
  | hive  | 2.3.6  | /opt/hive/apache-hive-2.3.6-bin |
  | spark | 2.4    | /opt/spark/spark-2.4.4-bin-hadoop2.7 |   
  
2.启动eureka
  eureka部署在k8s的任意一个node节点上就可以
  启动eureka成功后
  修改Linkis/k8s/linkis-eureka-configmap.yaml中的eurekaUrl
  
3.修改k8s目录下的linkis-*- configmap.yaml
  特别注意配置文件的正确性,避免后续部署的低级问题出现,如数据库连接不上,hdfs地址不正确等等
  例如gateway/linkis.properties 复制到k8s/linkis-gateway-configmap.yaml
  
4.运行k8s目录下的 
  sh init.sh
  观察eureka上注册的服务,一共22个,都启动成功基本就没有问题