Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
20180126 M3 TechTalk OpenFaaSお試し
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
tshohe
January 26, 2018
Technology
94
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20180126 M3 TechTalk OpenFaaSお試し
tshohe
January 26, 2018
More Decks by tshohe
See All by tshohe
20190712 M3 TechTalk キーキャップ作る話
tshohe
0
1.5k
SRE Lounge #9 エムスリーはどのようにしてSREを始めたか
tshohe
11
19k
Other Decks in Technology
See All in Technology
コミュニティの有益性 ~JAWS Days 2026 での体験を通して~ / The Benefits of a Community ~Through My Experience at JAWS Days 2026~
seike460
PRO
0
300
徹底討論!ECS vs EKS!
daitak
3
1.8k
組織における AI-DLC 実践
askul
0
170
技術・能力を向上する原理原則 #きのこセッションa #きのこ2026
bash0c7
0
160
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
7.7k
週末にループ・エンジニアリングの理解を深めるためのスライド
nagatsu
0
610
AIをフル活用してオンコール機能のプロトタイプを2日で作った話 / Building an AI-Powered On-Call Prototype in Just Two Days
nari_ex
0
150
製造現場での生成AIの活用、およびエージェントAIの実装のあり方、AVEVAの取り組み
iotcomjpadmin
0
180
「勝手に広まる」人気 AI エージェントを爆速で作ろう!(AWS Summit Japan 2026講演資料)
minorun365
PRO
10
2.6k
時期が悪い!それでもRaspberry Piを買って遊んで活用するには / 20260627-osc26do-rpi-jikigawarui
akkiesoft
1
900
起点・思考・出力で分解する 〜PM業務の自動化設計〜
kazu_kichi_67
2
1.1k
打造你的 AI 工作流:Agent Skill + MCP 實戰工作坊
appleboy
0
180
Featured
See All Featured
Designing for Performance
lara
611
70k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
The Curious Case for Waylosing
cassininazir
1
410
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
330
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
160
Joys of Absence: A Defence of Solitary Play
codingconduct
1
400
Deep Space Network (abreviated)
tonyrice
0
210
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
210
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
620
Transcript
OpenFaaS Λࢼͯ͠Έͨ Shohei Takahashi
Who am I? • ߴڮ উฏʢ͔ͨ͠ ͠ΐ͏͍ʣ • 2017/11݄ೖࣾ •
ΠϯϑϥνʔϜॴଐͷSREͱͯ͠ಇ͍ͯ·͢ɻ • ٕज़ɿJava (Spring Boot), Python (Django), PostgreSQLɺ Elastic StackʢElasticsearch, Logstash, Kibanaʣ • झຯɿRaspberry Pi ༡ͼ
͜Ε·Ͱ • ϞϊϦγοΫͳΞϓϦ͔͠ॻ͍ͯͳ͍… • ӡ༻͢͠͞ͱ͔ಛʹҙࣝͯ͠ͳ͍… • ͳΜ͔ͦΕͬΆ͍͜ͱ͍ͨ͠
ڥ • ίʔυ͚ͩॻ͚͋ͱ͍͍ײ͡Ͱಈ͍ͯ͘ΕΔ • मਖ਼͕༰қɺଈ࠲ʹөՄೳ • ΠϯϑϥΛ͋·Γҙࣝ͠ͳͯ͘ྑ͍ • ӡ༻ଆཧָ͕ •
ͱ͔ʁ
OpenFaaS • ίϯςφܕαʔόϨεϑϨʔϜϫʔΫ • Docker/Swarm/Kubernetes⎈্ͰFaaSڥΛߏஙͰ͖ Δͭ • MITϥΠηϯε • ΫϥυαʔϏεͱҟͳΓॾʑͷ੍ݶͳ͠
• Auto-Sacle Մೳ
ಋೖ • KubernetesΛόοΫΤϯυͱͯ͠͏ͨΊͷϓϥάΠϯfaas-netes͕͋Δ • helmͰೖΔΒ͍͠ʢෆ۩߹͕͋ͬͨͷͰkubectlͰʣ • OpenFaaS on Kubernetes on
Rancher $ curl -LO https://github.com/openfaas/faas- netes/archive/master.zip $ unzip master.zip $ cd faas-netes-master $ kubectl apply -f ./namespaces.yml $ kubectl apply -f ./yaml
http://[kubernetes host]:31112/ui/
ྲྀΕ 1. function هࡌ 2. function Λ Docker image ͱͯ͠Ϗϧυ
3. Docker Registry ʹ push 4. function Λ deploy
function هࡌ • GUIͰ͍͍͚Ͳɺcliπʔϧ͕͋ΔͷͰͦΕΛ͏ʢbrewͰೖΔʣ • ্هίϚϯυͰԼهͷΑ͏ͳܗ͕࡞͞ΕΔ ʢݴޠPythonΛબɺ͍Ζ͍Ζબ·͢ʣ • template ……
֤ݴޠ༻ͷDockerfileʢgo, node.js, ruby, python, C#ʣ • ໊ؔσΟϨΫτϦ • handler.py ……. ࣮ࡍͷؔΛهࡌ͢Δɻ • requirement.txt …… ͍͍ͨύοέʔδ͕͋Ε • ໊ؔ.yml …… gateway, language, docker image nameઃఆ $ faas-cli new --lang python test-function $ ls template test-function test-function.yml
function هࡌ • stdinΛड͚औͬͯstdoutΛ݁Ռͱͯ͠ฦ͢functionΛهࡌ • ͻͱ·ͣ͠ࢉؔΛ࡞ $ vi test-function/handler.py import
json def handle(req): json_req = json.loads(req) answer = int(json_req["a"]) + int(json_req["b"]) result = {"answer": answer} print(json.dumps(result))
function Ϗϧυ • [Local Docker Registry]:5000/tshohe/test-function: 0.0.1 ͱͯ͠Ϗϧυ • ϩʔΧϧͰςετͱ͔Ͱ͖Δ
• ϕʔεͷpython 2.7-alpine͕Ͱ͔͍ͷͰɺ݁ߏͰ͔͍ $ faas-cli build -f ./test-function.yml $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE [Local Docker Registry]:5000/tshohe/test-function 0.0.1 ae45b01bb0bb 34 seconds ago 81.1MB
function deploy & ࣮ߦ • ͠ࢉ͕࣮ߦͰ͖ͯΔ • -> API Gateway
<-> Watchdog <-> Function $ faas-cli push -f ./test-function.yml $ faas-cli deploy -f ./test-function.yml $ curl [kubernetes host]:31112/function/test-function -d '{"a":1,"b": 2}' {"answer": 3}
• tagΛ0.0.2ʹͯ͠build & push & deploy • өʂ function मਖ਼
- answer = int(json_req["a"]) + int(json_req["b"]) + answer = int(json_req["a"]) * int(json_req[“b”]) $ curl [kubernetes host]:31112/function/test-function -d '{"a":1,"b":2}' {"answer": 2} • function Λमਖ਼ • tagΛࢦఆͯ͠͠deploy͢Ε͙ͤ͢Δ
function ࣮ߦ࣌ؒՄࢹԽ • Grafanaʹ༗ࢤ͕࡞ͨ͠μογϡϘʔυ͕͋Δ༷ • ҰॹʹPrometheusೖΔͷͰͦ͜Λσʔλιʔεʹࢦఆ͢Δ͚ͩ • AlertManagerσϑΥϧτͰઃఆ͞Ε͍ͯͨΓ͢Δʢ͔ͨ͠ෛՙ্ঢ࣌ɺίϯςφࣦؕ࣌ʣ
·ͱΊ • ׂΓͱ؆୯ʹࢼָͤͯ͛͠ • Ͳ͏αʔϏεΛߏஙͰ͖Δ͔ະ • ΠϕϯτΛݕ࣮ͯ͠ߦͰ͖Δͷ͔ɺͱ͔ • શମ૾ͷཧେมͦ͏ •
function ຖʹόʔδϣϯཧͱ͔ࠞཚͦ͠͏ • Auto-scaleɺFunction Chain ͱ͔ࢼͯ͠Έ͍ͨ
ͦͷଞ function • StoreͳΔͱ͜Ζʹ୭͔͕࡞͕ͬͨؔஔ͍ͯ͋ͬͨΓ