一张参考架构图:

从图中可以看到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. 5-11敏捷开发rails的章节: Rspec(使用方法) ,Slim(使用操作简介)

    Rspec: test Slim :可以取代ERB的模版语言.(简单了解了以下,方便写代码,但我觉得不方便读.还是用原生的html) Webpack管理css: 不再使用app/assets/styl ...

  2. Confluence 6 教程:在 Confluence 中导航

    当你对 Confluence 有所了解后,你会发现 Confluence 使用起来非常简单.这个教程主要是针对你使用的 Confluence 界面进行一些说明,同时向你展示在那里可以进行一些通用的任务 ...

  3. mac 安装nginx,并配置nginx的运行环境

    1. 安装nginx // 查询有没有nginx brew search nginx //开始安装nignx brew install nginx 2. 检查nignx是否安装成功 nginx -V ...

  4. 2-24-源码编译搭建LAMP环境-作业 ( By 小甘丶 )

    安装上课的内容要求: 实验环境: VMware Virtual Machine : System Version: CentOS6.8 ( Gan35 ) IP Address : 192.168.3 ...

  5. cf-789A (思维)

    A. Anastasia and pebbles time limit per test 1 second memory limit per test 256 megabytes input stan ...

  6. Oracle11g温习-第一章:Oracle 体系架构

    2013年4月27日 星期六 10:20 1.oracle 网络架构及应用环境 1. ORACLE 实例——包括内存结构与后台进程 2. ORACLE 数据库——物理操作系统文件的集合 3. 了解内存 ...

  7. WebSocket教程(一)

    一.websocket与http WebSocket是HTML5出的东西(协议),也就是说HTTP协议没有变化,或者说没关系,但HTTP是不支持持久连接的(长连接,循环连接的不算) 首先HTTP有 1 ...

  8. 对比springmvc与struts2

    转载:http://blog.csdn.net/chenleixing/article/details/44570681 1.Struts2是类级别的拦截, 一个类对应一个request上下文,Spr ...

  9. js组件的写法

    工作之中的不足,报了js培训班,因为工作加班原因缺了几天课(js组件开发),现在拾起来补补 <!doctype html> <html> <head> <me ...

  10. python--ConfigParser读写改配置文件

    from configparser import ConfigParser fp = 'conf.ini' #定义配置文件名 conf = ConfigParser() #实例化 conf.read( ...