一张参考架构图:

从图中可以看到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. Linux Used内存到底哪里去了?

    原创文章,转载请注明: 转载自系统技术非业余研究 本文链接地址: Linux Used内存到底哪里去了? 前几天 纯上 同学问了一个问题: 我ps aux看到的RSS内存只有不到30M,但是free看 ...

  2. MySQL 事件跟踪器

    /*第一步 创建以下两个 日志表 */ CREATE TABLE `slow_log` ( `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMEST ...

  3. kubernetes资源清单入门

    创建nginx容器: kubectl run nginx-deploy8 --image=nginx:1.14-alpine --port=80 --replicas=2 deployment &qu ...

  4. flex布局学习总结

    最近项目主要是小程序,小程序里面的布局主要采用flex布局,之前对flex 布局只是稍作了解,总结下flex 布局的常用套路 容器 Flex是Flexible Box的缩写,意为"弹性布局& ...

  5. 疑难en_a

    1◆ a   æ eɪ ʌ ɑː ə      

  6. SQL Server 调优系列进阶篇 - 如何索引调优

    前言 上一篇我们分析了数据库中的统计信息的作用,我们已经了解了数据库如何通过统计信息来掌控数据库中各个表的内容分布.不清楚的童鞋可以点击参考. 作为调优系列的文章,数据库的索引肯定是不能少的了,所以本 ...

  7. 参数 out

    function outtest(out jo: ISuperObject; out s: string):Boolean; begin //进入函数时 jo =nil ErrStr = '' Res ...

  8. Oracle导出空表解决办法

    在oracle 11g 中,发现传统的exp不能导出空的表 oracle 11g 新增了一个参数:deferred_segment_creation,含义是段延迟创建,默认是true.具体是什么意思呢 ...

  9. Python3 urllib抓取指定URL的内容

    最近在研究Python,熟悉了一些基本语法和模块的使用:现在打算研究一下Python爬虫.学习主要是通过别人的博客和自己下载的一下文档进行的,自己也写一下博客作为记录学习自己过程吧.Python代码写 ...

  10. SQL 递归找查所有子节点及所有父节

    在SQL的树型结构中,很多时候,知道某一节点的值,需要查找该节点的所有子节点(包括多级)的功能,这时就需要用到如下的用户自定义函数. 表结构如下: ID int Dep_Type int Dep_Co ...