2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

loadBalancerSourceRanges 設定下のAKSでApplication Insights可用性テストを実施する方法

Last updated at Posted at 2025-02-18

概要

アクセス制限のないAzure Kubernetes Service環境のWebアプリであれば、単にApplication Insights 可用性テストを構成するだけで問題ありません。しかし、loadBalancerSourceRanges を設定して接続制限を行っている場合、単に可用性テストを構成しただけではエラーが発生し正常に動作しません。

本記事では、loadBalancerSourceRanges で制限がかけられた環境における対処方法について解説します。

対処方法

以下のリンクからJSONファイルをダウンロードし、JSONファイル内の "ApplicationInsightsAvailability" に含まれる "addressPrefixes" を、loadBalancerSourceRanges に追加してください。

有効ではない対処方法

以下の方法では、可用性テストは正常に動作しません。

  • NSGにてサービスタグ “ApplicationInsightsAvailability”を許可する方法
    プライベート環境への可用性テスト | Japan Azure Monitoring Support Blog

  • Annotations にてサービスタグを指定し、“ApplicationInsightsAvailability”を許可する方法
    以下のページのnoteに記載がありますが、loadBalancerSourceRanges が設定されている場合、service.beta.kubernetes.io/azure-allowed-service-tags は動作しません。

    Azure LoadBalancer | Cloud Provider Azure

    以下はnoteからの抜粋です。

    When loadBalancerSourceRanges have been set on service spec, service.beta.kubernetes.io/azure-allowed-service-tags won’t work because of DROP iptables rules from kube-proxy. The CIDRs from service tags should be merged into loadBalancerSourceRanges to make it work.

まとめ

対処方法としては、IPアドレスを直接許可する形になりますが、サービスタグを使用する方法は有効でないため、他に選択肢がありません。なお、確認できた範囲では数年来 "ApplicationInsightsAvailability" に含まれる "addressPrefixes" は変更がなく、頻繁に設定を変更する必要はないと考えられます。

関連情報

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?