环境安装篇 之 安装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

相关文章

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

python常见环境管理工具超全解析

《python常见环境管理工具超全解析》在Python开发中,管理多个项目及其依赖项通常是一个挑战,下面:本文主要介绍python常见环境管理工具的相关资料,文中通过代码介绍的非常详细,需要的朋友... 目录1. conda2. pip3. uvuv 工具自动创建和管理环境的特点4. setup.py5.

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

Python中使用uv创建环境及原理举例详解

《Python中使用uv创建环境及原理举例详解》uv是Astral团队开发的高性能Python工具,整合包管理、虚拟环境、Python版本控制等功能,:本文主要介绍Python中使用uv创建环境及... 目录一、uv工具简介核心特点:二、安装uv1. 通过pip安装2. 通过脚本安装验证安装:配置镜像源(可

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根

Java SWT库详解与安装指南(最新推荐)

《JavaSWT库详解与安装指南(最新推荐)》:本文主要介绍JavaSWT库详解与安装指南,在本章中,我们介绍了如何下载、安装SWTJAR包,并详述了在Eclipse以及命令行环境中配置Java... 目录1. Java SWT类库概述2. SWT与AWT和Swing的区别2.1 历史背景与设计理念2.1.

安装centos8设置基础软件仓库时出错的解决方案

《安装centos8设置基础软件仓库时出错的解决方案》:本文主要介绍安装centos8设置基础软件仓库时出错的解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录安装Centos8设置基础软件仓库时出错版本 8版本 8.2.200android4版本 javas

python获取cmd环境变量值的实现代码

《python获取cmd环境变量值的实现代码》:本文主要介绍在Python中获取命令行(cmd)环境变量的值,可以使用标准库中的os模块,需要的朋友可以参考下... 前言全局说明在执行py过程中,总要使用到系统环境变量一、说明1.1 环境:Windows 11 家庭版 24H2 26100.4061