一张参考架构图:

从图中可以看到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. English trip -- VC(情景课)4 B Parts of the body 身体部位

    xu言: ... Words eye  读音同 I     眼睛 nose 鼻子 ear   耳朵 tooth  牙齿 mouth  嘴 hair 头发 eyebrow  眉毛 cheek  脸颊 n ...

  2. python-day47--pymysql模块

    一.安装导入 #安装 pip3 install pymysql 二.使用 1 .基本使用 import pymysql # 链接,拿到游标 conn=pymysql.connect(host='loc ...

  3. POJ-3009 Curling 2.0 (DFS)

    Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But th ...

  4. SQL Server 存储过程 (需整理)

    Transact-SQL中的存储过程,非常类似于Java语言中的方法,它可以重复调用.当存储过程执行一次后,可以将语句缓存中,这样下次执行的时候直接使用缓存中的语句.这样就可以提高存储过程的性能. Ø ...

  5. BZOJ1652 [Usaco2006 Feb]Treats for the Cows

    蒟蒻许久没做题了,然后连动规方程都写不出了. 参照iwtwiioi大神,这样表示区间貌似更方便. 令f[i, j]表示i到j还没卖出去,则 f[i, j] = max(f[i + 1, j] + v[ ...

  6. TCP为什么是三次握手,为什么不是两次或者四次 && TCP四次挥手

    这是一个很有意思的问题~ 首先,我们要知道TCP是全双工的,即客户端在给服务器端发送信息的同时,服务器端也可以给客户端发送信息.而半双工的意思是A可以给B发,B也可以给A发,但是A在给B发的时候,B不 ...

  7. create rootfs.img using loop device

    reference: https://www.thegeekdiary.com/how-to-create-virtual-block-device-loop-device-filesystem-in ...

  8. HttpWebRequest HttpClient

    HttpWebRequest HttpClient 简单封装使用,支持https HttpWebRequest using System; using System.Collections.Gener ...

  9. tcp/ip协议之小解释

    [转载] http://www.ruanyifeng.com/blog/2009/03/tcp-ip_model.html

  10. NodeJS之express的路由浅析

    路由路径和请求方法一起定义了请求的端点,它可以是字符串.字符串模式或者正则表达式.后端在获取路由后,可通过一系列类似中间件的函数去执行事务. 可使用字符串的路由路径: // 匹配根路径的请求 app. ...