一张参考架构图:

从图中可以看到nuclio可以运行到docker 以及kubernetes中 提供了kubernetes 部署的脚本

安装

  • 创建命名空间
kubectl create namespace nuclio
  • rbac 创建
kubectl apply -f https://raw.githubusercontent.com/nuclio/nuclio/master/hack/k8s/resources/nuclio-rbac.yaml
  • 部署nuclio组件

    说明 yaml 文件运行起来有点问题,多了一个description 字段,修改如下,nuclio是通过crd 运行在k8s 中

# Copyright 2017 The Nuclio Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License. --- # Define a "function" custom resource definition - extending the k8s API to allow management of "function" resources
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: functions.nuclio.io
spec:
group: nuclio.io
names:
kind: Function
plural: functions
singular: function
scope: Namespaced
version: v1beta1 --- # Define a "project" custom resource definition - extending the k8s API to allow management of "project" resources
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: projects.nuclio.io
spec:
group: nuclio.io
names:
kind: Project
plural: projects
singular: project
scope: Namespaced
version: v1beta1 --- # Define a "functionevent" custom resource definition - extending the k8s API to allow management of "functionevent" resources
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: functionevents.nuclio.io
spec:
group: nuclio.io
names:
kind: FunctionEvent
plural: functionevents
singular: functionevent
scope: Namespaced
version: v1beta1 --- # All Nuclio services are bound to the "nuclio" service account. In RBAC enabled setups, this service account is
# bound to specific roles limiting what the services can do
apiVersion: v1
kind: ServiceAccount
metadata:
name: nuclio
namespace: nuclio --- # The nuclio controller listens for changes on the function CRD and creates the proper deployment, service, etc
# for the function
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nuclio-controller
namespace: nuclio
spec:
replicas: 1
template:
metadata:
labels:
nuclio.io/env: test
nuclio.io/app: controller
nuclio.io/class: service
annotations:
nuclio.io/version: 0.5.11
spec:
containers:
- name: nuclio-controller
image: nuclio/controller:0.5.11-amd64
env:
- name: NUCLIO_CONTROLLER_IMAGE_PULL_SECRETS
value: registry-credentials
serviceAccountName: nuclio --- # The Nuclio dashboard offers a UI to manage functions
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nuclio-dashboard
namespace: nuclio
spec:
replicas: 1
template:
metadata:
labels:
nuclio.io/env: test
nuclio.io/app: dashboard
nuclio.io/class: service
annotations:
nuclio.io/version: 0.5.11
spec:
containers:
- name: nuclio-dashboard
image: nuclio/dashboard:0.5.11-amd64
ports:
- containerPort: 8070
volumeMounts:
- mountPath: /var/run/docker.sock
name: docker-sock
- name: registry-credentials
mountPath: "/etc/nuclio/dashboard/registry-credentials"
readOnly: true
volumes:
- name: docker-sock
hostPath:
path: /var/run/docker.sock
- name: registry-credentials
secret:
secretName: registry-credentials
optional: true
serviceAccountName: nuclio
---
apiVersion: v1
kind: Service
metadata:
name: nuclio-dashboard
namespace: nuclio
spec:
type: NodePort
selector:
nuclio.io/app: dashboard
ports:
- name: admin
port: 8070
protocol: TCP

效果

界面

几个问题

  • 私服

    目前UI 界面不是很好,不支持自定义配置,如果使用dockerhub 是没有问题的,私服需要结合UI以及yaml 文件

创建secret
kubectl create secret docker-registry registry-credentials --namespace nuclio \
--docker-username admin \
--docker-password password \
--docker-server docker-image-server \
--docker-email 1141591465@qq.com
  • 修改function 定义

    主要是添加registry 定义

spec:
...
build:
registry: docker-image-server/username| harbor projectname
...
  • 通过ingress 调用

    是通过使用trigger方式调用的

参考配置:
https://github.com/nuclio/nuclio/blob/master/docs/concepts/k8s/function-ingress.md apiVersion: "nuclio.io/v1"
kind: "Function"
spec:
runtime: "golang"
triggers:
http:
maxWorkers: 8
kind: http
attributes:
ingresses:
first:
paths:
- /first/path
- /second/path
second:
host: my.host.com
paths:
- /first/from/host

参考资料

https://github.com/nuclio/nuclio/blob/master/docs/concepts/k8s/function-ingress.md
https://github.com/nuclio/nuclio
https://github.com/nuclio/nuclio/blob/master/docs/setup/k8s/getting-started-k8s.md

 
 
 
 

