原创 OpenFaaS 101 - 3:Hello World

第一個列子,當然是 Hello World 了… 下面使用 Python, Go, Java 分別實現… 首先準備好目錄: └── helloworld ├── go ├── java └── python

原创 OpenFaaS 101 - 1 : Serverless & Faas

OpenFaaS 101 - 1 : Serverless & Faas 在開始 OpenFaaS 之前,需要先了解兩個概念: Serverless Computing, FaaS 近幾年 MicroService 微服務,Clo

原创 OpenFaaS 101 - 2 : 安裝 OpenFaaS 以及第一個 Function

首先 OpenFaaS 可以部署在 k8s, OpenShift, Docker Swarm 上,其中官方推薦使用 k8s Install faas-cli 如果是Mac的話,可以直接 brew install faas-cli

原创 Python 項目打包,上傳至Artifactory,並下載安裝

Python Packing Python Project結構 python_project/ package/ __init__.py xx.py setup.py LICENSE READM

原创 OpenFaaS 101 - 4:Design & Architecture

掌握了hello world之後,就來看看OpenFaaS架構 Overview 如上圖,OpenFaaS在架構上,屬於承上啓下的第二層,需要部署在k8s上,同時需要container registry存儲image;也需要NA

原创 kubernetes DNS

最近公司的k8s集羣中不時的會出現域名解析的問題,但排查問題的過程卻費了些時間,爲了以後的經驗積累,在這裏在梳理下用到的基本知識. DNS: /etc/resolv.conf 有四個重要的元素: nameserver //定義D

原创 Train Machine Learning models with MLflow, Deploy with Seldon

MLflow MLflow: the open-source platform for the machine leaning lifecycle, 管理machine learning整個生命週期的一款開源產品,主要提供了三種服

原创 Java單例模式double check locking在JDK1.5之前的問題

線上datadog最近總是在報警網站在登錄時頒發證書操作耗時太長,即spring security oauth2 endpoint /oauth/token這個API performance慢. 在閱讀源碼的時候看到了個有趣的地方

原创 Elastic Search Too Many Open Files Error

線上ES突然報錯too many open files 首先使用如下命令查看es cluster當前file descriptor status curl -XGET '127.0.0.1:9200/_cat/nodes?v&h=

原创 Kubernetes Namespace Stuck in status Terminating

公司的DEV kubernetes環境需要重新搭建,在搭建的過程中,發現了一個有趣的現象,在嘗試kubectl delete ns XX的時候, namespace一直卡在了Terminating的狀態上. 在嘗試了諸多方式後,只

原创 記一次Mysql死鎖deadlock

The deadlock is caused by below two scripts running in parallel from distributed scheduled tasks: Script 1: INSERT

原创 Mybatis Plugin

很多在service上的邏輯,可以由Mybatis在DAO層實現,比如說: 分頁,比較有名氣的PageHelper 對數據加密/解密 而想要在Mybatis上實現此類功能,則需要有Mybatis PLugin的幫助。 其主要思

原创 設計模式-責任鏈'Chain Of Responsiblity'

Mybatis中的Plugin是依賴Interceptor接口實現的,這裏面還用到了責任鏈模式 Chain of responsibility interceptorChain.addInterceptor(interceptor