环境安装篇 之 安装kubevela

2024-03-21 13:52
文章标签 安装 环境 kubevela

本文主要是介绍环境安装篇 之 安装kubevela,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

云原生学习路线导航页(持续更新中)

  • 本文是 环境安装 系列文章,介绍 oam规范标准实施项目 kubevela 的安装详细步骤
  • kubevela 官方安装文档:https://kubevela.io/zh/docs/installation/kubernetes/

1.CentOS 安装kubevela

1.1.前提:已安装docker

  • 要求已经安装了docker,没有安装的可以参考:
    • 环境安装篇 之 docker安装

1.2.安装kubevela

  • 安装kubevela
    • kubevela会内置一个kubernetes环境,所以你不需要实现安装 kubernetes
    curl -fsSl https://kubevela.io/script/install.sh | bash
    vela install
    

1.3.安装kubectl

  • 虽然kubevela会内置一个kubernetes环境,但是没有安装kubectl,需要手动安装
    $ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
    $ curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
    $ echo "$(cat kubectl.sha256)  kubectl" | sha256sum --check
    $ install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
    
  • kubevela内置的集群,集群kubeconfig文件是 /etc/rancher/k3s/k3s.yaml
  • 如果你的kubectl无法找到集群,就将该文件复制一份为 ~/.kube/config
    cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
    

1.4.可能遇到的问题

  • 安装过程如果报错:
    [ERROR]  Failed to find the k3s-selinux policy, please install:yum install -y container-selinuxyum install -y https://rpm.rancher.io/k3s/stable/common/centos/7/noarch/Error: Fail to set up cluster: fail to setup k3s: K3s install script failed: exit status 1
    
    • 按照提示执行两条yum命令,安装 container-selinuxk3s-selinux
    • 从上面的报错看,第二条yum命令,日志其实没有打印全(我也不知道为啥),https://rpm.rancher.io/k3s/stable/common/centos/7/noarch/ 是错误的,直接执行会提示找不到包
    • centos7,可以执行这个命令
      yum install -y https://rpm.rancher.io/k3s/stable/common/centos/7/noarch/k3s-selinux-1.2-2.el8.noarch.rpm
      
    • 解决问题后,重新执行 vela install 即可

1.5.安装velaux:kubevela UI控制台

