标签:k8s span ict .com back node nodejs bsp open
docker
harbor
faas-cli
openfaas k8s
faas-cli new node --lang node
// 修改node.yml 镜像名称、gateway 地址
修改之后如下:
provider:
name: faas
gateway: http://k8snode:k8sservicenodeport
functions:
node:
lang: node
handler: ./node
image: privateregistryaddress/openfaas/node
// 项目代码修改
a. NUID npm 包
npm install nuid --save
b. 修改返回数据代码
"use strict"
module.exports = (context, callback) => {
var NUID = require("nuid");
callback(undefined, {status: NUID.next()});
}
faas-cli build -f ./node.yml
// 具体输出省略
faas-cli push -f ./node.yml
faas-cli deploy -f ./node.yml
配置使用还是比较简单的,另外它的k8s scale 还是不错的,效果如下
标签:k8s span ict .com back node nodejs bsp open
原文地址:http://www.cnblogs.com/rongfengliang/p/7645178.html