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
Micro Service with AKS vol.2
Search
shin5ok
January 27, 2018
Technology
0
110
Micro Service with AKS vol.2
マイクロサービス基盤として使うAKS(kubernetes)
kubernetes未経験者を対象に、まずはアプリケーションを動かして体感しながら
特徴や注意点を学びます
shin5ok
January 27, 2018
Tweet
Share
More Decks by shin5ok
See All by shin5ok
Amazon EKS Quick Dive
shin5ok
1
1k
Amazon EKS Overview and Updates
shin5ok
0
230
コンテナ実践入門
shin5ok
0
150
AWS Partner Champion Members コンテナ編
shin5ok
0
93
AKSでマイクロサービス Bootcamp
shin5ok
0
190
Kubernetes has come on Azure / デモでわかるAKS
shin5ok
0
430
Azureで学ぶ 実践Kubernetes
shin5ok
3
2.4k
Azureで学ぶ 実践Kubernetes ハンズオン用資料
shin5ok
2
160
Azure コンテナプラットフォーム クイックツアー
shin5ok
0
180
Other Decks in Technology
See All in Technology
✨敗北解法コレクション✨〜Expertだった頃に足りなかった知識と技術〜
nanachi
1
780
GISエンジニアよ 現場に行け!
sudataka
1
140
AIドリブンのソフトウェア開発 - うまいやり方とまずいやり方
okdt
PRO
7
110
LLM 機能を支える Langfuse / ClickHouse のサーバレス化
yuu26
9
2.7k
Rethinking Incident Response: Context-Aware AI in Practice - Incident Buddy Edition -
rrreeeyyy
0
120
Jamf Connect ZTNAとMDMで実現! 金融ベンチャーにおける「デバイストラスト」実例と軌跡 / Kyash Device Trust
rela1470
1
210
会社にデータエンジニアがいることでできるようになること
10xinc
7
920
意志の力が9割。アニメから学ぶAI時代のこれから。
endohizumi
1
110
事業特性から逆算したインフラ設計
upsider_tech
0
240
[kickflow]20250319_少人数チームでのAutify活用
otouhujej
0
170
AIエージェントを現場で使う / 2025.08.07 著者陣に聞く!現場で活用するためのAIエージェント実践入門(Findyランチセッション)
smiyawaki0820
7
1.3k
[OCI Technical Deep Dive] OCIで生成AIを活用するためのソリューション解説(2025年8月5日開催)
oracle4engineer
PRO
0
120
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
810
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Gamification - CAS2011
davidbonilla
81
5.4k
Side Projects
sachag
455
43k
Typedesign – Prime Four
hannesfritz
42
2.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
Faster Mobile Websites
deanohume
309
31k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
Designing Experiences People Love
moore
142
24k
Transcript
None
None
None
None
None
None
None
None
None
None
None
None
Dockerデーモン アプリ3 アプリ1 アプリ2
アプリ1 アプリ2 アプリ3 アプリ6 アプリ4 アプリ5 アプリ6 アプリ9 アプリ8 アプリ10
Dockerデーモン Dockerデーモン Dockerデーモン アプリ7
None
アプリ1 アプリ2 アプリ3 アプリ6 アプリ4 アプリ5 アプリ6 アプリ9 アプリ8 アプリ10
Dockerデーモン Dockerデーモン アプリ7
None
None
None
https://octoverse.github.com/
https://kubernetes.io/
None
None
None
None
# なにも動いていないことを確認 shell > kubectl get pods # nginx公式1.13.5-alpineを取得して、mynginxという名前で実行 shell
> kubectl run mynginx --image=nginx:1.13.5-alpine # mynginxが動いていることを確認する shell > kubectl get pods NAME READY STATUS RESTARTS AGE mynginx-3071068301-pbvnz 1/1 Running 0 1h # IPを設定して公開、IPを確認する shell > kubectl expose deploy mynginx --port=80 --type=LoadBalancer shell > kubectl get services
None
None
https://kubernetes.io/docs/tutorials/object-management-kubectl/object-management/ 管理手法 操作対象 推奨環境 学習コスト 主なツール 命令的コマンド 動作中のオブジェクト 開発 低い
kubectl 等 命令的設定ファイル ファイル プロダクション 普通 エディタ Git 宣言的設定ファイル ディレクトリ ファイル プロダクション 高い エディタ Git
None
None
None
None
None
None
None
None
None
shell > git clone https://
[email protected]
/shkawan/docker-appsample.git
# Dockerhub上のサンプルアプリを取得して実行 shell > kubectl run myappsample --image=shkawan/appsample:v3.00 --record #
サンプルアプリが動いていることを確認する shell > kubectl get pods # IPを設定して公開、IPを確認する shell > kubectl expose deploy myappsample --port=80 --type=LoadBalancer shell > kubectl get services
shell > kubectl scale --replicas=5 deployment myappsample # サンプルアプリのレプリカが増えていることを確認する shell
> kubectl get pods shell > kubectl set image deployment myappsample myappsample=shkawan/appsample:v3.10 # サンプルアプリのPodにローリングアップデートがかかっていることを確認する shell > kubectl get pods --watch
Deployment Service Replicaset Pods Pods Pods Pods Pods kube-proxy API
Server
None
None
None
shell > MONGODB_URI=外部のMONGODBを参照するURI shell > kubectl set env deploy myappsample
MONGODB_URI=$MONGODB_URI
None
# まず AKSの名前、リソースグループの名前、deployするリージョンを決めます shell > AKS_NAME=shkawan-aks shell > AKS_RESOURCE_GROUP=$AKS_NAME shell
> AKS_LOCATION=westus2 # 準備 shell > az login shell > az group create -n $AKS_NAME -l $AKS_LOCATION # 1発 deploy shell > az aks create -n $AKS_NAME -g $AKS_RESOURCE_GROUP -l $AKS_LOCATION
'MC_{リソースグループ名}_{AKS名}_{リージョン名}' のリソースグループが自動生成 例: MC_shkawan-aks5_shkawan-aks5_westeurope
# kubectlコマンドのインストール shell > az aks install-cli # 資格情報の取得 shell
> az aks get-credential -g $RESOURCE_GROUP -n $AKS_NAME shell > kubectl version # 補完を有効に shell > echo "source <(kubectl completion bash)" >> ~/.bashrc shell > source ~/.bashrc
# 現在のノード数を確認 # Azureで確認 shell > az aks show -n
$AKS_NAME -g $AKS_RESOURCE_GROUP | jq .properties.agentPoolProfiles # k8s上での確認 shell > kubectl get nodes # コマンド一発 shell > az aks scale -n $AKS_NAME -g $AKS_RESOURCE_GROUP --node-count 5 # Azure上、k8s上で確認
# 現在のバージョンと、アップグレード可能なバージョンを確認 shell > az aks get-versions -n $AKS_NAME -g
$AKS_RESOURCE_GROUP -o table shell > az aks upgrade --kubernetes-version 1.8.1 -g $AKS_RESOURCE_GROUP -n $AKS_NAME
None
None
None
None
None
SSL Gateway用 × 2 アプリ表示用 × 3 通知用 × 2
コメント用 × 2 Cosmos DB Log Analytics
None
SSL Gateway用 × 2 アプリ表示用 × 3 通知用 × 2
コメント用 × 2 Cosmos DB Log Analytics Immutable Immutable Immutable Immutable
SSL Gateway用 × 2 アプリ表示用 × 4 通知用 × 2
コメント用 × 2 Cosmos DB Log Analytics
None
https://docs.microsoft.com/ja-jp/dotnet/standard/microservices-architecture/multi-container-microservice-net-applications/microservice-application-
None
None
• API Gateway • Service Registry / Service Discovery •
Circuit Breaker • Polyglot Persistence • Command Query Responsibility Segregation (CQRS) • Tolerant Reader • Chained Services • Asynchronous Messaging • Service Instantiation • Consumer-Driven Contracts • Domain Events
1つのコードベースと複数のデプロイ 依存関係の宣言と、分離 設定を環境変数に格納 バックエンドサービスはアタッチした リソースとして扱う ビルド、リリース、実行のステージを分離 アプリケーションを1つ以上の ステートレスなプロセスとして実行する ポートバインディングを通して サービスを公開する
プロセスモデルにより スケールアウトする 高速な起動と グレースフルシャットダウン 開発、ステージング、本番環境を できるだけ一致させる ログをイベントストリームとして扱う 管理タスクは1回限りのプロセスとして扱う
None
None
None
マイクロサービスのドメイン境界/サービス分割例 https://docs.microsoft.com/ja-jp/dotnet/standard/microservices-architecture/architect-microservice-container-applications/identify-microservice-domain- model-boundaries
None
None