Supported OS Linux

概要

Red Hat OpenShift は、企業向けアプリケーションの開発とデプロイのための Kubernetes コンテナオーケストレーターに基づくオープンソースのコンテナアプリケーションプラットフォームです。

この README では、OpenShift 固有のメトリクスを Agent で収集するために必要なコンフィギュレーションについて説明します。以下に記載するデータは kubernetes_apiserver チェックによって収集されます。このチェックを、openshift.* メトリクスを収集するために構成する必要があります。

セットアップ

インストール

Agent のインストールには、Kubernetes の Agent のインストール方法を参照してください。デフォルトのコンフィギュレーションは、OpenShift 3.7.0+ と OpenShift 4.0+ (使用する機能およびエンドポイントが導入されたバージョン)を前提としています。

または、Datadog Operator を使用して Datadog Agent をインストールおよび管理することもできます。Datadog Operator は、OpenShift の OperatorHub を使用してインストールできます。

Security Context Constraints 構成

上記のインストール手順にリンクされている方法のいずれかを使用して Datadog Agent をデプロイする場合は、Agent がデータを収集するために Security Context Constraints (SCCs) を含める必要があります。デプロイに関連する以下の手順に従ってください。

SCC は、Datadog Agent の values.yaml 内で直接適用できます。ファイルの agents: セクションの下に次のブロックを追加します。

...
agents:
...
  podSecurity:
    securityContextConstraints:
      create: true
...

これは、Agent を最初にデプロイするときに適用できます。または、この変更を行った後に helm upgrade を実行して、SCC を適用することもできます。

ニーズとクラスターのセキュリティ制約に応じて、次の 3 つのデプロイシナリオがサポートされます。

Security Context Constraints制限付きホストネットワークカスタム
Kubernetes レイヤーの監視サポートサポートサポート
Kubernetes ベースのオートディスカバリーサポートサポートサポート
DogStatsD インテークサポート対象外サポートサポート
APM トレースインテークサポート対象外サポートサポート
ログネットワークインテークサポート対象外サポートサポート
ホストネットワークのメトリクスサポート対象外サポートサポート
Docker レイヤーの監視サポート対象外サポート対象外サポート
コンテナログの収集サポート対象外サポート対象外サポート
ライブコンテナモニタリングサポート対象外サポート対象外サポート
ライブプロセスモニタリングサポート対象外サポート対象外サポート

OpenShift に Datadog Operator と DatadogAgent リソースをインストールする方法については、OpenShift インストールガイド を参照してください。

Operator Lifecycle Manager (OLM) を使用して Operator をデプロイした場合、OpenShift に存在する必要なデフォルト SCC は自動的に datadog-agent-scc ServiceAccount に関連付けられます。Agent は、Node Agent と Cluster Agent ポッドでこの Service Account を参照しながら、DatadogAgent CustomResourceDefinition を使用してデプロイできます。

ログの収集

詳しくは、Kubernetes のログ収集を参照してください。

制限付き SCC オペレーション

このモードでは、kubelet と APIserver へのアクセスに必要な RBAC を除き、datadog-agent daemonset への付与が必要な権限は特にありません。この kubelet 専用テンプレートを使用して始めることもできます。

DogStatsD、APM、およびログの収集には、Datadog Agent をホストのポートにバインドする方法をお勧めします。そうすれば、ターゲット IP が変化せず、アプリケーションから簡単に検出できるからです。デフォルトの制限付き OpenShift SCC は、ホストポートへのバインドを許可しません。自身の IP でリッスンするように Agent を設定できますが、その IP を検出する処理をアプリケーションに作成する必要があります。

Agent を sidecar モードで実行できます。Agent をアプリケーションのポッド内で実行し、簡単に検出することが可能です。

ホスト

標準の hostnetworkhostaccess、あるいは自作の SCC を使用して allowHostPorts のアクセス許可をポッドに追加します。その場合、関連するポートバインディングを、ポッドの仕様に追加してください。

