serverless框架之开源openfaas部署

kubernetes version

[root@master-47-35 chart]# kubectl version 
Client Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.0-168+f47446a730ca03", GitCommit:"f47446a730ca037473fb3bf0c5abeea648c1ac12", GitTreeState:"clean", BuildDate:"2018-08-25T21:05:52Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.0-168+f47446a730ca03", GitCommit:"f47446a730ca037473fb3bf0c5abeea648c1ac12", GitTreeState:"clean", BuildDate:"2018-08-25T21:05:52Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

安装helm

安装helm工具请参考helm 安装

下载源码

git clone https://github.com/openfaas/faas-netes.git
cd faas-netes/chart

helm install openfaas/
[root@master-47-35 chart]# helm install openfaas/
Chart.yaml   OWNERS       README.md    templates/   values.yaml  
[root@master-47-35 chart]# helm install openfaas/
NAME:   eager-wildebeest
LAST DEPLOYED: Thu Nov 15 19:57:07 2018
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/ConfigMap
NAME                 AGE
alertmanager-config  0s
prometheus-config    0s

==> v1/ServiceAccount
eager-wildebeest-controller  0s

==> v1beta1/ClusterRole
eager-wildebeest-controller  0s

==> v1beta1/ClusterRoleBinding
eager-wildebeest-controller  0s

==> v1/Service
alertmanager      0s
gateway-external  0s
gateway           0s
nats              0s
prometheus        0s

==> v1beta1/Deployment
alertmanager  0s
faas-idler    0s
gateway       0s
nats          0s
prometheus    0s
queue-worker  0s

==> v1/Pod(related)

NAME                           READY  STATUS             RESTARTS  AGE
alertmanager-574fbd97f7-76tzr  0/1    ContainerCreating  0         0s
faas-idler-f656b895d-nt9wp     0/1    ContainerCreating  0         0s
gateway-5644677dc8-jnqpn       0/2    ContainerCreating  0         0s
nats-74fc8944fb-jpft2          0/1    ContainerCreating  0         0s
prometheus-7dbc7d9f79-vnp58    0/1    ContainerCreating  0         0s
queue-worker-566fb99ff8-ttlwj  0/1    ContainerCreating  0         0s


NOTES:
To verify that openfaas has started, run:

  kubectl --namespace=default get deployments -l "release=eager-wildebeest, app=openfaas"

[root@master-47-35 chart]# kubectl --namespace=default get deployments -l "release=eager-wildebeest, app=openfaas"
NAME           DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
alertmanager   1         1         1            0           27s
gateway        1         1         1            0           27s
nats           1         1         1            0           27s
prometheus     1         1         1            0           27s
queue-worker   1         1         1            0           27s

部署过程中会发现以下错误,删除掉即可

gateway-5644677dc8-jnqpn         1/2       ErrImagePull       0          3m

部署结果查看

[root@master-47-35 chart]# kubectl get svc 
NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
alertmanager       ClusterIP   10.254.7.6              9093/TCP         13m
gateway            ClusterIP   10.254.6.144            8080/TCP         13m
gateway-external   NodePort    10.254.3.106            8080:31112/TCP   13m
nats               ClusterIP   10.254.14.142           4222/TCP         13m
prometheus         ClusterIP   10.254.19.240           9090/TCP         13m

[root@master-47-35 chart]# kubectl get pods -owide
NAME                             READY     STATUS             RESTARTS   AGE       IP              NODE           NOMINATED NODE
alertmanager-574fbd97f7-76tzr    1/1       Running            0          30m       10.253.62.144   master-47-34   
faas-idler-f656b895d-nt9wp       1/1       Running            5          30m       10.253.109.57   slave-47-33    
gateway-5644677dc8-jnqpn         2/2       Running            2          30m       10.253.63.213   master-47-36   
nats-74fc8944fb-jpft2            1/1       Running            0          30m       10.253.62.146   master-47-34   
prometheus-7dbc7d9f79-vnp58      1/1       Running            0          30m       10.253.63.230   master-47-36   
queue-worker-566fb99ff8-rd2kt    1/1       Running            0          25m       10.253.109.49   slave-47-33    

从浏览器访问gateway-5644677dc8-jnqpn所在的节点的31112端口
serverless框架之开源openfaas部署_第1张图片

部署完毕

参考
openfaas deployment on kubernetes

你可能感兴趣的:(kubetnetes)