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

AKSで動かすコンテナアプリ ハンズオン用資料

Avatar for shin5ok shin5ok
February 13, 2018

AKSで動かすコンテナアプリ ハンズオン用資料

ハンズオンの補足用に準備しました

Avatar for shin5ok

shin5ok

February 13, 2018
Tweet

More Decks by shin5ok

Other Decks in Technology

Transcript

  1. 項目名 設定値(値の例) CosmosDB URI mongodb://shkawanfree- co#####b00:j5wM8kl############GKSLJo8WvkitRvzN9Hb8k92YGAxW0zxz3hAYlvmE Yuw9H82TOwnfTwpt1w==@shkawanfree- #####00.documents.azure.com:10255/?ssl=true&replicaSet=globaldb 通知用Slack API

    https://hooks.slack.com/services/T95R#####/B96###/########## 通知用Slackチャンネル名 #message Log AnalyticsワークスペースID a37#####-6d28-49d2-93fc-ad######## Log Analyticsワークスペースキー w3W04tNBiPD9t2CdzAch0D0qoFoExHGlNPW#####NnlHkhm99UDXpWYVsAdwvboj68# ################### 今回使用したツール: https://[email protected]/shkawan/k8s.demo.git それぞれの取得方法はスライド中に記載しています
  2. # Change the current directory # Setup package you need

    # Install the azure-cli # Read bashrc to help your azure-cli completion # Set variables for AKS # Generate your ssh key if you don't have one
  3. # Login to Azure with cli # Create a resource

    group for AKS # Run the create AKS command and wait for a while0 1.7.7 # Confirm the AKS you built # Install kubectl and get credentials of the AKS
  4. # Re-read bashrc to help your kubectl completion # Edit

    your 2-secret.yml to replace MONGODB_URI value # Apply each manifest by order cd ../manifest # Confirm the external IP, it might take some minutes until you can see it
  5. # SLACK_API, MONGODB_URIをご自分の環境に合わせます # Example to get base64 string for

    SLACK_API # and replace one in 2-secret.yml https://hooks.slack.com/services/######/###/## | base64 aHR0cHM6Ly9ob29rcy#####8jIw==(encoded string) vi ./2-secret.yml # MONGODB_URIも同様に行います # apply the change kubectl apply -f ./2-secret.yml # delete the pods using MONGODB_URI or SLACK_API to restart them kubectl delete pod -n mynamespace -l app=mynotifypod kubectl delete pod -n mynamespace -l run=myappsample
  6. # Change the directory cd k8s.demo/manifest/loganalytics/ # Edit your configmap

    to replace your OMS workspace ID and key # you don't need to encode the ID and Key # Apply each manifest by order # Confirm the omsagents pod running on every node