ports:
  - containerPort: 8125
    name: dogstatsdport
    protocol: UDP
  - containerPort: 8126
    name: traceport
    protocol: TCP

すべての機能に使用できるカスタム Datadog SCC

SELinux が permissive モードか、無効になっている場合、すべての機能を使用するには hostaccess SCC を有効にする必要があります。 SELinux が enforcing モードの場合は、datadog-agent ポッドに spc_t タイプを付与することをお勧めします。こちらの datadog-agent SCC を使用して Agent をデプロイしてください。datadog-agent サービスアカウントを作成した後でも、この SCC を適用できます。これにより、以下のアクセス許可が付与されます。

  • allowHostPorts: true: Dogstatsd / APM / ログインテークの、ノード IP へのバインドを許可します。
  • allowHostPID: true: UNIX ソケットによって送信された DogStatsD メトリクスに対する発信点検出を許可します。
  • volumes: hostPath: メトリクス収集に必要な、Docker ソケット、およびホストの proccgroup フォルダーへのアクセスを許可します。
  • SELinux type: spc_t: Docker ソケットと全プロセスの proccgroup フォルダにアクセスし、メトリクスを収集します。詳しくは超特権コンテナのコンセプトの紹介を参照してください。
新しく作成した datadog-agent SCC に、datadog-agent サービスアカウントを追加することを忘れないでください。それには、system:serviceaccount::users セクションに追加する必要があります。
OpenShift 4.0+: OpenShift インストーラーを、サポート対象のクラウドプロバイダーで使用した場合は、ホストのタグとエイリアスを取得するために、scc.yaml マニフェストで allowHostNetwork: true、Agent 構成で hostNetwork: true で SCC をデプロイする必要があります。そうしないと、ポッドのネットワークからメタデータサーバーへのアクセスが制限されます。

: Docker ソケットはルートグループが所有します。したがって、Docker メトリクスを取得するために、管理者特権を Agent に付与することが必要な場合があります。Agent プロセスをルートユーザーとして実行するには、SCC を次のように構成してください。

runAsUser:
  type: RunAsAny

検証

kubernetes_apiserver を参照

収集データ

メトリクス

