From 2517e798cfb5287a138f34c480037654a0a5bf52 Mon Sep 17 00:00:00 2001 From: Yugar-1 Date: Thu, 19 Sep 2024 16:48:09 +0800 Subject: [PATCH] Expose options such as collector.interval of memory bandwidth exporter in k8s manifests and docker for user configuration. (#441) Signed-off-by: Yugar-1 --- .../memory-bandwidth-exporter/Dockerfile | 2 +- .../memory-bandwidth-exporter/README.md | 7 ++++++- .../config/manifests/memory-bandwidth-exporter.yaml | 12 +++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/kubernetes-addons/memory-bandwidth-exporter/Dockerfile b/kubernetes-addons/memory-bandwidth-exporter/Dockerfile index e69e26c1..857917b0 100644 --- a/kubernetes-addons/memory-bandwidth-exporter/Dockerfile +++ b/kubernetes-addons/memory-bandwidth-exporter/Dockerfile @@ -14,4 +14,4 @@ WORKDIR / COPY --from=builder /workspace/memory-bandwidth-exporter . ENTRYPOINT ["bash", "-c"] -CMD ["/memory-bandwidth-exporter --collector.node.name=${NODE_NAME} --collector.container.namespaceWhiteList=${NAMESPACE_WHITELIST}"] \ No newline at end of file +CMD ["/memory-bandwidth-exporter --collector.node.name=${NODE_NAME} --collector.container.namespaceWhiteList=${NAMESPACE_WHITELIST} --collector.interval=${COLLECTER_INTERVAL} --collector.container.metrics=${CONTAINER_METRICS} --collector.class.metrics=${CLASS_METRICS} --collector.node.metrics=${NODE_METRICS} --web.listen-address=${WEB_LISTEN_ADDRESS}"] \ No newline at end of file diff --git a/kubernetes-addons/memory-bandwidth-exporter/README.md b/kubernetes-addons/memory-bandwidth-exporter/README.md index 85a26e55..0488ac8f 100644 --- a/kubernetes-addons/memory-bandwidth-exporter/README.md +++ b/kubernetes-addons/memory-bandwidth-exporter/README.md @@ -74,7 +74,12 @@ curl http://localhost:9100/metrics make docker.build sudo docker run \ -e NODE_NAME= \ - -e NAMESPACE_WHITELIST="calico-apiserver,calico-system,kube-system,tigera-operator" \ + -e NAMESPACE_WHITELIST="kube-system" \ + -e COLLECTER_INTERVAL=1s \ + -e CONTAINER_METRICS="all" \ + -e CLASS_METRICS="none" \ + -e NODE_METRICS="none" \ + -e WEB_LISTEN_ADDRESS=":9100" \ --mount type=bind,source=/etc/containers/oci/hooks.d/,target=/etc/containers/oci/hooks.d/ \ --privileged \ --cgroupns=host \ diff --git a/kubernetes-addons/memory-bandwidth-exporter/config/manifests/memory-bandwidth-exporter.yaml b/kubernetes-addons/memory-bandwidth-exporter/config/manifests/memory-bandwidth-exporter.yaml index de7b7706..13f1900b 100644 --- a/kubernetes-addons/memory-bandwidth-exporter/config/manifests/memory-bandwidth-exporter.yaml +++ b/kubernetes-addons/memory-bandwidth-exporter/config/manifests/memory-bandwidth-exporter.yaml @@ -25,7 +25,17 @@ spec: fieldRef: fieldPath: spec.nodeName - name: NAMESPACE_WHITELIST - value: "calico-apiserver,calico-system,kube-system,tigera-operator" + value: "kube-system" + - name: COLLECTER_INTERVAL + value: 1s + - name: CONTAINER_METRICS + value: "all" + - name: CLASS_METRICS + value: "none" + - name: NODE_METRICS + value: "none" + - name: WEB_LISTEN_ADDRESS + value: ":9100" volumeMounts: - name: hooks mountPath: /etc/containers/oci/hooks.d/