Configuration Options for Kubernetes and OpenShift Tags
To enable tag collection:
- Edit the
<machine_agent_home>/extensions/ServerMonitoring/conf/ServerMonitoring.ymlfile. - Under the k8sTagsConfig: section enabled: "true".
CODE
//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 - (Optional) To get the Master and Worker tags, you must apply the following cluster role. Ensure to apply this cluster role before you run the Cluster Agent. This step is not applicable if you are using Cluster Agent 24.2.0 or later.
CODE
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: node-viewer rules: - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "watch"]For k8sNodeTagsConfig, set enabled: true
CODE//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