fn project k8s 集成
Prerequisite 1: working Kubernetes cluster (v1.7+), and a locally configured kubectl.
Quickstart
Steps
- Deploy Fn to the Kubernetes cluster:
$ cd docs/operating/
$ kubectl create -f fn-service.yaml
- Once the Pods have started, check the service for the load balanacer IP:
$ kubectl get svc --watch
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
fn-mysql-master 10.96.57.185 <none> 3306/TCP 10m
fn-redis-master 10.96.127.51 <none> 6379/TCP 10m
fn-service 10.96.245.95 <pending> 8080:30768/TCP,80:31921/TCP 10m
kubernetes 10.96.0.1 <none> 443/TCP 15d
Note that fn-service is initially pending on allocating an external IP. The kubectl get svc --watch command will update this once an IP has been assigned.
- Test the cluster:
If you are using a Kubernetes setup that can expose a public load balancer, run:
$ export FUNCTIONS=$(kubectl get -o json svc fn-service | jq -r '.status.loadBalancer.ingress[0].ip'):8080
If you are using a Kubernetes setup like minikube, run
$ echo $(minikube ip):$(kubectl get svc fn-service -o json | jq -r '.spec.ports[0].nodePort')
192.168.99.100:30966
$ export API_URL=http://192.168.99.100:30966
Now, test by creating a function via curl:
$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$API_URL/v1/apps
{"message":"App successfully created","app":{"name":"myapp","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"fnproject/hello" } }' http://$API_URL/v1/apps/myapp/routes
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"fnproject/hello","memory":128,"headers":{},"type":"sync","format":"default","timeout":30,"idle_timeout":30,"config":{}}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$API_URL/r/myapp/hello-sync
Hello Johnny!
You can also use the Fn CLI:
$ export API_URL=http://192.168.99.100:30966
$ fn apps list
myapp
$ fn routes list myapp
path image endpoint
/hello-sync fnproject/hello 192.168.99.100:30966/r/myapp/hello-sync
<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">
fn project k8s 集成的更多相关文章
- Team Foundation Server (TFS)与Project Server集成,使用DNS(友好地址)地址注册PWA
问题描述: 当Team Foundation Server(TFS 2010/2012/2013)与Project Server高可用性的环境集成时,必然会使用Project Server (PWA) ...
- fn project 试用之后的几个问题的解答
今天试用fnproject 之后自己有些思考,后面继续解决 1. 目前测试是强依赖 dockerhub 的,实际可能不是很方便 2. 如何与k8s .mesos.docker swarm 集成 ...
- fn project 私有镜像发布
1. 说明 fnproject 默认的docker registry 是 dockerhub 对于企业应用还是不太方便的 还好系统系统了配置参数方便我们进行配置,与开源harbor 进行集成 2. 使 ...
- fn project 试用之后的几个问题
今天试用fnproject 之后自己有些思考,后面继续解决 1. 目前测试是强依赖 dockerhub 的,实际可能不是很方便 2. 如何与k8s .mesos.docker swarm 集成 ...
- openfaas k8s 集成
备注 k8s 1.6 以下版本与k8s 1.6 以上版本会有一些简单的区别 1. 克隆k8s 部署文档 https://github.com/openfaas/faas-netes 2. 创 ...
- fn project 扩展
目前支持的扩展方式 Listeners - listen to API events such as a route getting updated and react accordingly. ...
- fn project 生产环境使用
此为官方的参考说明 Running Fn in Production The QuickStart guide is intended to quickly get started and kic ...
- fn project 对象模型
Applications At the root of everything are applications. In fn, an application is essentially a grou ...
- fn project AWS Lambda 格式 functions
Creating Lambda Functions Creating Lambda functions is not much different than using regular funct ...
随机推荐
- 20145219 《Java程序设计》实验五 Java网络编程及安全实验报告
20145219 <Java程序设计>实验五 Java网络编程及安全实验报告 实验内容 1.掌握Socket程序的编写: 2.掌握密码技术的使用: 3.设计安全传输系统. 实验步骤 我和2 ...
- mysql 进阶查询(学习笔记)
学习笔记,来源:实验楼 ,链接: https://www.shiyanlou.com/courses/9 一.日期计算: 1.要想确定每个宠物有多大,可以使用函数TIMESTAMPDIFF()计算 ...
- ResulsetHandler九个实现类
ResulsetHandler九个实现类 ArrayHandler, 将结果集中第一条记录封装到Object[],数组中的每一个元素就是记录中的字段值. ArrayListHandler, 将结果集中 ...
- PAT1063. Set Similarity (25)
来自http://blog.csdn.net/tiantangrenjian/article/details/16868399 set_intersection 交集 set_union 并集 s ...
- Pandas基本功能
到目前为止,我们了解了三种Pandas数据结构以及如何创建它们.接下来将主要关注数据帧(DataFrame)对象,因为它在实时数据处理中非常重要,并且还讨论其他数据结构. 系列基本功能 编号 属性或方 ...
- extundelete实现Linux下文件/文件夹数据恢复!
我用的是Centos系统,在安装extundelete之前需要安装e2fsprogs,e2fsprogs-libs,e2fsprogs-devel. 这里用:yum install e2fsprogs ...
- selenium学习笔记(鼠标事件)
昨天是简单的操作.之后是复杂的操作 首先是鼠标事件 AcationChains类 鼠标操作的常用方法: 右击 context_click() 双击 double_click() 拖动 dr ...
- Android DDMS ADB启动失败错误解决!
ADB server didn't ACK && make sure the plugin is properly configured! adb启动失败一般是端口被占用! 解决方法和 ...
- web自动化流程总结
一. 了解需求,什么是系统的核心业务 二. 编写测试用例:用例名称,前置条件,测试数据,测试步骤,期望结果 三. 自动化代码的初步构建:所有的元素定位.元素操作.测试用例都写在一个模块中 问题: 1. ...
- pOJ-1061 exgcd求同余方程组
链接 就是求(m-n)*a+b*l=y-x, 类似于求解a*x+b*y=c,r=gcd(a,b),当c%r==0时有解,用exgcd求出a*x+b*y=gcd(a,b)的解,然后x*c/gcd(a,b ...