openshift.appliedclusterquota.cpu.limit
(gauge)
Hard limit for cpu by cluster resource quota and namespace
Shown as cpu
openshift.appliedclusterquota.cpu.remaining
(gauge)
Remaining available cpu by cluster resource quota and namespace
Shown as cpu
openshift.appliedclusterquota.cpu.used
(gauge)
Observed cpu usage by cluster resource quota and namespace
Shown as cpu
openshift.appliedclusterquota.memory.limit
(gauge)
Hard limit for memory by cluster resource quota and namespace
Shown as byte
openshift.appliedclusterquota.memory.remaining
(gauge)
Remaining available memory by cluster resource quota and namespace
Shown as byte
openshift.appliedclusterquota.memory.used
(gauge)
Observed memory usage by cluster resource quota and namespace
Shown as byte
openshift.appliedclusterquota.persistentvolumeclaims.limit
(gauge)
Hard limit for persistent volume claims by cluster resource quota and namespace
openshift.appliedclusterquota.persistentvolumeclaims.remaining
(gauge)
Remaining available persistent volume claims by cluster resource quota and namespace
openshift.appliedclusterquota.persistentvolumeclaims.used
(gauge)
Observed persistent volume claims usage by cluster resource quota and namespace
openshift.appliedclusterquota.pods.limit
(gauge)
Hard limit for pods by cluster resource quota and namespace
openshift.appliedclusterquota.pods.remaining
(gauge)
Remaining available pods by cluster resource quota and namespace
openshift.appliedclusterquota.pods.used
(gauge)
Observed pods usage by cluster resource quota and namespace
openshift.appliedclusterquota.services.limit
(gauge)
Hard limit for services by cluster resource quota and namespace
openshift.appliedclusterquota.services.loadbalancers.limit
(gauge)
Hard limit for service load balancers by cluster resource quota and namespace
openshift.appliedclusterquota.services.loadbalancers.remaining
(gauge)
Remaining available service load balancers by cluster resource quota and namespace
openshift.appliedclusterquota.services.loadbalancers.used
(gauge)
Observed service load balancers usage by cluster resource quota and namespace
openshift.appliedclusterquota.services.nodeports.limit
(gauge)
Hard limit for service node ports by cluster resource quota and namespace
openshift.appliedclusterquota.services.nodeports.remaining
(gauge)
Remaining available service node ports by cluster resource quota and namespace
openshift.appliedclusterquota.services.nodeports.used
(gauge)
Observed service node ports usage by cluster resource quota and namespace
openshift.appliedclusterquota.services.remaining
(gauge)
Remaining available services by cluster resource quota and namespace
openshift.appliedclusterquota.services.used
(gauge)
Observed services usage by cluster resource quota and namespace
openshift.clusterquota.cpu.limit
(gauge)
Hard limit for cpu by cluster resource quota for all namespaces
Shown as cpu
openshift.clusterquota.cpu.remaining
(gauge)
Remaining available cpu by cluster resource quota for all namespaces
Shown as cpu
openshift.clusterquota.cpu.requests.used
(gauge)
Observed cpu usage by cluster resource for request
openshift.clusterquota.cpu.used
(gauge)
Observed cpu usage by cluster resource quota for all namespaces
Shown as cpu
openshift.clusterquota.memory.limit
(gauge)
Hard limit for memory by cluster resource quota for all namespaces
Shown as byte
openshift.clusterquota.memory.remaining
(gauge)
Remaining available memory by cluster resource quota for all namespaces
Shown as byte
openshift.clusterquota.memory.used
(gauge)
Observed memory usage by cluster resource quota for all namespaces
Shown as byte
openshift.clusterquota.persistentvolumeclaims.limit
(gauge)
Hard limit for persistent volume claims by cluster resource quota for all namespaces
openshift.clusterquota.persistentvolumeclaims.remaining
(gauge)
Remaining available persistent volume claims by cluster resource quota for all namespaces
openshift.clusterquota.persistentvolumeclaims.used
(gauge)
Observed persistent volume claims usage by cluster resource quota for all namespaces
openshift.clusterquota.pods.limit
(gauge)
Hard limit for pods by cluster resource quota for all namespaces
openshift.clusterquota.pods.remaining
(gauge)
Remaining available pods by cluster resource quota for all namespaces
openshift.clusterquota.pods.used
(gauge)
Observed pods usage by cluster resource quota for all namespaces
openshift.clusterquota.services.limit
(gauge)
Hard limit for services by cluster resource quota for all namespaces
openshift.clusterquota.services.loadbalancers.limit
(gauge)
Hard limit for service load balancers by cluster resource quota for all namespaces
openshift.clusterquota.services.loadbalancers.remaining
(gauge)
Remaining available service load balancers by cluster resource quota for all namespaces
openshift.clusterquota.services.loadbalancers.used
(gauge)
Observed service load balancers usage by cluster resource quota for all namespaces
openshift.clusterquota.services.nodeports.limit
(gauge)
Hard limit for service node ports by cluster resource quota for all namespaces
openshift.clusterquota.services.nodeports.remaining
(gauge)
Remaining available service node ports by cluster resource quota for all namespaces
openshift.clusterquota.services.nodeports.used
(gauge)
Observed service node ports usage by cluster resource quota for all namespaces
openshift.clusterquota.services.remaining
(gauge)
Remaining available services by cluster resource quota for all namespaces
openshift.clusterquota.services.used
(gauge)
Observed services usage by cluster resource quota for all namespaces

イベント

OpenShift チェックには、イベントは含まれません。

サービスのチェック

OpenShift チェックには、サービスのチェック機能は含まれません。

トラブルシューティング

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