Openfaas on K8s安装部署

Openfaas on K8s安装部署

  1. 使用 brewcurl -sL cli.openfaas.com | sudo sh 安装 faas-cli

  2. 安装brew

    brew install kubernetes-helm
    

  3. 安装helm服务端tiller(3.0以上版本不需要安装)

    kubectl -n kube-system create sa tiller \
     && kubectl create clusterrolebinding tiller \
     --clusterrole cluster-admin \
     --serviceaccount=kube-system:tiller
    
    

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9n3qsKqO-1648005431081)(https://raw.githubusercontent.com/dingzhenying/MDGif/master/img/20200219231528.png)]

    ​ 添加 OpenFaas helm 的 repo并更新:(3.0异常版本)

    helm repo add openfaas https://openfaas.github.io/faas-netes/
    helm repo update
    
    dingdingMacBook-Pro:~ dingding$ git clone https://github.com/openfaas/faas-netes && cd faas-netes
    Cloning into 'faas-netes'...
    remote: Enumerating objects: 1379, done.
    remote: Counting objects: 100% (1379/1379), done.
    remote: Compressing objects: 100% (912/912), done.
    remote: Total 11836 (delta 553), reused 967 (delta 406), pack-reused 10457
    Receiving objects: 100% (11836/11836), 11.01 MiB | 40.00 KiB/s, done.
    Resolving deltas: 100% (7013/7013), done.
    Checking out files: 100% (2441/2441), done.
    
  4. 克隆 Kubernetes 的 OpenFaaS 驱动程序 faas-netes:

    git clone https://github.com/openfaas/faas-netes && cd faas-netes
    
  5. Minikube 没有配置 RBAC,这里我们需要把 RBAC 关闭:

    helm upgrade --install --debug --reset-values --set async=false --set rbac=false openfaa
    
  6. 创建 OpenFaas 命名空间:

    kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
    

  7. 创建 OpenFaas 的管理员登录密码:

    kubectl -n openfaas create secret generic basic-auth --from-literal=basic-auth-user=admin --from-literal=basic-auth-password=1234567890
    
    dingdingMacBook-Pro:faas-netes dingding$ kubectl -n openfaas create secret generic basic-auth --from-literal=basic-auth-user=admin --from-literal=basic-auth-password=1234567890
    secret/basic-auth created
    
  8. 更新 OpenFaas 命名空间:

    helm upgrade openfaas --install openfaas/openfaas --namespace openfaas --set functionNamespace=openfaas-fn --set basic_auth=true
    

  9. 首先登录 OpenFaas:

    faas-cli login -g http://localhost:31112 -u admin -p 1234567890
    
  10. 查看 OpenFaas 基础服务的 Pod:

    kubectl get pods -n openfaas
    
  11. 登陆ui查看openfaas(http://localhost:31112/ui)

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值