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
100
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
190
コンテナ実践入門
shin5ok
0
120
AWS Partner Champion Members コンテナ編
shin5ok
0
88
AKSでマイクロサービス Bootcamp
shin5ok
0
180
Kubernetes has come on Azure / デモでわかるAKS
shin5ok
0
410
Azureで学ぶ 実践Kubernetes
shin5ok
3
2.3k
Azureで学ぶ 実践Kubernetes ハンズオン用資料
shin5ok
2
150
Azure コンテナプラットフォーム クイックツアー
shin5ok
0
170
Other Decks in Technology
See All in Technology
日経電子版 x AIエージェントの可能性とAgentic RAGによって提案書生成を行う技術
masahiro_nishimi
1
290
室長と気ままに学ぶマイクロソフトのビジネスアプリケーションとビジネスプロセス
ryoheig0405
0
320
Googleマップ/Earthが一般化した 地図タイルのイマ
mapconcierge4agu
1
200
PL900試験から学ぶ Power Platform 基礎知識講座
kumikeyy
0
110
7日間でハッキングをはじめる本をはじめてみませんか?_ITエンジニア本大賞2025
nomizone
2
1.4k
まだ間に合う! エンジニアのための生成AIアプリ開発入門 on AWS
minorun365
PRO
4
580
管理者しか知らないOutlookの裏側のAIを覗く#AzureTravelers
hirotomotaguchi
2
240
AndroidXR 開発ツールごとの できることできないこと
donabe3
0
110
Developer Summit 2025 [14-D-1] Yuki Hattori
yuhattor
19
5.1k
10分で紹介するAmazon Bedrock利用時のセキュリティ対策 / 10-minutes introduction to security measures when using Amazon Bedrock
hideakiaoyagi
0
170
SA Night #2 FinatextのSA思想/SA Night #2 Finatext session
satoshiimai
1
100
Postmanを使いこなす!2025年ぜひとも押さえておきたいPostmanの10の機能
nagix
2
120
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Building Adaptive Systems
keathley
40
2.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
12
950
Side Projects
sachag
452
42k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
A better future with KSS
kneath
238
17k
A designer walks into a library…
pauljervisheath
205
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
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