nuclio kubernetes 部署的更多相关文章

  1. [系统集成] 基于Kubernetes 部署 jenkins 并动态分配资源

    基于kubernetes 部署 jenkins master 比较简单,难点是为 jenkins 动态分配资源.基于kubernetes 为 jenkins 动态分配资源需要实现下述功能: 资源分配: ...

  2. kubernetes 部署

    kubernetes 部署(Centos 7) 一个或者多个兼容 deb 或者 rpm 软件包的操作系统,比如 Ubuntu 或者 CentOS 每台机器 2 GB 以上的内存,内存不足时应用会受限制 ...

  3. Kubernetes 部署失败的 10 个最普遍原因

    [原文].后面我们可能还会看到一个 OOMKilled 错误. 我们的应用正在挂掉?为什么? 首先我们查看应用日志.假定你发送应用日志到 stdout(事实上你也应该这么做),你可以使用 kubect ...

  4. jenkins+svn+pipeline+kubernetes部署java应用(三)

    将jar包.Dockerfile.kubernetes部署yaml文件上传至svn自定义目录 一.生成流水线脚本 二.配置jenkins pipeline构建语句 三.点击构建java工程

  5. kubernetes部署高可用Harbor

    前言 本文Harbor高可用依照Harbor官网部署,主要思路如下,大家可以根据具体情况选择搭建. 部署Postgresql高可用集群.(本文选用Stolon进行管理,请查看文章<kuberne ...

  6. kubernetes部署jenkins(Docker in Docker)及认证

    引言 Jenkins是一款开源 CI&CD 软件,用于自动化各种任务,包括构建.测试和部署软件. 本文将Jenkins的master与slave置于Pod中,部署在namespace:jenk ...

  7. Kubernetes 部署Web UI (Dashboard)

    Kubernetes 部署Web UI (Dashboard) 项目下载地址:https://github.com/kubernetes/kubernetes/tree/master/cluster/ ...

  8. Kubernetes 部署集群内部DNS服务

    Kubernetes 部署集群内部DNS服务 部署官网:https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/dns/ ...

  9. kubernetes部署spring cloud注册中心 Eureka

    系统环境 java JDK 1.8 Docker 18.09.6 kubernetes 1.16 创建Eureka Server 1.Maven引入相应的jar 引入 SpringBoot 做基础框架 ...

随机推荐

  1. BOM对象思维导图

  2. axios构建缓存池存储基础数据

    项目中经常出现需要多次使用的后端数据,通常的做法是通过变量缓存数据,或者通过类似vuex的东西来进行缓存,但是麻烦在于很可能需要判断一大堆的条件,或者说如果有权限控制的时候数据能否读取也是很麻烦的事情 ...

  3. Android 7.0正式版工厂镜像下载

    Android 7.0正式版工厂镜像下载 从3月份上线首个开发者预览版(Developer Preview)之后,经过近6个月时间的打磨,谷歌今天开始向Nexus设备推送Android 7.0 Nou ...

  4. hdu 6396 Swordsman (技巧)

    大意: n个怪, m种能力值, 当自己所有能力值不低于某只怪时可以杀死它, 并获得它的所有能力, 求最大杀几只 将每只怪拆成$m$个, 排下序贪心即可, 复杂度$O(nm)$, 原题极其卡时间, 我的 ...

  5. Netty高性能编程备忘录(上)

    http://calvin1978.blogcn.com/articles/netty-performance.html 网上赞扬Netty高性能的文章不要太多,但如何利用Netty写出高性能网络应用 ...

  6. Python简单网页爬虫——极客学院视频自动下载

    http://blog.csdn.net/supercooly/article/details/51003921

  7. 软工作业No.5 甜美女孩第三周yep

    需求&原型改进: 1. 针对课堂讨论环节老师和其他组的问题及建议,对修改选题及需求进行修改 (5分) 没有问题及建议 2. 修改完善上周提交的需求规格说明书(10分) 上周的<需求规格说 ...

  8. spring学习笔记Core Technologies

    Spring 框架最重要的是Ioc(Inversion of Control)容器,在这个基础之上衍生出了AOP(Aspect-Oriented Programming)技术,80/20法则,这货可以 ...

  9. Loom

    <iframe width="630" height="394" src="https://www.useloom.com/embed/a9d4 ...

  10. 使用 Git & Repo 下载代码

    客户端安装 Git 安装 git,gitk 网络连接正常的情况下: $ sudo apt-get install git-core gitk git-gui 不能上网,有.deb安装包的,请执行: $ ...