LoginSignup
0
0

More than 1 year has passed since last update.

Azure Application Gatewayを使ったIngressコントローラ(AGCI)をチュートリアルどおり実行してみた

Posted at

はじめに

チュートリアル: 新しい Application Gateway インスタンスを使用して新しい AKS クラスターのイングレス コントローラー アドオンを有効にする
今日は、このチュートリアルをやってみようと思います。AKSのチュートリアルを実行してみて詰まった部分を追記してみました。

前提条件

前提条件がわかりにくいので以下の通りまとめました。
Azure Cloud ShellリンクからBash実行に変更する。

image.png

ログイン

@Azure:~$ az login
Cloud Shell is automatically authenticated under the initial account signed-in with. Run 'az login' only if you need to use a different account
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code XXXXXXX to authenticate.

以下にアクセスしてenter the codeのXXXXXを入力
https://microsoft.com/devicelogin

しばらくログインが成功してsubscription情報が得られる

[
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "xxxxxxxxxxxxxxxxxxxx",
    "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "isDefault": false,
    "managedByTenants": [],
    "name": "Azure",
    "state": "Enabled",
    "tenantId": "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "user": {
      "name": "xxxxxxx@xxxxx.xxxx",
      "type": "user"
    }
  },
・
・
・
]

インストール

az upgrade
az aks install-cli
az extension add --name aks-preview
az version

{
  "azure-cli": "2.31.0",
  "azure-cli-core": "2.31.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "ai-examples": "0.2.5",
    "aks-preview": "0.5.48",
    "ssh": "1.0.0"
  }
}

デフォルトのサブスクリプション変更

az account set --subscription xxxxxxxxxxxxxxxxxx

各コマンド実行

以下はチュートリアル通り実行する

# リソースグループ作成
az group create --name myResourceGroup --location canadacentral

# AKS Application Gateway イングレス コントローラー アドオンを有効にしてデプロイ
az aks create \
-n myCluster \
-g myResourceGroup \
--network-plugin azure \
--enable-managed-identity \
-a ingress-appgw \
--appgw-name myApplicationGateway \
--appgw-subnet-cidr "10.2.0.0/16" \
--generate-ssh-keys

# resouce group
az aks get-credentials -n myCluster -g myResourceGroup

# マニフェストをアプライ
kubectl apply -f \
https://raw.githubusercontent.com/Azure/application-gateway-kubernetes-ingress/master/docs/examples/aspnetapp.yaml

確認

$ kubectl get ingress
NAME        CLASS    HOSTS   ADDRESS       PORTS   AGE
aspnetapp   <none>   *       20.104.4.39   80      7m32s

http://20.104.4.39/
image.png

まとめ

簡単に作れるものの、そのまま作ってしまうとデフォルトでService CIDR 10.0.0.0/16が指定されてしまいす。同じサブスクリプション、ロケーションですでにIPを使ってしまっている場合、作成することはできないという問題があります。
次回は、これを解決するチュートリアルを明後日にやります。
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0