1.5.1.根据kubevela安装成功提示安装velaux

  • 安装成功的提示信息如下:
    [root@kubevela go]# velad install
    Preparing cluster setup script...
    Saving temporary file: k3s-setup-*.sh
    Preparing k3s binary...
    Saving k3s binary to /usr/local/bin/k3s
    Successfully place k3s binary to /usr/local/bin/k3s
    Preparing k3s images
    Making directory /var/lib/rancher/k3s/agent/images/
    Saving K3s air-gap install images to /var/lib/rancher/k3s/agent/images/k3s-airgap-images.tar.gz
    Successfully prepare k3s image
    Setting up cluster
    /bin/bash /root/.vela/tmp/k3s-setup-445017089.sh --node-name=default
    [INFO]  Skipping k3s download and verify
    [INFO]  Skipping installation of SELinux RPM
    [INFO]  Skipping /usr/local/bin/kubectl symlink to k3s, already exists
    [INFO]  Creating /usr/local/bin/crictl symlink to k3s
    [INFO]  Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
    [INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
    [INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
    [INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
    [INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
    [INFO]  systemd: Enabling k3s unit
    Created symlink from /etc/systemd/system/multi-user.target.wants/k3s.service to /etc/systemd/system/k3s.service.
    [INFO]  systemd: Starting k3s
    Successfully setup cluster
    Checking and installing vela CLI...
    vela CLI is not installed, installing...
    Installing vela CLI at:  /usr/local/bin/vela
    Successfully install vela CLI
    Saving and temporary image file: vela-image-cluster-gateway-*.tar
    Importing image to cluster using temporary file: vela-image-cluster-gateway-*.tar
    unpacking docker.io/oamdev/cluster-gateway:v1.9.0-alpha.2 (sha256:a9baa41c62762dea9cccefeed0ef1a479b695f7af847ecf7df0ab6b6ecf4e8c5)...done
    Successfully import image /root/.vela/tmp/vela-image-cluster-gateway-2792909328.tar
    Saving and temporary image file: vela-image-kube-webhook-certgen-*.tar
    Importing image to cluster using temporary file: vela-image-kube-webhook-certgen-*.tar
    unpacking docker.io/oamdev/kube-webhook-certgen:v2.4.1 (sha256:089374ef23e1d268f138d742b8af056ee1af51bb4863f6a19cde0634068eaa91)...done
    Successfully import image /root/.vela/tmp/vela-image-kube-webhook-certgen-4078663359.tar
    Saving and temporary image file: vela-image-vela-core-*.tar
    Importing image to cluster using temporary file: vela-image-vela-core-*.tar
    unpacking docker.io/oamdev/vela-core:v1.9.5 (sha256:fbff76625847c1183dd371f5fc9acbbd3c33c348faf12984eaae433b1244f454)...done
    Successfully import image /root/.vela/tmp/vela-image-vela-core-222878440.tar
    Saving and temporary image file: vela-image-velaux-*.tar
    Importing image to cluster using temporary file: vela-image-velaux-*.tar
    unpacking docker.io/oamdev/velaux:v1.9.2 (sha256:9e1a8810c429fb651807efde0542778143fb5428732d9c9839310eb949d5d97d)...done
    Successfully import image /root/.vela/tmp/vela-image-velaux-3157703049.tar
    Saving and temporary helm chart file: vela-core-*.tgz
    open the tar to tmpDir /root/.vela/tmp
    Copy velaux-v1.9.2.tgz file to /root/.vela/addons/velaux-v1.9.2.tgz
    Extracting /root/.vela/addons/velaux-v1.9.2.tgz to /root/.vela/addons/velaux
    Installing vela-core Helm chart...
    Executing "vela install --file /root/.vela/tmp/vela-core --detail=false --version v1.9.5 --set= --namespace=vela-system "Check Requirements ...
    Installing KubeVela Core ...
    Helm Chart used for KubeVela control plane installation: /root/.vela/tmp/vela-core
    I0320 23:26:51.273741   19017 apply.go:126] "creating object" name="applicationrevisions.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.324160   19017 apply.go:126] "creating object" name="applications.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.347480   19017 apply.go:126] "creating object" name="componentdefinitions.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.384335   19017 apply.go:126] "creating object" name="definitionrevisions.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.410499   19017 apply.go:126] "creating object" name="policies.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.474147   19017 apply.go:126] "creating object" name="policydefinitions.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.503579   19017 apply.go:126] "creating object" name="resourcetrackers.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.518233   19017 apply.go:126] "creating object" name="traitdefinitions.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.539290   19017 apply.go:126] "creating object" name="workflows.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.559766   19017 apply.go:126] "creating object" name="workflowstepdefinitions.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    I0320 23:26:51.581942   19017 apply.go:126] "creating object" name="workloaddefinitions.core.oam.dev" resource="apiextensions.k8s.io/v1, Kind=CustomResourceDefinition"
    Start upgrading Helm Chart kubevela in namespace vela-systemKubeVela control plane has been successfully set up on your cluster.
    If you want to enable dashboard, please run "vela addon enable /root/.vela/addons/velaux"
    Modifying the built-in gateway definition...Keep the token below if you want to restart the control plane
    K10753a9d09167f265c6f72e2cf3d453da9df7099d9e8fad7002a4b397f843491e0::server:4548ddd54b195c9d4f85e85e9d81d87a🚀 Successfully install KubeVela control plane
    💻 When using gateway trait, you can access with 127.0.0.1
    🔭 See available commands with `vela help`
    💡 To enable dashboard, run `vela addon enable /root/.vela/addons/velaux`
    🔑 To access the cluster, set KUBECONFIG:export KUBECONFIG=$(velad kubeconfig --name default --host)
    
  • 根据提示,可知道,执行 vela addon enable /root/.vela/addons/velaux 可以安装velaux,即kubevela的UI控制台
    [root@kubevela go]# vela addon enable /root/.vela/addons/velaux
    enabling addon by local dir: /root/.vela/addons/velaux
    Addon velaux enabled successfully.
    Please access addon-velaux from the following endpoints:
    +---------+---------------+-----------------------------------+--------------------------------+-------+
    | CLUSTER |   COMPONENT   |     REF(KIND/NAMESPACE/NAME)      |            ENDPOINT            | INNER |
    +---------+---------------+-----------------------------------+--------------------------------+-------+
    | local   | velaux-server | Service/vela-system/velaux-server | velaux-server.vela-system:8000 | true  |
    +---------+---------------+-----------------------------------+--------------------------------+-------+To open the dashboard directly by port-forward:vela port-forward -n vela-system addon-velaux 8000:8000Please refer to https://kubevela.io/docs/reference/addons/velaux for more VelaUX addon installation and visiting method.
    

1.5.2.使用NodePort方式安装velaux

  • 如果是在虚拟机中,使用1.4.1中安装的velaux,外界机器上是无法访问的,可以使用NodePort方式安装velaux

    [root@kubevela go]# vela addon enable velaux serviceType=NodePort
    Addon velaux enabled successfully.
    Please access addon-velaux from the following endpoints:
    +---------+---------------+-----------------------------------+-----------------------+-------+
    | CLUSTER |   COMPONENT   |     REF(KIND/NAMESPACE/NAME)      |       ENDPOINT        | INNER |
    +---------+---------------+-----------------------------------+-----------------------+-------+
    | local   | velaux-server | Service/vela-system/velaux-server | 192.168.245.151:30000 | false |
    +---------+---------------+-----------------------------------+-----------------------+-------+To open the dashboard directly by port-forward:vela port-forward -n vela-system addon-velaux 8000:8000Please refer to https://kubevela.io/docs/reference/addons/velaux for more VelaUX addon installation and visiting method.
    
  • 根据结果可知,通过 192.168.245.151:30000 可以访问 VelaUX

  • VelaUX,默认账号:admin,密码:VelaUX12345

    在这里插入图片描述

