Upgrade to Pro — share decks privately, control downloads, hide ads and more …

カオスエンジニアリングはじめの一歩のためのAWS FIS入門@Chaos Night / AWS FIS for starting chaos engineering

kanamsasa
July 20, 2022
160

カオスエンジニアリングはじめの一歩のためのAWS FIS入門@Chaos Night / AWS FIS for starting chaos engineering

2022/07/20 に実施された Chaos Night #1 - カオスエンジニアリングの夕べ ( https://chaos-jp.connpass.com/event/251694/ )の登壇資料です

kanamsasa

July 20, 2022
Tweet

More Decks by kanamsasa

Transcript

  1. © 2022, Amazon Web Services, Inc. or its affiliates.
    © 2022, Amazon Web Services, Inc. or its affiliates.
    カオスエンジニアリング
    初めの⼀歩のための
    AWS FIS ⼊⾨
    For Chaos Night #1
    Solutions Architect, DevAx , Amazon Web Sevices Japan G.K
    金森政雄

    View Slide

  2. © 2022, Amazon Web Services, Inc. or its affiliates.
    ⾃⼰紹介
    • ⾦森 政雄 (@masaosaan)
    Ø 所属/役職 :
    DevAx(Developer Acceleration) チーム
    ソリューションアーキテクト
    Ø 好きなサービス
    Amazon Elastic
    Container Service
    AWS Step Functions AWS Fault Injection
    Simulator

    View Slide

  3. © 2022, Amazon Web Services, Inc. or its affiliates.
    本⽇のアジェンダ
    1.カオスエンジニアリングを始める前に
    2.AWS FIS のご紹介
    3.Demo
    4.まとめ

    View Slide

  4. © 2022, Amazon Web Services, Inc. or its affiliates.
    © 2021, Amazon Web Services, Inc. or its affiliates.
    1.カオスエンジニアリング
    を始める前に
    4

    View Slide

  5. © 2022, Amazon Web Services, Inc. or its affiliates.
    カオスエンジニアリングの前に考えたいこと
    5
    ①現在のシステムの改善点を
    確認する
    ②可観測性(Observability) を確
    保する
    https://aws.amazon.com/well-architected/
    AWS Well-Architected Framework
    ログ

    View Slide

  6. © 2022, Amazon Web Services, Inc. or its affiliates.
    AWS Well-Architected(W-A) フレームワーク
    6
    A W S の ベ ス ト プ ラ ク テ ィ ス か ら シ ス テ ム の 改 善 点 を ⾒ つ け る
    (前準備)
    セルフチェック W-Aレビュー実施 クラウド最適化
    W-A の質問に答えながら、
    設計中の構成や既に運⽤し
    ているシステムの現状確認
    (棚卸し)を実施
    SA とベストプラクティスと
    のギャップを把握。様々なリ
    スクやクラウドに最適化でき
    るポイントを把握する
    ビジネス的な判断や優先度
    づけを実施し、よりクラウ
    ドに最適化していく
    2~3時間の集中的な打ち合わせ その後、再度レビュー実施して状況確認
    AWS Well-Architected Tools へ⼊⼒
    Your team
    TECHNICAL & BUSINESS
    LEADS
    APN
    Partner
    Your team
    TECHNICAL & BUSINESS
    LEADS
    APN
    Partner
    Your team
    TECHNICAL & BUSINESS
    LEADS
    APN
    Partner

    View Slide

  7. © 2022, Amazon Web Services, Inc. or its affiliates.
    可観測性(Observability)を確保する
    7
    シ ス テ ム の 定 常 状 態 と 何 が 起 き て い る か を 可 視 化 す る
    • システムの動作状況を把握できている状態
    • システム運⽤に置いて、判断に必要な情報がきちんと取得
    できている状態
    視認性 迅速なトラブル解決 顧客体験

    View Slide

  8. © 2022, Amazon Web Services, Inc. or its affiliates.
    実験から学びを得るために可観測性は必須
    8
    AWS Cloud AWS Cloud
    <可観測性がない場合> <可観測性を確保すると>

    - Chaos を注⼊しても何が起きたか不明
    - 意図せずにユーザに影響があるリスク
    - 振る舞いを確認し学びを得る
    - 万が⼀ユーザ影響がある場合に気付ける
    DB の負荷が想定外
    に上がっている

    View Slide

  9. © 2022, Amazon Web Services, Inc. or its affiliates.
    実験から学びを得るために可観測性は必須
    9
    AWS Cloud AWS Cloud
    <可観測性がない場合> <可観測性を確保すると>

    - Chaos を注⼊しても何が起きたか不明
    - 意図せずにユーザに影響があるリスク
    - 振る舞いを確認し学びを得る
    - 万が⼀ユーザ影響がある場合に気付ける
    DB の負荷が想定外
    に上がっている
    Without observability,
    you don't have chaos engineering.
    You just have chaos.
    Charity Majors
    Cofounder/CTO honeycomb.io

    View Slide

  10. © 2022, Amazon Web Services, Inc. or its affiliates.
    One Observability workshop
    One Observability WorkshopでAmazon CloudWatchを始めとしたObservability
    関連サービスの様々な機能を体感いただけます。
    https://catalog.workshops.aws/observability/ja-JP

    View Slide

  11. © 2022, Amazon Web Services, Inc. or its affiliates.
    カオスエンジニアリングの前に考えたいこと
    11
    ①現在のシステムの改善点を
    確認する
    ②可観測性(Observability) を確
    保する
    https://aws.amazon.com/well-architected/
    AWS Well-Architected Framework
    ログ
    →明⽰的な改善点がある場合、
    そちらを解決する⽅が確実かつ
    コストが低い
    →システムの振る舞いを
    観測できなければ実験から
    学ぶことはできない
    ③「誰も責めない」⽂化

    View Slide

  12. © 2022, Amazon Web Services, Inc. or its affiliates.
    AWS Resilience Hub (これは次回以降機会があれば)

    View Slide

  13. © 2022, Amazon Web Services, Inc. or its affiliates.
    © 2021, Amazon Web Services, Inc. or its affiliates.
    2.AWS FIS のご紹介

    View Slide

  14. © 2022, Amazon Web Services, Inc. or its affiliates.
    定常
    状態
    仮説
    実験
    検証
    改善
    カオスエンジニリングのプロセス

    View Slide

  15. © 2022, Amazon Web Services, Inc. or its affiliates.
    安全であるこ
    とを確認する
    難しさ
    複数のツールと
    お手製のスクリプト
    を使い分け
    1
    エージェントや
    ライブラリが必要 3
    2
    “現実の” イベントを
    再現する難しさ
    (複数のトラブル
    が同時に)
    4
    カオスエンジニアリングが難しいのはなぜか

    View Slide

  16. © 2022, Amazon Web Services, Inc. or its affiliates.
    セーフガード
    現実世界の状態
    簡単に始められる
    フルマネージドのカオスエンジニアリングサービス

    View Slide

  17. © 2022, Amazon Web Services, Inc. or its affiliates.
    AWS Fault Injection Simulator
    O V E R V I E W
    AWS Fault Injection
    Simulator
    Experiment
    template
    AWS Command
    Line Interface
    AWS Management
    Console
    AWS Identity and
    Access Management
    FIS safeguards
    FIS engine
    Compute
    Start experiment
    Third party
    AWS
    Amazon
    EventBridge
    Amazon
    CloudWatch
    alarms
    AWS resources
    Databases Networking Storage
    Compute
    Monitoring
    Stop experiment

    View Slide

  18. © 2022, Amazon Web Services, Inc. or its affiliates.
    複数のツールやお⼿製のスクリプトを
    統合したりエージェントのインストール
    は不要
    AWS マネジメントコンソールや
    AWS CLI を利⽤v
    事前に定義されたテンプレートを使い、
    数分で開始
    簡単に他のメンバに共有可能
    簡単に始められる

    View Slide

  19. © 2022, Amazon Web Services, Inc. or its affiliates.
    イベントを連続して、
    もしくは並⾏して実⾏
    システムの全てのレベルを対象に
    (host, infrastructure, network, etc.)
    サービスのコントロールプレーンの
    レベルで障害を注⼊
    現実世界の状態

    View Slide

  20. © 2022, Amazon Web Services, Inc. or its affiliates.
    Amazon CloudWatch との統合
    組み込まれたロールバック
    IAM によるきめ細かな制御
    セーフガード
    “停⽌条件” アラーム

    View Slide

  21. © 2022, Amazon Web Services, Inc. or its affiliates.
    実験テンプレート 実験
    アクション ターゲット
    コンポーネント

    View Slide

  22. © 2022, Amazon Web Services, Inc. or its affiliates.
    アクションは 実験中に実⾏する障害注⼊を定義
    aws::
    アクションが含むもの:
    • アクションタイプ
    • Duration(実験の時間)
    • ターゲット
    • 他のアクションとの実⾏タイミングの関係
    • アクションパラメータ
    (ロールバックの動作やスロットルするリクエストなど
    障害固有のパラメータ)
    アクション

    View Slide

  23. © 2022, Amazon Web Services, Inc. or its affiliates.
    ターゲット
    ターゲット はアクションを実⾏する1つ以上の
    AWS リソースを定義
    ターゲットが含むもの:
    • リソースタイプ
    • リソースID, タグ, フィルター
    • 選択モード (e.g. ALL, RANDOM)

    View Slide

  24. © 2022, Amazon Web Services, Inc. or its affiliates.
    実験テンプレート は実験を定義し、
    start-experiment のリクエストで使⽤される
    実験テンプレートが含むもの:
    • アクション
    • ターゲット
    • 停⽌条件
    • IAM ロール
    • 説明
    • タグ
    実験テンプレート

    View Slide

  25. © 2022, Amazon Web Services, Inc. or its affiliates.
    実験テンプレート A
    停⽌条件
    ターゲット
    アクション Action 1 Action 2
    Amazon
    CloudWatch alarm
    i-aaaa i-bbbb i-cccc
    特定の EC2 インスタンス
    実験テンプレート B
    停⽌条件
    ターゲット
    アクション
    Action 3
    Action 1
    Action 2
    Amazon
    CloudWatch alarms
    “chaos-ready” タグがついた
    全てのEC2 インスタンス

    View Slide

  26. © 2022, Amazon Web Services, Inc. or its affiliates.
    実験テンプレート as JSON
    {
    "tags": {
    "Name": "StopAndRestartRandomeInstance"
    },
    "description": ”FIS Stop and Restart One Random Instance",
    "roleArn": "arn:aws:iam::0123456789:role/MyFISExperimentRole",
    "stopConditions": [
    {
    "source": "aws:cloudwatch:alarm",
    "value": "arn:aws:cloudwatch:0123456789:alarm:No_Traffic"
    }
    ],
    "targets": {
    "myInstance": {
    "resourceTags": {
    "Purpose": "chaos-ready"
    },
    "resourceType": "aws:ec2:instance",
    "selectionMode": "COUNT(1)”
    }
    },
    "actions": {
    "StopInstances": {
    "actionId": "aws:ec2:stop-instances",
    "description": "stop the instances",
    "parameters": {
    "startInstancesAfterDuration": ”PT5M"
    },
    "targets": {
    "Instances": "myInstance"
    }
    }
    }
    }
    Description
    IAM role
    Stop conditions
    Targets
    Actions
    Name

    View Slide

  27. © 2022, Amazon Web Services, Inc. or its affiliates.
    © 2021, Amazon Web Services, Inc. or its affiliates.
    3. Demo
    28
    試したい方はこちらから
    https://go.aws/3aRxizP

    View Slide

  28. © 2022, Amazon Web Services, Inc. or its affiliates.
    © 2021, Amazon Web Services, Inc. or its affiliates.
    4. まとめ
    29

    View Slide

  29. © 2022, Amazon Web Services, Inc. or its affiliates.
    まとめ
    30
    • カオスエンジニアリングを始める前に
    • システムの改善点の棚卸しをしましょう!
    • AWS の場合Well-Architected Framework を参照
    • オブザーバビリティを確保しましょう!
    • 簡単に/安全に始めるためのマネージドサービス
    を利⽤して、まずはやってみる
    • AWS だと AWS FIS で簡単に始められます!

    View Slide

  30. © 2022, Amazon Web Services, Inc. or its affiliates.
    Appiendix
    31
    動画
    明⽇から始める!! Chaos Engineering 始め⽅ガイド
    ( AWS Summit Online Japan 2021 )
    https://www.youtube.com/watch?v=9M13W0sYgks
    Let's create an template for AWS FIS! (JAWS PANKRATION2021 )
    https://www.youtube.com/watch?v=TkiePjazPq0
    Builders.flush
    カオスエンジニアリングで本当にカオスにならないための進め⽅をグラレコで解説
    https://aws.amazon.com/jp/builders-flash/202110/awsgeek-fault-injection-simulator/
    AWS Fault Injection Simulator でカオスエンジニアリングの実験を始めてみよう !
    https://aws.amazon.com/jp/builders-flash/202111/try-chaos-engineering/
    AWS Fault Injection Simulator で始めるカオスエンジニアリング ~停⽌条件で安全な実験を⾏う
    https://aws.amazon.com/jp/builders-flash/202111/try-chaos-engineering/

    View Slide

  31. © 2022, Amazon Web Services, Inc. or its affiliates.
    Thank you!
    © 2021, Amazon Web Services, Inc. or its affiliates.

    View Slide