zoukankan      html  css  js  c++  java
  • openfaas 私有镜像配置

    备注: 此项目是使用nodejs  生成唯一id 的
    预备环境
    docker  
    harbor 
    faas-cli
    openfaas k8s 

    1. 项目初始化
    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()});
       }
    2. 项目构建
    faas-cli  build -f ./node.yml
    // 具体输出省略

    3. 镜像push
    faas-cli  push -f ./node.yml
    4.  function 发布
    faas-cli  deploy -f ./node.yml

     
    5. 测试
     
     
    6. 说明
    配置使用还是比较简单的,另外它的k8s scale 还是不错的,效果如下
     
     
  • 相关阅读:
    My Houdini First Step
    MaxScript随机赋材质
    Groups of Operators
    Select groups in scene
    投篮球
    U3D PlayMovie
    unicornForest
    MaxScript Spinner/progressBar
    MaxScript Button
    MaxScript 扇子打开
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/7645178.html
Copyright © 2011-2022 走看看