Kubernetes および OpenShift タグの設定オプション
タグの収集を有効にするには、次の手順を実行します。
<machine_agent_home>/extensions/ServerMonitoring/conf/ServerMonitoring.ymlファイルを編集します。- k8sTagsConfig: セクションで、enabled: "true" に設定します。
//ServerMonitoring.yml # WARNING: Before making any changes to this file read the following section carefully # After editing the file, make sure the file follows the yml syntax. Common issues include # - Using tabs instead of spaces # - File encoding should be UTF-8 # The safest way to edit this file is to copy paste the examples provided and make the # necessary changes using a plain text editor instead of a WYSIWYG editor. k8sTagsConfig: #If enabled it reports the Kubernetes Container tags to Controller enabled: true - (オプション)Master および Worker タグを取得するには、次のクラスタロールを適用する必要があります。クラスタエージェントを実行する前に、このクラスタロールを適用してください。この手順は、クラスタエージェント 24.2.0 以降を使用している場合は適用されません。
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: node-viewer rules: - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "watch"]k8sNodeTagsConfig では、enabled: true に設定します。
//ServerMonitoring.yml # WARNING: Before making any changes to this file read the following section carefully # After editing the file, make sure the file follows the yml syntax. Common issues include # - Using tabs instead of spaces # - File encoding should be UTF-8 # The safest way to edit this file is to copy paste the examples provided and make the # necessary changes using a plain text editor instead of a WYSIWYG editor. k8sNodeTagsConfig: # enabled indicate whether the machine agent should report the k8s Cluster Nodes # If enabled it reports whether the Node is a 'Master' node or 'Worker' node enabled: true