这篇关于环境安装篇 之 安装kubevela的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/832787

相关文章

Zookeeper安装和配置说明

一、Zookeeper的搭建方式 Zookeeper安装方式有三种,单机模式和集群模式以及伪集群模式。 ■ 单机模式:Zookeeper只运行在一台服务器上,适合测试环境; ■ 伪集群模式:就是在一台物理机上运行多个Zookeeper 实例; ■ 集群模式:Zookeeper运行于一个集群上,适合生产环境,这个计算机集群被称为一个“集合体”(ensemble) Zookeeper通过复制来实现

CentOS7安装配置mysql5.7 tar免安装版

一、CentOS7.4系统自带mariadb # 查看系统自带的Mariadb[root@localhost~]# rpm -qa|grep mariadbmariadb-libs-5.5.44-2.el7.centos.x86_64# 卸载系统自带的Mariadb[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.44-2.el7

Centos7安装Mongodb4

1、下载源码包 curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.1.tgz 2、解压 放到 /usr/local/ 目录下 tar -zxvf mongodb-linux-x86_64-rhel70-4.2.1.tgzmv mongodb-linux-x86_64-rhel70-4.2.1/

Centos7安装JDK1.8保姆版

工欲善其事,必先利其器。这句话同样适用于学习Java编程。在开始Java的学习旅程之前,我们必须首先配置好适合的开发环境。 通过事先准备好这些工具和配置,我们可以避免在学习过程中遇到因环境问题导致的代码异常或错误。一个稳定、高效的开发环境能够让我们更加专注于代码的学习和编写,提升学习效率,减少不必要的困扰和挫折感。因此,在学习Java之初,投入一些时间和精力来配置好开发环境是非常值得的。这将为我

阿里开源语音识别SenseVoiceWindows环境部署

SenseVoice介绍 SenseVoice 专注于高精度多语言语音识别、情感辨识和音频事件检测多语言识别: 采用超过 40 万小时数据训练,支持超过 50 种语言,识别效果上优于 Whisper 模型。富文本识别:具备优秀的情感识别,能够在测试数据上达到和超过目前最佳情感识别模型的效果。支持声音事件检测能力,支持音乐、掌声、笑声、哭声、咳嗽、喷嚏等多种常见人机交互事件进行检测。高效推

安装nodejs环境

本文介绍了如何通过nvm(NodeVersionManager)安装和管理Node.js及npm的不同版本,包括下载安装脚本、检查版本并安装特定版本的方法。 1、安装nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash 2、查看nvm版本 nvm --version 3、安装

【IPV6从入门到起飞】5-1 IPV6+Home Assistant(搭建基本环境)

【IPV6从入门到起飞】5-1 IPV6+Home Assistant #搭建基本环境 1 背景2 docker下载 hass3 创建容器4 浏览器访问 hass5 手机APP远程访问hass6 更多玩法 1 背景 既然电脑可以IPV6入站,手机流量可以访问IPV6网络的服务,为什么不在电脑搭建Home Assistant(hass),来控制你的设备呢?@智能家居 @万物互联

高并发环境中保持幂等性

在高并发环境中保持幂等性是一项重要的挑战。幂等性指的是无论操作执行多少次,其效果都是相同的。确保操作的幂等性可以避免重复执行带来的副作用。以下是一些保持幂等性的常用方法: 唯一标识符: 请求唯一标识:在每次请求中引入唯一标识符(如 UUID 或者生成的唯一 ID),在处理请求时,系统可以检查这个标识符是否已经处理过,如果是,则忽略重复请求。幂等键(Idempotency Key):客户端在每次

计算机毕业设计 大学志愿填报系统 Java+SpringBoot+Vue 前后端分离 文档报告 代码讲解 安装调试

🍊作者:计算机编程-吉哥 🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。 🍊心愿:点赞 👍 收藏 ⭐评论 📝 🍅 文末获取源码联系 👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~Java毕业设计项目~热门选题推荐《1000套》 目录 1.技术选型 2.开发工具 3.功能

SWAP作物生长模型安装教程、数据制备、敏感性分析、气候变化影响、R模型敏感性分析与贝叶斯优化、Fortran源代码分析、气候数据降尺度与变化影响分析

查看原文>>>全流程SWAP农业模型数据制备、敏感性分析及气候变化影响实践技术应用 SWAP模型是由荷兰瓦赫宁根大学开发的先进农作物模型,它综合考虑了土壤-水分-大气以及植被间的相互作用;是一种描述作物生长过程的一种机理性作物生长模型。它不但运用Richard方程,使其能够精确的模拟土壤中水分的运动,而且耦合了WOFOST作物模型使作物的生长描述更为科学。 本文让更多的科研人员和农业工作者