Supported OS Linux Windows Mac OS

インテグレーションバージョン1.2.0

概要

このチェックは、Datadog Agent を通じて Calico を監視します。

Calico チェックは、Calico で設定した Kubernetes クラスターのネットワークやセキュリティに関するメトリクスを送信します。

セットアップ

インストール

Calico チェックは Datadog Agent パッケージに含まれています。

Kubernetes クラスターベースの Agent でのインストール

アノテーションを使用する:

  1. クラスターに Calico をセットアップします。

  2. Calico コンポーネントのメトリクスを監視するの手順で、Prometheus のメトリクスを有効にします。 有効にすると、クラスター内で felix-metrics-svcprometheus-pod サービスが動作します。

  3. オートディスカバリーを使用するには、prometheus-pod を修正します。Prometheus の YAML コンフィギュレーションファイルに以下のスニペットを追加してください。

    metadata:
      [...]
      annotations:
       ad.datadoghq.com/prometheus-pod.check_names: |
       ["openmetrics"]
       ad.datadoghq.com/prometheus-pod.init_configs: |
       [{}]
       ad.datadoghq.com/prometheus-pod.instances: |
         [
            {
               "prometheus_url": "http://<FELIX-SERVICE-IP>:<FELIX-SERVICE-PORT>/metrics",
               "namespace": "calico",
               "metrics": ["*"]
            }
         ]
      spec:
        [....]
    

kubectl get all -all-namespaces を実行して、 <FELIX-SERVICE-IP><FELIX-SERVICE-PORT> の値を見つけることができます。

OS ベースの Agent でのインストール

  1. kubectl get all --all-namespaces を使って felix-metrics-svc サービスが実行するまで Calico コンポーネントのメトリクスを監視するに従います。

  2. minikube を使用している場合は、felix-metrics-svc にポート 9091 を転送する必要があります。 kubectl port-forward service/felix-metrics-svc 9091:9091 -n kube-system を実行します。

    minikube を使用していない場合は、felix-metrics-svc が外部 IP を持っているかを確認してください。サービスが外部 IP を持っていない場合は、kubectl edit svc を使用して、そのタイプを ClusterIP から LoadBalancer に変更してください。

構成

ホストで実行中の Agent でこのチェックを構成する場合は、手順に従ってください。コンテナ環境の場合は、コンテナ化セクションを参照してください。

ホスト

ホストで実行中の Agent に対してこのチェックを構成するには:

  1. Calico のパフォーマンスデータの収集を開始するには、Agent の構成ディレクトリのルートにある conf.d/ フォルダーの calico.d/conf.yaml ファイルを編集します。 必須パラメーターは openmetrics_endpoint の URL のみです。利用可能なすべての構成オプションは sample calico.d/conf.yaml を参照してください。

  2. minikube を使用している場合は、openmetrics_endpoint の URL として ‘http://localhost:9091/metrics’ を使用してください。 minikube を使用していない場合は、 openmetrics_endpoint の URL として http://<FELIX-METRICS-SVC-EXTERNAL-IP>:<PORT>/metrics を使用してください。

  3. Agent を再起動します

メトリクスの収集
  1. cassandra.d/conf.yaml ファイルは、デフォルトのコンフィギュレーションで、Calico メトリクスの収集が有効になっています。使用可能なすべてのコンフィギュレーションオプションについては、サンプル calico.d/conf.yaml を参照してください。

  2. Agent を再起動します

ログの収集

Calico の構造は Kubernetes クラスターで設定されているため、デプロイメント、ポッド、サービスなどで構築されています。Kubernetes インテグレーションでは、コンテナからログを取得します。

Kubernetes インテグレーションを設定すると、Datadog ログエクスプローラーで Calico のログが利用できるようになります。

Datadog Agent で、ログの収集はデフォルトで無効になっています。以下のように、datadog.yaml ファイルでこれを有効にします。

logs_enabled: true

コンテナ化

コンテナ環境の場合は、オートディスカバリーのインテグレーションテンプレートのガイドを参照して、次のパラメーターを適用してください。

メトリクスの収集
パラメーター
<インテグレーション名>calico
<初期コンフィギュレーション>空白または {}
<インスタンスコンフィギュレーション>{openmetrics_endpoint: <OPENMETRICS_ENDPOINT>}
ログの収集

Datadog Agent で、ログの収集はデフォルトで無効になっています。有効にする方法については、Kubernetes ログ収集を参照してください。

パラメーター
<LOG_CONFIG>{"source": "calico", "service": "<SERVICE_NAME>"}

検証

Agent の status サブコマンドを実行し、Checks セクションで calico を探します。

メトリクス

calico.felix.active.local_endpoints
(gauge)
Number of active endpoints on this host
calico.felix.active.local_policies
(gauge)
Number of policies on this host
calico.felix.active.local_selectors
(gauge)
Number of active selectors on this host
calico.felix.active.local_tags
(gauge)
Number of active tags on this host [versions < Calico v3.23]
calico.felix.cluster.num_host_endpoints
(gauge)
Total number of host endpoints cluster-wide
calico.felix.cluster.num_hosts
(gauge)
Total number of Calico hosts in the cluster
calico.felix.cluster.num_workload_endpoints
(gauge)
Total number of workload endpoints cluster-wide
calico.felix.int_dataplane_failures.count
(count)
Number of dataplane failures.
calico.felix.ipset.calls.count
(count)
Number of ipset commands executed
calico.felix.ipset.errors.count
(count)
Number of ipset command failures
calico.felix.ipsets.calico
(gauge)
Number of active Calico IP sets.
calico.felix.ipsets.total
(gauge)
Total number of active IP sets.
calico.felix.iptables.chains
(gauge)
Number of active iptables chains.
calico.felix.iptables.restore_calls.count
(count)
Number of iptables-restore calls.
calico.felix.iptables.restore_errors.count
(count)
Number of iptables-restore errors.
calico.felix.iptables.rules
(gauge)
Number of active iptables rules.
calico.felix.iptables.save_calls.count
(count)
Number of iptables-save calls.
calico.felix.iptables.save_errors.count
(count)
Number of iptables-save errors.

イベント

Calico インテグレーションには、イベントは含まれません。

サービスのチェック

トラブルシューティング

ご不明な点は、Datadog のサポートチームまでお問合せください。

その他の参考資料

お役に立つドキュメント、リンクや記事: