openfaas_on_K8s安装部署

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

  2. 安装brew

    1
    brew install kubernetes-helm

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

    1
    2
    3
    4
    kubectl -n kube-system create sa tiller \
    && kubectl create clusterrolebinding tiller \
    --clusterrole cluster-admin \
    --serviceaccount=kube-system:tiller
![](https://raw.githubusercontent.com/dingzhenying/MDGif/master/img/20200219231528.png)

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

1
2
helm repo add openfaas https://openfaas.github.io/faas-netes/
helm repo update
1
2
3
4
5
6
7
8
9
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.
  1. 克隆 Kubernetes 的 OpenFaaS 驱动程序 faas-netes:

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

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

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

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

    1
    kubectl -n openfaas create secret generic basic-auth --from-literal=basic-auth-user=admin --from-literal=basic-auth-password=1234567890
    1
    2
    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
  2. 更新 OpenFaas 命名空间:

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

  1. 首先登录 OpenFaas:

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

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

打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2018-2020 丁振莹
  • 访问人数: | 浏览次数:

你的每一分支持,是我努力下去的最大的力量 ٩(๑❛ᴗ❛๑)۶

支付宝
微信