更新升级 专属应用 系统故障 硬件故障 电脑汽车 鸿蒙刷机 鸿蒙开发Linux教程 鸿蒙开发Linux命令
当前位置:HMXT之家 > 鸿蒙开发Linux教程 > 在Linux系统中安装Arkade、OpenFaas及faas-cli

在Linux系统中安装Arkade、OpenFaas及faas-cli

更新时间:2023-05-18 08:48:31浏览次数:174+次

如果你要在Linux、MacOS系统中安装Arkade、OpenFaas及faas-cli,请采用以下方法操作。

安装Arkade的方法

Arkade是一款开源CLI,有助于轻松管理应用程序。它是用Go语言编写的,使用helm charts和kubectl将应用程序安装到Kubernetes集群中。以下将在Linux中安装Arkade,同时利用Arkade来安装OpenFaaS。请使用以下命令在您的机器上安装它:

sudo curl -SLsf https://dl.get-arkade.dev/ | sudo sh

注:同样的命令也适用于MacOS,如果是Windows,可使用curl -SLsf https://dl.get-arkade.dev/ | sh。

样本输出:

Downloading package https://github.com/alexellis/arkade/releases/download/0.8.1/arkade as /tmp/arkade

Download complete.

Running with sufficient permissions to attempt to move arkade to /usr/local/bin

New version of arkade installed to /usr/local/bin

Creating alias 'ark' for 'arkade'.

Get Kubernetes apps the easy way

Version: 0.8.1

安装OpenFaas的方法

在您的Linux系统上安装Arkade后,您可以使用以下命令轻松下载OpenFaaS:

arkade install openfaas --basic-auth-password MyStrongPassword --set=faasIdler.dryRun=false

在该命令中,您已经使用官方的helm chart安装了OpenFaaS。您已经使用自己的密码“MyStrongPassword”安装了OpenFaaS,并禁用了faasIdler.dryRun。这是自动缩放所必需的。

样本输出:

faas-cli store deploy figlet

faas-cli list

# For Raspberry Pi

faas-cli store list \

 --platform armhf

faas-cli store deploy figlet \

 --platform armhf

# Find out more at:

# https://github.com/openfaas/faas

Thanks for using arkade!

附:访问OpenFaaS Web UI的方法

使用URL访问OpenFaas web界面,地址格式是http://127.0.0.1:8080,如下图所示:

\

使用凭据登录,用户名:admin,密码:MyStrongPassword。成功登录后,您将看到此OpenFaas仪表板:

\

可以通过单击Deploy a new Function在OpenFaas上部署新功能,比如进行Nodeinfo部署:

\

在选择后,按照界面的提示操作即可,整个操作过程并不复杂:

\

安装faas-cli的方法

一旦在您的Linux系统上安装了OpenFaaS,就需要faas-cli。它用于使用OpenFaas部署和测试功能。使用以下命令在系统上安装:

curl -sL https://cli.openfaas.com | sudo sh

注:同样的命令也适用于MacOS中,如果是Windows,则用curl -sL https://cli.openfaas.com | sh命令。

现在,我们已经成功地设置了OpenFaaS,我们可以使用fast-cli或Web UI登录到它,如下所示:

faas-cli login --username admin --password MyStrongPassword

默认用户名是admin和password,我们使用之前指定的MyStrongPassword。

样本输出:

Running with sufficient permissions to attempt to move faas-cli to /usr/local/bin

New version of faas-cli installed to /usr/local/bin

Creating alias 'faas' for 'faas-cli'.

CLI:

version: 0.13.13

至此,说明安装faas-cli成功。